Commit Graph

21092 Commits

Author SHA1 Message Date
Alexander Motin
48fe2e6719 Quick fix for unmotivated C2 state usage during boot, introduced at r212541.
That caused LAPIC timer failure and huge delays during boot on some systems.
2010-09-22 11:32:22 +00:00
Andriy Gapon
9c2d052943 acpi_attach: do not explicitly install default handlers for default
address spaces

There has been no need to do that starting with ACPICA 20040427 as
AcpiEnableSubsystem() installs the handlers automatically.
Additionaly, explicitly calling AcpiInstallAddressSpaceHandler before
AcpiEnableSubsystem is not supported by ACPICA and leads to too early
execution of _REG methods in some DSDTs, which may result in problems.

Big thanks to Robert Moore of ACPICA/Intel for explaining the above.

Reported by:	Daniel Bilik <daniel.bilik@neosystem.cz>
Tested by:	Daniel Bilik <daniel.bilik@neosystem.cz>
Reviewed by:	jkim
Suggested by:	"Moore, Robert" <robert.moore@intel.com>
MFC after:	1 week
2010-09-22 06:10:22 +00:00
MIHIRA Sanpei Yoshiro
87b6f1855b Add new device ids.
Buffalo (Melco Inc.) LUA3-U2-AGT
 Logitec LAN-GTJ/U2A(usb/119981)

PR:		usb/119981 and me
Submitted by:	"Y.Okabe" <be_works_us at yahoo.com>, hiroo at oikumene.gcd.org
Reviewed by:	thompsa
MFC after:	3 days
2010-09-21 22:42:14 +00:00
Pyun YongHyeon
fc05868abd Remove unnecessary controller reinitialization.
PR:	kern/87506
2010-09-21 17:52:32 +00:00
Pyun YongHyeon
e9dfd82ff1 Remove unnecessary controller reinitialization.
StarFire controller does not require controller reinitialization to
program perfect filters. While here, make driver immediately exit
from interrupt/polling handler if driver reinitialized controller.

PR:	kern/87506
2010-09-21 17:42:19 +00:00
Pyun YongHyeon
744ec7f282 Make sure to clear IFF_DRV_RUNNING to reinitialize controller.
While I'm here update if_oerrors counter when driver encounters
watchdog timeout.
2010-09-21 17:31:14 +00:00
Pyun YongHyeon
b7dc7dd4f5 Remove unnecessary controller reinitialization.
PR:	kern/87506
2010-09-21 17:25:15 +00:00
John Baldwin
8385f4cf94 Tweak the stats exported by the e1000 drivers:
- Add a single sysctl procedure to all three drivers to read an arbitrary
  register (the register is passed as arg2).  Use it to replace existing
  routines in igb(4) that used a separate routine for each register, and
  to add support for missing stats in em(4) and lem(4).
- Move the 'rx_overruns' and 'watchdog_timeouts' stats out of the MAC stats
  section as they are driver stats, not MAC counters.
- Simplify the code that creates per-queue stats in igb(4) to use a single
  loop and remove duplicated code.
- Properly read all 64 bits of the 'good octets received/transmitted' in
  em(4) and lem(4).
- Actually read the interrupt count registers in em(4), and drop the
  'host to card' sysctl stats from em(4) as they are not implemented in
  any of the hardware this driver supports.
- Restore several stats to em(4) that were lost in the earlier stats
  conversion including per-queue stats.
- Export several MAC stats in em(4) that were exported in igb(4) but not
  in em(4).
- Export stats in lem(4) using individual sysctls as in em(4) and igb(4).

Reviewed by:	jfv
MFC after:	1 week
2010-09-20 16:04:44 +00:00
Bernhard Schmidt
71203720f3 Fix typo in previous commit. 2010-09-19 12:52:23 +00:00
Bernhard Schmidt
d8ac0e6633 Rewrite parts of the calibration code which is run while bringing up
the device:
- unobscure some of the code by moving it into its own functions
- get rid of some magic numbers
- create similar structure as the reference driver has, this should
  make further syncs easier
