Commit Graph

15951 Commits

Author SHA1 Message Date
John Baldwin
ce533e82a2 Tweak the probe/attach order of devices on the x86 nexus devices.
Various BIOS-related psuedo-devices are added at an order of 5.  acpi0 is
added at an order of 10, and legacy0 is added at an order of 11.
2007-03-20 20:21:44 +00:00
Ariff Abdullah
94d36aa276 Put a temporary bandaid to set/reset uncacheable DMA region (affected
on amd64 and i386) until we gain proper BUS_DMA_NOCACHE support.
(in progress).

Tested by:	rafan, infofarmer, Nguyen Tam Chinh <unixvn@gmail.com>
Tested on:	amd64, i386
2007-03-20 11:24:29 +00:00
Kip Macy
77f07749f3 cxgb_stop is only called from cxgb_ioctl so:
- don't acquire port lock, already held in ioctl
- rename to cxgb_stop_locked
- switch callout_drain to callout_stop to avoid a hang from having the port lock held
2007-03-20 06:21:47 +00:00
Nate Lawson
6e141df200 If we got an OBE/IBF event, we failed to re-enable the GPE. This would
cause the EC to stop handling future events because the GPE stayed masked.
Set a flag when queueing a GPE handler since it will ultimately re-enable
the GPE.  In all other cases, re-enable it ourselves.  I reworked the
patch from the submitter.

Submitted by:	Rong-en Fan <grafan@gmail.com>
2007-03-20 00:58:19 +00:00
Jung-uk Kim
9239bab2fe Revert couple of changes from 1.51 and 1.52. Reading link status with BMSR
is okay for most of the chipsets but BCM5701 PHY does not seem to like it.
Set media to IFM_NONE if link is not up instead of the previous value.

Reported by:	Goran Lowkrantz (goran dot lowkrantz at ismobile dot com)
2007-03-19 23:17:39 +00:00
Ariff Abdullah
19f018fb83 Destroy channel DMA tag during resource cleanup. 2007-03-19 16:06:26 +00:00
Hidetoshi Shimokawa
06767d306b Poll only while interrupt is disabled.
MFC: 3 days after
2007-03-19 03:41:27 +00:00
Hidetoshi Shimokawa
33662e369c Wait SCLK to be stable after LPS enabled.
This should fix NMI problem in fwphy_rddata().

PR: kern/94146 kern/100356
MFC: after 3 days
2007-03-19 03:35:45 +00:00
Ariff Abdullah
d5304d9e3d Enforce sample size alignment on first direct-copy channel. 2007-03-18 18:26:40 +00:00
Nate Lawson
675e5627d0 Disable burst mode by default. Testing has shown that while it works on
most systems, it causes the EC not to respond for some Acer and Compaq/HP
laptops.  This is the default value for Linux also.  For systems that need
it, burst mode can be enabled via the tunable/sysctl:
	debug.acpi.ec.burst="1"
2007-03-18 01:03:03 +00:00
Ariff Abdullah
d2ea76fe8f Fix (another, more to come) ivar memory leak during driver detach. 2007-03-17 19:37:09 +00:00
Ariff Abdullah
42a3b81e4e Fix long delay closing/syncing issues on mmaped buffer. 2007-03-17 17:07:21 +00:00
Kip Macy
8db477416c move inline function above use so that -O works 2007-03-17 05:23:45 +00:00
Ariff Abdullah
7ab4fa8ee2 [stage: 9/9]
- SWAPLR quirk for (unknown, luckily it is mine) broken uaudio stick.
  Fixing by rewiring is impossible without damaging it. Luckily,
  we can fix it using "other" methods :) .
- Add uaudio_get_vendor(), _product() and _release() in uaudio.c
  (currently used by uaudio_pcm quirk).
- Implement CHANNEL_SETFRAGMENTS().
- Drop channel locking in few places where it is about to sleep
  somewhere. This should help eliminating illegal locking acquisition
  where the current thread is about to sleep, and also few deadlock
  cases. Dropping it right here is quite safe since it is already
  protected by CHN_F_BUSY flag and other threads won't bother to touch it.
  Solving other illegal locking issues are quite tricky without converting
  most usbd_do_request() calls to its equivalent _async() calls,
  which I intend to do it later after getting full test report from
  other people with different uaudio hardwares.
