jhb [Thu, 19 Nov 2009 19:25:47 +0000 (19:25 +0000)]
Several fixes to these drivers. Note that these two drivers are actually
just two different attachments (EISA and PCI) to a single driver.
- Add real locking. Previously these drivers only acquired their lock
in their interrupt handler or in the ioctl routine (but too broadly in
the latter). No locking was used for the stack calling down into the
driver via if_init() or if_start(), for device shutdown or detach. Also,
the interrupt handler held the driver lock while calling if_input(). All
this stuff should be fixed in the locking changes.
- Really fix these drivers to handle if_alloc(). The front-end attachments
were using if_initname() before the ifnet was allocated. Fix this by
moving some of the duplicated logic from each driver into pdq_ifattach().
While here, make pdq_ifattach() return an error so that the driver just
fails to attach if if_alloc() fails rather than panic'ing. Also, defer
freeing the ifnet until the driver has stopped using it during detach.
- Add a new private timer to drive the watchdog timer.
- Pass the softc pointer to the interrupt handlers instead of the device_t
so we can avoid the use of device_get_softc() and to better match what
other drivers do.
jhb [Thu, 19 Nov 2009 18:43:43 +0000 (18:43 +0000)]
- This driver used the if_watchdog timer both as a watchdog on transmit and
auto-negotiation. To make this simpler and easier to understand I have
split this out into two separate timers. One just manages the auto-neg
side of things and one is a transmit watchdog. Neither uses if_watchdog.
- Call ether_ifdetach() at the start of detach.
jhb [Thu, 19 Nov 2009 18:37:55 +0000 (18:37 +0000)]
- Use callout_init_mtx() instead of callout_init(..., CALLOUT_MPSAFE).
- Add a missing callout_drain() to detach.
- Hook into the stats timer and use that to drive the transmit watchdog
instead of using if_watchdog.
- Run the stats timer every second to match other drivers instead of every
other second.
- Remove dubious callout handling that stopped the timer only to start it
again while holding the driver lock without dropping it in between the
stop and the start.
jhb [Thu, 19 Nov 2009 18:21:51 +0000 (18:21 +0000)]
This driver has two modes, a netgraph mode and an ifnet mode. In the
netgraph mode it used a private timer to drive the transmit watchdog. In
the ifnet mode it used if_watchdog. Now it always uses the private timer.
bms [Thu, 19 Nov 2009 13:33:23 +0000 (13:33 +0000)]
Adapt r197135 to IPv6 stack:
Don't allow joins w/o source on an existing group.
This is almost always pilot error.
We don't need to check for group filter UNDEFINED state at t1,
because we only ever allocate filters with their groups, so we
unconditionally reject such calls with EINVAL.
Trying to change the active filter mode w/o going through IPV6_MSFILTER
is also disallowed.
bms [Thu, 19 Nov 2009 13:30:06 +0000 (13:30 +0000)]
Adapt r197132 to IPv6 stack:
Tighten input checking in in6p_join_group():
* Don't try to use the source address, when its family is unspecified.
* If we get a join without a source, on an existing inclusive
mode group, this is an error, as it would change the filter mode.
Fix a problem with the handling of in6_mfilter for new memberships:
* Do not rely on im6f being NULL; it is explicitly initialized to a
non-NULL pointer when constructing a membership.
* Explicitly initialize *im6f to EX mode when the source address
is unspecified.
This fixes a problem with in_mfilter slot recycling in the join path.
bms [Thu, 19 Nov 2009 12:18:30 +0000 (12:18 +0000)]
Adapt r197130 to IPv6 stack:
Fix an obvious logic error in the IPv4 multicast leave processing,
where the filter mode vector was not updated correctly after the leave.
jkim [Wed, 18 Nov 2009 23:40:19 +0000 (23:40 +0000)]
- Change internal function bpf_jit_compile() to return allocated size of
the generated binary and remove page size limitation for userland.
- Use contigmalloc(9)/contigfree(9) instead of malloc(9)/free(9) to make
sure the generated binary aligns properly and make it physically contiguous.
jkim [Wed, 18 Nov 2009 19:26:17 +0000 (19:26 +0000)]
- Make BPF JIT compiler working again in userland. We are limiting size of
generated native binary to page size for now.
- Update copyright date and fix some style nits.
alc [Wed, 18 Nov 2009 18:05:54 +0000 (18:05 +0000)]
Simplify both the invocation and the implementation of vm_fault() for wiring
pages.
(Note: Claims made in the comments about the handling of breakpoints in
wired pages have been false for roughly a decade. This and another bug
involving breakpoints will be fixed in coming changes.)
gonzo [Tue, 17 Nov 2009 21:56:12 +0000 (21:56 +0000)]
- Unbreak build with KLD_DEBUG defined
- Add debug.kld_debug sysctl to control KLD debugging level
- Print information about KLD dependencies with debug enabled
marius [Tue, 17 Nov 2009 21:08:10 +0000 (21:08 +0000)]
Unroll copying of the registers in {g,s}et_mcontext() and limit it
to the set actually restored by tl0_ret() instead of using the whole
trapframe. Additionally skip %g7 as that register is used as the
userland TLS pointer.
yongari [Tue, 17 Nov 2009 18:19:45 +0000 (18:19 +0000)]
It seems generation of link state change of e1000phy(4) is not
reliable on some Marvell PHYs. If msk(4) know it still does not
have established link check whether msk(4) missed the link state
change by looking into polled link state.
Reported by: Mel Flynn < mel.flynn+fbsd.current <> mailing.thruhere dot net >,
Gleb Kurtsou <gleb.kurtsou <> gmail dot com >
Tested by: Gleb Kurtsou <gleb.kurtsou <> gmail dot com >
jhb [Tue, 17 Nov 2009 16:43:02 +0000 (16:43 +0000)]
Always use a private timer instead of if_watchdog and if_timer to drive
the transmit watchdog. These drivers already used a private timer when
compiled to use Netgraph. This change just makes them always use the
private timer. Note that these drivers do not compile and are disconnected
from the build due to TTY changes.
obrien [Tue, 17 Nov 2009 16:29:39 +0000 (16:29 +0000)]
Catch up with r130332 which changed the default timezone from GMT to UTC.
Otherwise the tzload() (when called by gmtload()) fails to locate the UTC
file and loads the posixrules.
jhb [Tue, 17 Nov 2009 14:23:09 +0000 (14:23 +0000)]
Use a private callout timer to drive the transmit watchdog instead of using
if_watchdog and if_timer. The driver already contained an optional stats
timer that individual attachments could use to provide a 'tick' event. The
stats timer only ran if the tick function pointer was non-NULL and the
attachment's tick routine had to call callout_reset(), etc. Now the driver
always schedules a stat timer and manages the callout_reset() internally.
This timer is used to drive the watchdog and will also call the attachment's
'tick' handler if one is provided.
kib [Tue, 17 Nov 2009 11:39:15 +0000 (11:39 +0000)]
Among signal generation syscalls, only sigqueue(2) is allowed by POSIX
to fail due to lack of resources to queue siginfo. Add KSI_SIGQ flag
that allows sigqueue_add() to fail while trying to allocate memory for
new siginfo. When the flag is not set, behaviour is the same as for
KSI_TRAP: if memory cannot be allocated, set bit in sq_kill. KSI_TRAP is
kept to preserve KBI.
Add SI_KERNEL si_code, to be used in siginfo.si_code when signal is
generated by kernel. Deliver siginfo when signal is generated by kill(2)
family of syscalls (SI_USER with properly filled si_uid and si_pid), or
by kernel (SI_KERNEL, mostly job control or SIGIO). Since KSI_SIGQ flag
is not set for the ksi, low memory condition cause old behaviour.
Keep psignal(9) KBI intact, but modify it to generate SI_KERNEL
si_code. Pgsignal(9) and gsignal(9) now take ksi explicitely. Add
pksignal(9) that behaves like psignal but takes ksi, and ddb kill
command implemented as pksignal(..., ksi = NULL) to not do allocation
while in debugger.
While there, remove some register specifiers and use ANSI C prototypes.
delphij [Mon, 16 Nov 2009 22:52:52 +0000 (22:52 +0000)]
We should distinguish between a real truncated case and EOF after
BZ_STREAM_END triggered re-init. Do it by introducing a new flag
to represent the 'cold' case after bzip2 state is reinitialized.
This fixes regression reported on -current@ as well as another one
I found during twiddling with gzip.
mav [Mon, 16 Nov 2009 15:38:27 +0000 (15:38 +0000)]
Change the way in which AHCI+PATA combined controllers, such as JMicron
and Marvell handled. Instead of trying to attach two different drivers to
single device, wrapping each call, make one of them (atajmicron, atamarvell)
attach do device solely, but create child device for AHCI driver,
passing it all required resources. It is quite easy, as none of
resources are shared, except IRQ.
As result, it:
- makes drivers operation more independent and straitforward,
- allows to use new ahci(4) driver with such devices, adding support for
new features, such as PMP and NCQ, same time keeping legacy PATA support,
- will allow to just drop old ataahci driver, when it's time come.
phk [Mon, 16 Nov 2009 10:53:04 +0000 (10:53 +0000)]
Uppercase the UL suffix on a constant, so Flexelint doesn't worry that
'u1' might have been intended. No, that does not make sense and yes
I have told them.
bms [Sun, 15 Nov 2009 11:07:22 +0000 (11:07 +0000)]
Fix a functional regression in multicast.
Userland daemons need to see IGMP traffic regardless of the group;
omit the imo filter check if the proto is IGMP. The kernel part
of IGMP will have already filtered appropriately at this point.
MFC after: ASAP
Submitted by: Franz Struwig
Reported by: Ivor Prebeg, Franz Struwig
mav [Sat, 14 Nov 2009 20:23:20 +0000 (20:23 +0000)]
MFp4:
Remove code that years ago was closing race between request submission
to SIM and device/SIM freeze. That race become impossible after moving from
spl to mutex locking, while this workaround causes some unexpected effects.
marcel [Sat, 14 Nov 2009 18:14:07 +0000 (18:14 +0000)]
Fix an obvious panic by not casting from a pointer that is 4-bytes
alignment to a type that needs 8-byte alignment, and thus causing
misaligned memory references.
mav [Sat, 14 Nov 2009 16:20:07 +0000 (16:20 +0000)]
Previous solution appeared to be unsufficient. After additional testing
I have found that it is not only desktop CPUs problem. but mobile also.
Probably AP on laptops just started initially at lower frequency, hiding
the problem.
Disable frequency validation by default, for systems with more then one CPU,
until we can implement it properly. It looks like making more harm now then
benefits. Add 'hw.est.strict' loader tunable to control it.
Now my iXsystems Invincibook is able to run at 800MHz lowest frequency,
instead of 1200MHz before, when 800MHz was incorrectly reported invalid.
mav [Sat, 14 Nov 2009 14:16:02 +0000 (14:16 +0000)]
Desktop Core2Duo/Core2Quad CPUs are unable to control frequency of single
CPU core, only pair of them. As result, both cores are running on highest
one of requested frequencies, and that is reported by status register.
Such behavior confuses frequency validation logic, as it runs on only
one core, as SMP is not yet launched, making EIST completely unusable.
To workaround this, add check for validation result. If we haven't found
at least two usable frequencies, then probably we are looking bad and have
to trust data provided by BIOS as-is.
attilio [Fri, 13 Nov 2009 22:57:20 +0000 (22:57 +0000)]
Add sysctls in ahd(4) in order to keep track of different classes of
errors. So far 3 different classes are present (correctable,
uncorrectable and fatal) but more can be added easilly.
mav [Fri, 13 Nov 2009 22:53:49 +0000 (22:53 +0000)]
Add support for SATA ports on SATA+PATA Marvell controllers.
These controllers provide combination of AHCI for SATA and legacy
PCI ATA for PATA. Use same solution as used for JMicron controllers.
Add IDs of Marvell 88SX6102, 88SX6111. 88SX6141 alike controllers