2010-09-19 12:47:41 +00:00
Bernhard Schmidt
0fc7c4008f Group functions used for initial calibration. 2010-09-19 12:39:04 +00:00
Nick Hibma
15dba72121 Cleanup white space and typos. 2010-09-18 22:37:47 +00:00
Jung-uk Kim
a90b8833d2 Rework r210248. Although it fixed most of problems, it did not fix one
particular edge case where X-axis resolution is not multiple of font width.
Now we just advance enough scan lines, then deduct a partial scan line.
It is more intuitive than the previous code.  Apply the same wisdom to EGA
and VGA planar renderers for consistency.

Reported by:	David DEMELIER (demelier dot david at gmail dot com)
2010-09-17 23:09:31 +00:00
Kenneth D. Merry
0b883cf6b4 Fix a couple of mps problems.
When the driver is completely saturated with commands (1024 in the
case of the SAS2008 in my test system), I/O stops.  If we tell CAM
that we have one less command slot than we have actually allocated,
everything works fine.  We also need a few extra command slots to
allow for aborts and other task management commands to be sent down.

This needs more investigation to determine the root cause, but for
now this fixes things in my testing.

mps.c:		Change a printf() to mps_printf().

mps_sas.c:	Subtract 5 command slots when we tell CAM how many
		commands we can handle.

		Add some commented-out logic to print the contents
		the CDBs for timed-out commands.  This can help
		in debugging devices that are timing out.  This
		will be uncommented once I bring some CAM changes in.

Reported by:	Andrew Boyer <aboyer at averesystems dot com>
2010-09-17 21:53:56 +00:00
Ed Maste
dbb34a64a0 Use device_printf where possible, and otherwise at least include the
driver name in printf strings.