- Fix memory leak issues during detach. This seems common to any drivers
  (notably emu10kx, csapcm?) with bridge functions.
2007-03-16 17:19:03 +00:00
Ariff Abdullah
1042342ad8 [stage: 8/9]
Implement CHANNEL_SETFRAGMENTS() for snd_atiixp, snd_es137x, snd_hda
and snd_via8233. CHANNEL_SETBLOCKSIZE() will basically call
CHANNEL_SETFRAGMENTS() internally using conservative blocksize /
blockcount hints. Other drivers will be converted later.
2007-03-16 17:18:17 +00:00
Ariff Abdullah
7d9022b422 [stage: 7/9]
EWOULDBLOCK -> EAGAIN.
2007-03-16 17:17:25 +00:00
Ariff Abdullah
1324d98beb [stage: 6/9]
- Disable stray buffer management, since sample size aligned buffering
  are pretty much guaranteed through out the entire feeder_* chain
  processes.
- Few style(9) cleanups.
2007-03-16 17:16:56 +00:00
Ariff Abdullah
fd1475d34d [stage: 5/9]
channel.c/channel_if.m:
 - Macros cleanups, prefer inlined min() over MIN().
 - Rework chn_read()/chn_write() for better dead interrupt detection
   policy. Reduce scheduling overhead by doing pure 5 seconds sleep
   before giving up, instead of several cycle of brute micro sleeping.
 - Avoid calling wakeup_one() for non-sleeping channel (for example,
   vchan parent channel).
 - EWOULDBLOCK -> EAGAIN.
 - Fix possible divide-by-zero panic on chn_sync().
 - Re-enforce ^2 blocksize policy, since there are too many broken
   userland apps that blindly assume it without even trying to do
   serious calculations.
 - New channel method - CHANNEL_SETFRAGMENTS(), a refined version of
   CHANNEL_SETBLOCKSIZE(). It accept _both_ blocksize and blockcount
   arguments, so the driver internals will have better hints for
   buffering and timing calculations.
 - Hook FEEDER_SWAPLR into feederchain building process.

feeder_fmt.c:
- Unified version of various filters, avoiding duplications.
- malloc()less feeder_fmt. Informations can be retrieved dynamically
  by doing table lookup on static data. For cases such as converting
  from stereo to mono or reducing bit depth where input data is larger
  than output, cycle remaining available free space until it has been
  exhausted and start kicking 8 bytes reservoir space from there to
  complete the remaining requested count.
- Introduce FEEDER_SWAPLR. Few super broken hardwares (found on several
  extremely cheap uaudio stick, possibly others) mistakenly wired left
  and right channels wrongly, screwing output or input.
2007-03-16 17:16:24 +00:00
Ariff Abdullah
c30ec7427a [stage: 4/9]
- Rearrange FEEDER_* constants starting from 0 to 31, so the future
  additions will be much easier and consistent.
- Introduce FEEDER_SWAPLR. Few super broken hardwares (found on several
  extremely cheap uaudio stick, possibly others) mistakenly wired left
  and right channels wrongly, screwing output or input.
2007-03-16 17:15:33 +00:00
Ariff Abdullah
e956c4e11f [stage: 3.2/9]
malloc()less feeder_vchan. Informations can be retrieved dynamically
by doing table lookup on static data. Reduce mixing overhead by
doing direct copy on first channel. Mixing process will begin starting
from second channel onwards.
2007-03-16 17:14:41 +00:00
Ariff Abdullah
3e3981e8a0 [stage: 3.1/9]
malloc()less feeder_volume. Informations can be retrieved dynamically
by doing table lookup on static data. Increase resolution from 6bit
to PCM_FXSHIFT (8bit) for better resolution and finer volume changes.
2007-03-16 17:14:19 +00:00
Ariff Abdullah
4dfcb0573f [stage: 2/9]
Use inlined min() rather than MIN() macross.
2007-03-16 17:13:44 +00:00
Ariff Abdullah
dd83f3b6cf [stage: 1/9]
- Convert sx lock to plain mutex. Since the access of /dev/sndstat
  is pretty much exclusive and protected by toggling sndstat_isopen,
  plain mutex is more than enough.