Reported by:	Mark Johnston
2010-09-16 23:33:24 +00:00
Kenneth D. Merry
63feedfd46 MFp4 (//depot/projects/mps/...):
According to the MPT2 spec, task management commands are
serialized, and so no I/O should start while task management
commands are active.

So, to comply with that, freeze the SIM queue before we send any
task management commands (abort, target reset, etc.) down to the
IOC.  We unfreeze the queue once the task management command
completes.

It isn't clear from the spec whether multiple simultaneous task
management commands are supported.  Right now it is possible to
have multiple outstanding task management commands, especially in
the abort case.  Multiple outstanding aborts do complete
successfully, so it may be supported.

We also don't yet have any recovery mechanism (e.g. reset the IOC)
if the task management command fails.
2010-09-16 22:54:56 +00:00
Xin LI
9ed03f0231 status bits should be &'ed against status to be really functional.
Reported by:	Jike Song
Reviewed by:	yongari
MFC after:	1 week
2010-09-16 21:06:23 +00:00
Jung-uk Kim
01b36cb089 Remove an unnecessary hack from ACPICA 20100915 (r212761). 2010-09-16 20:11:40 +00:00
Jung-uk Kim
42fecd1294 Merge ACPICA 20100915. 2010-09-16 20:08:00 +00:00
Attilio Rao
dfe2c294f3 Implement device unbusying via a cdevpriv destructor.
Suggested by:	jhb
Tested by:	Mark Johnston <mjohnston at sandvine dot com>
Reviewed by:	emaste, jhb
MFC after:	10 days
X-MFC:		r212661
2010-09-16 17:49:10 +00:00
Pyun YongHyeon
767c3593eb Fix incorrect RX BD producer updates. The producer index was
already updated after allocating mbuf so driver had to use the last
index instead of using next producer index. This should fix driver
hang which may happen under high network load.

Reported by:	Igor Sysoev <is <> rambler-co dot ru>, Vlad Galu <dudu <> dudu dot ro>
Tested by:	Igor Sysoev <is <> rambler-co dot ru>, Vlad Galu <dudu <> dudu dot ro>
MFC after:	10 days
2010-09-16 17:32:37 +00:00
Matthew D Fleming
4e6571599b Re-add r212370 now that the LOR in powerpc64 has been resolved:
Add a drain function for struct sysctl_req, and use it for a variety
of handlers, some of which had to do awkward things to get a large
enough SBUF_FIXEDLEN buffer.

Note that some sysctl handlers were explicitly outputting a trailing
NUL byte.  This behaviour was preserved, though it should not be
necessary.

Reviewed by:    phk (original patch)
2010-09-16 16:13:12 +00:00
Alexander Motin
bf12976c76 Fix panic, when due to some kind of congestion on FIS-based switching
port multiplier some command triggers false positive timeout, but then
completes normally.

MFC after:	2 weeks
2010-09-16 12:39:50 +00:00
Marius Strobl
65f2c0ff58 Merge r207585 from cas(4):
- Don't probe for PHYs if we already know to use a SERDES. Unlike as with
  cas(4) this only serves to speed up the the device attach though and can
  only be determined via the OFW device tree but not from the VPD.
- Don't touch the MIF when using a SERDES.
- Add some missing bus space barriers, mainly in the PCS code path.
2010-09-16 09:29:48 +00:00
Navdeep Parhar
225f5b4adc Fix t3_gate_rx_traffic and t3_open_rx_traffic. Parts of them always operated
on XGMAC0 instead of the specified XGMAC.

MFC after:	3 days
2010-09-15 21:50:37 +00:00
Attilio Rao
04f798ecea Fix bogus busying mechanism from cdevsw callbacks:
- D_TRACKCLOSE may be used there as d_close() are expected to match up
  d_open() calls
- Replace the hand-crafted counter and flag with the
  device_busy()/device_unbusy() proper usage.

Sponsored by:	Sandvine Incorporated
Reported by:	Mark Johnston <mjohnston at sandvine dot com>
Tested by:	Mark Johnston
Reviewed by:	emaste

MFC after:	10 days
2010-09-15 14:24:21 +00:00
Ed Maste
435c8a15cf Add some enums and constants from Adaptec's latest driver
(build 17911).
2010-09-15 01:19:11 +00:00
Marius Strobl
6c3c4d7109 Use saner nsegments and maxsegsz parameters when creating certain DMA tags;
tags for 1-byte allocations cannot possibly be split across 2 segments and
maxsegsz must not exceed maxsize.
2010-09-14 20:41:06 +00:00
Kenneth D. Merry
cb1d2fe2cd MFp4: (//depot/projects/mps/...)
Report data overruns properly.

Submitted by:	scottl
2010-09-14 17:22:06 +00:00
Ed Maste
3e50771086 Avoid repeatedly spamming the console while a timed out command is waiting
to complete.  Instead, print one message after the timeout period expires,
and one more when (if) the command eventually completes.

MFC after:	1 month
2010-09-14 01:51:04 +00:00
Jung-uk Kim
f6ff063a6e Fix segment:offset calculation of interrupt vector for relocated video BIOS
when the original offset is bigger than size of one page.  X86BIOS macros
cannot be used here because it is assumed address is only linear in a page.

Tested by:	netchild
2010-09-13 19:58:46 +00:00
Matthew D Fleming
404a593e28 Revert r212370, as it causes a LOR on powerpc. powerpc does a few
unexpected things in copyout(9) and so wiring the user buffer is not
sufficient to perform a copyout(9) while holding a random mutex.

Requested by: nwhitehorn
2010-09-13 18:48:23 +00:00
Andriy Gapon
09c22c66e1 acpi_cpu: do not apply P_LVLx_LAT rules to latencies returned by _CST
ACPI specification sates that if P_LVL2_LAT > 100, then a system doesn't
support C2; if P_LVL3_LAT > 1000, then C3 is not supported.
But there are no such rules for Cx state data returned by _CST.  If a
state is not supported it should not be included into the return
package.  In other words, any latency value returned by _CST is valid,
it's up to the OS and/or user to decide whether to use it.

Submitted by:	nork
Suggested by:	mav
MFC after:	1 week
2010-09-13 09:51:24 +00:00
Alexander Motin
a157e42516 Refactor timer management code with priority to one-shot operation mode.
The main goal of this is to generate timer interrupts only when there is
some work to do. When CPU is busy interrupts are generating at full rate
of hz + stathz to fullfill scheduler and timekeeping requirements. But
when CPU is idle, only minimum set of interrupts (down to 8 interrupts per
second per CPU now), needed to handle scheduled callouts is executed.
This allows significantly increase idle CPU sleep time, increasing effect
of static power-saving technologies. Also it should reduce host CPU load
on virtualized systems, when guest system is idle.

There is set of tunables, also available as writable sysctls, allowing to
control wanted event timer subsystem behavior:
  kern.eventtimer.timer - allows to choose event timer hardware to use.
On x86 there is up to 4 different kinds of timers. Depending on whether
chosen timer is per-CPU, behavior of other options slightly differs.
  kern.eventtimer.periodic - allows to choose periodic and one-shot
operation mode. In periodic mode, current timer hardware taken as the only
source of time for time events. This mode is quite alike to previous kernel
behavior. One-shot mode instead uses currently selected time counter
hardware to schedule all needed events one by one and program timer to
generate interrupt exactly in specified time. Default value depends of
chosen timer capabilities, but one-shot mode is preferred, until other is
forced by user or hardware.
  kern.eventtimer.singlemul - in periodic mode specifies how much times
higher timer frequency should be, to not strictly alias hardclock() and
statclock() events. Default values are 2 and 4, but could be reduced to 1
if extra interrupts are unwanted.
  kern.eventtimer.idletick - makes each CPU to receive every timer interrupt
independently of whether they busy or not. By default this options is
disabled. If chosen timer is per-CPU and runs in periodic mode, this option
has no effect - all interrupts are generating.

As soon as this patch modifies cpu_idle() on some platforms, I have also
refactored one on x86. Now it makes use of MONITOR/MWAIT instrunctions
(if supported) under high sleep/wakeup rate, as fast alternative to other
methods. It allows SMP scheduler to wake up sleeping CPUs much faster
without using IPI, significantly increasing performance on some highly
task-switching loads.

Tested by:	many (on i386, amd64, sparc64 and powerc)
H/W donated by:	Gheorghe Ardelean
Sponsored by:	iXsystems, Inc.
2010-09-13 07:25:35 +00:00
Alexander Motin
373d257ef0 Add tunable 'hint.hpet.X.per_cpu' to specify how much per-CPU timers driver
should provide if there is sufficient hardware. Default is 1.
2010-09-13 06:32:56 +00:00
Alexander Motin
6184f8d60e Instead of storing last event timestamp, store the next event timestamp.
It corrects handling of the first event offset in emulated periodic mode.
2010-09-12 11:11:53 +00:00
Marius Strobl
cdb25d827e Change OF_interpret() to also take an array of cell_t (missed in r209801).
Reviewed by:	nwhitehorn
2010-09-11 18:55:00 +00:00
Andriy Gapon
f5aadc99a6 make acpi_hp device a child of acpi_wmi
to properly reflect dependency between the devices/drivers

PR:		kern/147858
Suggested by:	jhb
Tested by:	Maciej Suszko <maciej@suszko.eu>
MFC after:	1 week
2010-09-11 08:09:14 +00:00
Kenneth D. Merry
d3c7b9a08a MFp4 (//depot/projects/mps/...)
Bring in a driver for the LSI Logic MPT2 6Gb SAS controllers.

This driver supports basic I/O, and works with SAS and SATA drives and
expanders.

Basic error recovery works (i.e. timeouts and aborts) as well.

Integrated RAID isn't supported yet, and there are some known bugs.

So this isn't ready for production use, but is certainly ready for
testing and additional development.  For the moment, new commits to this
driver should go into the FreeBSD Perforce repository first
(//depot/projects/mps/...) and then get merged into -current once
they've been vetted.

This has only been added to the amd64 GENERIC, since that is the only
architecture I have tested this driver with.

Submitted by:	scottl
Discussed with:	imp, gibbs, will
Sponsored by:	Yahoo, Spectra Logic Corporation
2010-09-10 15:03:56 +00:00
Andriy Gapon
3d844eddb7 bus_add_child: change type of order parameter to u_int
This reflects actual type used to store and compare child device orders.
Change is mostly done via a Coccinelle (soon to be devel/coccinelle)
semantic patch.
Verified by LINT+modules kernel builds.

Followup to:	r212213
MFC after:	10 days
2010-09-10 11:19:03 +00:00
Bernhard Schmidt
571d92b012 Fix firmware module dependencies.
malo and mwl use the firmware framework to access firmware images.
Depending on the firmware modules itself is not required and in this
case even wrong because no modules with those names exist.

Pointed out by:	brucec
MFC after:	1 week
2010-09-10 08:11:48 +00:00
John Baldwin
d1a02e0932 Catch up to rename of the constant for the Master Data Parity Error bit in
the PCI status register.

Pointed out by:	mdf
Pointy hat to:	jhb
2010-09-09 20:26:30 +00:00
Matthew D Fleming
10e0075ddb Fix an incorrect use of sbuf_overflowed() after a call to sbuf_finish(). 2010-09-09 18:35:08 +00:00
Matthew D Fleming
dd67e2103c Add a drain function for struct sysctl_req, and use it for a variety of
handlers, some of which had to do awkward things to get a large enough
FIXEDLEN buffer.

Note that some sysctl handlers were explicitly outputting a trailing NUL
byte.  This behaviour was preserved, though it should not be necessary.

Reviewed by:	phk
2010-09-09 18:33:46 +00:00
John Baldwin
da6b22afaf - Rename the constant for the Master Data Parity Error flag in the
PCI status register to map its current name.
- Use PCIM_* rather than PCIR_* for constants for fields in various AER
  registers.  I got about half of them right in the previous commit.

MFC after:	1 week
2010-09-09 18:19:15 +00:00
Nathan Whitehorn
c14e163ad1 Fix a problem where device detection would work unreliably on Serverworks
K2 SATA controllers. The chip's status register must be read first, and
as a long, for other registers to be correctly updated after a command, and
this includes the command sequence in device detection as well as the
previously handled case after interrupts. While here, clean up some
previous hacks related to this controller.

Reported by:	many
Reviewed by:	mav
MFC after:	3 weeks
2010-09-09 13:17:30 +00:00
Ed Schouten
1901fd2ffe Let psm(4) use si_drv1 to refer to its softc. 2010-09-09 07:52:15 +00:00
Pyun YongHyeon
a8924cde73 Correct definition of T2 mode bit of MRBE Message Page 5 Next Page
Control Register.
2010-09-08 21:08:54 +00:00
John Baldwin
79c2de35b5 - Add register definitions related to extended capability IDs in
PCI-express.  I used PCIZ_* for ID constants (plain capability IDs use
  PCIY_*).
- Add register definitions for the Advanced Error Reporting, Virtual
  Channels, and Device Serial Number extended capabilities.
- Teach pciconf -c to list extended as well as plain capabilities.   Adds
  more detailed parsing for AER, VC, and device serial numbers.

MFC after:	2 weeks
2010-09-08 17:53:34 +00:00
Alexander Motin
b28fc1b5c8 During SMP startup there is time window, when SMP started, but interrupts
are still bound to BSP. It confuses timer management logic in per-CPU mode
and may cause timer not being reloaded. Check such cases on interrupt
arival and reload timer to give system some more time to manage proper
binding.
2010-09-08 16:59:22 +00:00