- Enable SBUF_AUTOEXTEND to avoid buffer truncation.
2007-03-16 17:13:12 +00:00
Hidetoshi Shimokawa
801167a869 Replace xfer->act.hand with xfer->hand. 2007-03-16 05:39:33 +00:00
Hidetoshi Shimokawa
f7cb7d5dd0 Remove retry_count. 2007-03-16 05:17:23 +00:00
Hidetoshi Shimokawa
976c8eadc9 * Remove xfer->retry_req.
It is unnecessary because retry is done by OHCI.
   Further retry should be done by applications.
2007-03-16 05:11:42 +00:00
Hidetoshi Shimokawa
ac44778260 Less verbose debug messages. 2007-03-16 04:26:58 +00:00
Hidetoshi Shimokawa
d0581de84e Detect cycle lost. 2007-03-16 04:25:02 +00:00
Hidetoshi Shimokawa
c6c2738201 Print warning for large DFLTPHYS. 2007-03-16 02:29:36 +00:00
Ariff Abdullah
d90a1cd318 Fix support for ASUS A7T ALC882 laptop (gpio0 quirk).
Reported/Tested by:	cognet
2007-03-16 01:44:21 +00:00
Hidetoshi Shimokawa
319222274a Support MAXPHYS up to 512KB
- We need at least two OCBs with indirect pointers allocated in a 4KB page.
- SBP_MAXPHYS can increase to 1MB once we separate management OCB/ORB
  which usually does not need indirect pointers.
- We have to increase SBP_DMA_SIZE for MAXPHYS larger than 1MB.

MFC after: 3 days
2007-03-16 01:23:36 +00:00
Ariff Abdullah
4beb77e673 Spring cleanup on irrelevant NULL checking over M_WAITOK allocations. 2007-03-15 18:19:01 +00:00
Ariff Abdullah
12828031ac - Put some sanity break statement in few missing places.
- Remove NULL checking on snd_mtxcreate() (M_WAITOK) .
2007-03-15 17:35:04 +00:00
Ariff Abdullah
82199c9255 NOOP (for now) for hdac_dma_nocache(). It is a wrong way to enforce
cache coherency, besides of causing train wreck in other places
(especially on amd64, possibly on i386).

Discussed with:	kib@, rafan@
Tested by:	rafan@
2007-03-15 17:23:38 +00:00
Ariff Abdullah
4582b3a100 Fix severe out-of-bound mtx "type" pointer, causing WITNESS refcount
confusions and panic provided that the following conditions are met:

  1) WITNESS is enabled (watch/trace).
  2) Using modules, instead of statically linked (Not a strict
     requirement, but easier to reproduce this way).
  3) 2 or more modules share the same mtx type ("sound softc").
     - They might share the same name (strcmp() == 0), but it always
       point to different address.
  4) Repetitive kldunload/load on any module that shares the same mtx
     type (Not a strict requirement, but easier to reproduce this way).

     Consider module A and module B:
     - From enroll() - subr_witness.c:
       * Load module A. Everything seems fine right now.
         wA-w_refcount == 1 ; wA-w_name = "sound softc"
       * Load module B.
       * w->w_name == description will always fail.
         ("sound softc" from A and B point to different address).
       * wA->w_refcount > 0 && strcmp(description, wA->w_name) == 0
       * enroll() will return wA instead of returning (possibly unique)
         wB.
         wA->w_refcount++ , == 2.
       * Unload module A, mtx_destroy(), wA->w_name become invalid,
         but wA->w_refcount-- become 1 instead of 0. wA will not be
         removed from witness list.
       * Some other places call mtx_init(), iterating witness list,
         found wA, failed on wA->w_name == description
       * wA->w_refcount > 0 && strcmp(description, wA->w_name)
       * Panic on strcmp() since wA->w_name no longer point to valid
         address.

Note that this could happened in other places as well, not just sound
(eg. consider lots of drivers that share simmilar MTX_NETWORK_LOCK).

Solutions (for sound case):
  1) Provide unique mtx type string for each mutex creation (chosen)
  or
  2) Put "sound softc" global variable somewhere and use it.
2007-03-15 16:41:27 +00:00
Ariff Abdullah
7a5897d4d9 Remove NULL allocation checking since malloc() is allow to wait.
(I'll fix other places later..)
2007-03-15 15:06:54 +00:00
Ariff Abdullah
8c0a77e3d3 NULL instead of 0 in mtx_init() . 2007-03-15 14:57:54 +00:00
Hidetoshi Shimokawa
4813ecc362 Don't mess with PCIM_CMD_SERRESPEN and PCIM_CMD_PERRESPEN.
This will fix 'NMI RAM parity error' while booting on some machines.

PR: kern/95077
MFC after: 3 days
2007-03-15 14:11:46 +00:00
Nate Lawson
929a5cf650 Only enter the debugger on a Fatal op if this is a debug build of the
acpi module.  Also clean up print of args a little.

This was accidentally committed as 1.9.2.3 in the stable branch.  Since it
is harmless, I will let the "insta-MFC" stand unless there is a problem.
2007-03-14 19:56:10 +00:00
Kip Macy
c8411d871a #define L1_CACHE_BYTES for non-x86 2007-03-14 16:18:51 +00:00
Kip Macy
58bcd3238c define prefetch as a no-op macro for non-x86 arches 2007-03-14 16:05:39 +00:00
Kip Macy
f467efb7b5 play it safe for now and go back to kicking off tx cleaning from the tx path 2007-03-14 07:57:59 +00:00
Kip Macy
bede276b07 #define memory barrier macros for the non-i386 && non-amd64 case 2007-03-14 06:40:46 +00:00
Kip Macy
4f199f0379 remove unused code for recycling descriptors
kick tx cleaner from credit update function
2007-03-14 06:36:58 +00:00
Kip Macy
7d9ca96411 add cxgb_config.h to define values that are defined in the Makefile when compiled as a
module

move prefetch out of cxgb_sge.c into header under arch conditional compilation
2007-03-14 06:35:38 +00:00
Kip Macy
1940bc694e move taskqueue_enqueue of tx clean operation out of the start path 2007-03-14 06:34:10 +00:00
Kip Macy
b9d6bc3b79 make desc_reclaimable macro safe to arbitrary arguments 2007-03-14 06:33:28 +00:00
Matt Jacob
f6a6ae8f5c Don't call isp_intr from isp_start- this seems to, in rare cases,
cause confusion with at least the 23XX chipsets where the output
queue index pointer just gets a bit whacko.

MFC after:	1 day
2007-03-14 05:58:07 +00:00
Kip Macy
cc57017c60 Add firmware for cxgb 2007-03-14 02:44:48 +00:00
Kip Macy
b6d90eb779 First of several commits for driver support for the Chelsio T3B 10 Gigabit
Ethernet adapter.

Reviewed by: scottl, sam

For those interested in the preliminary performance work see below.

Plots of mxge vs. cxgb running netpipe:

blocksize vs. bandwidth:
http://www.fsmware.com/chelsio.random/bsvsbw.gif

blocksize vs. RTT:
First of several commits for driver support for the Chelsio T3B 10 Gigabit
Ethernet adapter.

Reviewed by: scottl, sam

For those interested in the preliminary performance work see below.

Plots of mxge vs. cxgb running netpipe:

blocksize vs. bandwidth:
http://www.fsmware.com/chelsio.random/bsvsbw.gif

blocksize vs. RTT:
http://www.fsmware.com/chelsio.random/bsvstime.gif

blocksize vs. RTT for block sizes <= 10kb:
http://www.fsmware.com/chelsio.random/bsvstime_10kb.gif
http://www.fsmware.com/chelsio.random/bsvstime_10kb3.gif
2007-03-14 02:37:44 +00:00