Commit Graph

23110 Commits

Author SHA1 Message Date
perry
9b2b412c19 __FUNCTION__ -> __func__ 2007-12-15 00:39:14 +00:00
njoly
74ac36ac9c Do not try to attach spdmem if i2c adress exceed 0x57.
It must follow the reserved eeprom adresses range.
2007-12-14 13:18:43 +00:00
dogcow
5c1631600c fix KDASSERTs by defining ifp 2007-12-14 08:14:27 +00:00
dogcow
d494e60340 caddr_t -> void * 2007-12-14 08:14:26 +00:00
dogcow
df396ec4f3 remove typedef for caddr_t 2007-12-14 08:14:26 +00:00
dyoung
0aff5df9de Simplify suspend/resume using device_has_power(). 2007-12-14 03:38:19 +00:00
dyoung
8fc7c0c5ca Add a resume handler for com@isa, using Jared McNeill's suggested
code from current-users.  com@acpi, et cetera, remain to be done.
2007-12-14 03:36:54 +00:00
dyoung
c4245b0ab7 Oops, make last change compile. 2007-12-14 03:22:19 +00:00
dyoung
9a075a9c73 Comment-out calls to pci_disable_retry() and cardbus_disable_retry().
They do not seem well-justified according to anyone's understanding
of what they really do, and it seems especially inappropriate to
call them at attach- and resume-time.
2007-12-14 03:18:46 +00:00
mjf
84f60004f0 Reorder the previous commit so we remember to disestablish pci interrupts
if we fail to attach ath(4).

Thanks dyoung!
2007-12-14 02:57:22 +00:00
dyoung
552eeca6f7 Exit from ath_init() with EBUSY if the device does not have power. 2007-12-14 02:46:49 +00:00
dyoung
0c96975093 Take a step toward sharing compiled code between sip(4) and gsip(4):
get rid of SIP_DECL() and reduce #ifdef DP83820 code.  Next step
is to move a bunch of shared code to a new file (if_sipcom.c, say)
and compile it *once*.

While I am here, add suspend/resume handling to sip(4) and to
gsip(4).

Tested with the NatSemi sip(4) on the Soekris net4521.  I don't
have any gsip(4) to test with, and it seems that the few holders
of gsip(4) in the world keep them in their attic, anyway.
2007-12-14 01:55:35 +00:00
dyoung
417afa7caa Bug fix: record the new state (high/low) set by gpio_pin_write().
I don't know why we gpio(4) didn't do that before, but it seems
harmless.

Add naive power handling: when a gpio(4) instance is resumed, write
each pin's configuration flags and output state from the softc to
the hardware using gpiobus_pin_ctl() and gpiobus_pin_write().
While suspended, fail every ioctl() except for GPIOINFO with EBUSY.
2007-12-14 01:49:23 +00:00
jmcneill
e692a6c76a Introduce pmf_system_bus_resume. In the ACPI S3 resume path, use this to
separate powering up devices from restoring their state. This is required
on some machines where AcpiLeaveSleepState can fail due to an attempt to
access a powered off device.
2007-12-14 01:29:29 +00:00
mjf
003edc95d6 Fix a crash at shutdown/reboot that was caused by ath(4) registering with
pmf's network class even though the ath device may not have attached
properly.

OK jmcneill
2007-12-14 00:55:52 +00:00
uwe
0790e7df9b Complete lockmgr->mutex conversion started in 1.12. Mutex needs to be
inited with mutex_init.  Since mutex ops return void, drop (void) cast
from APM_(UN)LOCK.
2007-12-14 00:51:44 +00:00
tls
9fcd272fb5 Adjust interrupt moderation for newer chips to be saner according to the
82571 manual and Intel Application Note 450.  Previously, we were setting
RADV and TIDV/TADV values that didn't make any sense given the enormous
ITR value we were setting (well outside the range recommended by Intel
and quite possibly rejected silently by the chip as junk) and setting
RADV without setting RDTR, which is explicitly documented as having no
effect.

A considerable performance improvement is achieved for TCP and UDP at
gigabit speed.  I need to revisit this to deal with the timer ticks
being 4X as long when the chip's in 100mbit mode, and to set values
for the older chips' interrupt timers that are more like what the
appnote recommends.  This should help for 82543 and newer, though.
2007-12-14 00:23:49 +00:00
garbled
41918d8024 Move the elink probe code from files.isa to the common conf/files so that
MCA without isa can compile.  fix by cube.
2007-12-13 21:23:48 +00:00
degroote
aaf41b42d1 Remove the shutdown hook (pmf takes care about it already), as suggested by joerg@ 2007-12-13 19:58:42 +00:00
jmcneill
61d17f24ea Make this compile again. 2007-12-13 16:53:28 +00:00
xtraeme
fcad73742f Check return value of pmf_device_register(), pointed out by joerg.
Looks like the pmf(9) manpage declared it as void and not bool...
2007-12-13 15:36:29 +00:00
joerg
1c47f4bb86 Switch to console on suspend and shutdown, switch back to where the
system was before on resume. This is the second attempt and got more
complicated due to the async nature of VT_ACTIVE. After the initial
switch, check that we ended up on the first screen and if not, wait for
the switch to happen.
2007-12-13 15:14:48 +00:00
jmcneill
2399e8e84e Restore the native mode PCI conf register on select chipsets on resume,
in case it was lost when power was removed.
2007-12-13 15:11:31 +00:00
joerg
5141501598 Stop the key pressed timeout on suspend to avoid virtually hanging keys,
e.g. when calling sysctl -w machdep.sleep_state=3 manually.
2007-12-13 14:49:42 +00:00
joerg
af42580f29 Don't count poll(2) and select(2) as device activity. Don't activate the
device on write(2) if it is suspended and was not idle.
2007-12-13 14:40:36 +00:00
jmcneill
67153124ea When resuming the audio device, call audiosetinfo with the last known good
parameters. Fixes an issue with suspending the audio device while playback
is paused.
2007-12-13 14:02:53 +00:00
dyoung
3ccfb020a3 Back out previous my previous change, it stops device resumption
entirely.
2007-12-13 09:17:43 +00:00
dyoung
4e2f6cc949 Do not reinitialize the NIC while it is suspended. 2007-12-13 09:04:39 +00:00
jmcneill
645fe8c342 Try not to pass garbage to pci_make_tag; workaround for odd ACPI DSDTs.
Fixes kern/37527.
2007-12-12 23:33:22 +00:00
jmcneill
faa68cee64 Rename acpiec_gpe_state_maschine -> acpiec_gpe_state_machine 2007-12-12 12:57:48 +00:00
smb
472e153a90 Add power management hooks 2007-12-12 03:54:27 +00:00
jmcneill
c44d13d630 No longer required after jmcneill-pm merge. 2007-12-11 23:07:30 +00:00
lukem
456279df8f use __KERNEL_RCSID() 2007-12-11 12:29:11 +00:00
lukem
961afe5035 use __KERNEL_RCSID() instead of __RCSID() 2007-12-11 12:16:34 +00:00
lukem
30bbbed8a0 remove borken/unnecessary __RCSID 2007-12-11 12:16:14 +00:00
lukem
b55306727c use __KERNEL_RCSID() 2007-12-11 12:09:21 +00:00
lukem
ceed9c722c use __KERNEL_RCSID() 2007-12-11 11:52:26 +00:00
lukem
e3899b9e67 NetBSD RCSID love 2007-12-11 11:48:40 +00:00
lukem
38398f2570 use __KERNEL_RCSID() 2007-12-11 11:38:15 +00:00
lukem
388339aa58 use __KERNEL_RCSID() 2007-12-11 11:25:46 +00:00
lukem
afb2a5863e use __KERNEL_RCSID() 2007-12-11 11:17:30 +00:00
martin
6cdfaa0c8f As a stopgap fix: disable a pci_conf_ access at offset 0x82 on archs
that would mind ;-) IMHO this access violates the PCI spec, so this
should be solved differently.
2007-12-11 11:11:22 +00:00
lukem
3290dbb81a use __KERNEL_RCSID() 2007-12-11 05:38:12 +00:00
jmcneill
8eeb638b73 Register with pmf 2007-12-11 03:45:57 +00:00
jmcneill
f2fa8d82cf Make this compile again. 2007-12-11 02:02:31 +00:00
oster
7f102f3ada Use CFATTACH_DECL_NEW instead of CFATTACH_DECL... ICB wisdom
is that this will fix the config_devalloc panic.
2007-12-11 01:54:46 +00:00
jmcneill
eded1e0324 Disable the wd_suspend power handler on the proper branch, workaround for
kern/37508
2007-12-11 01:52:18 +00:00
martin
f40133bd10 const'ify ad1848 devmap. 2007-12-11 00:21:51 +00:00
martin
2ce2127701 When collecting mixer values while suspending, initialize the number
of channels from the mixer device info. Fixes PR kern/37512.
OK: jmcneill
2007-12-11 00:08:14 +00:00
xtraeme
0cd3ab0981 Register to the pmf(9) framework and fix an error path. 2007-12-10 23:25:59 +00:00
reinoud
3a44e8ad9d Add missing \n and remove surplus . 2007-12-10 22:56:29 +00:00
degroote
087fae3d54 Register fxp @ pci to the pmf framework
Kill reference to old powerhook framework.
2007-12-10 16:15:02 +00:00
he
3dfb5682d1 Remove a now-unused local variable. 2007-12-10 08:57:36 +00:00
jmcneill
b36c96248a Wups, pmf_class_input_deregister is private; use pmf_device_deregister
instead
2007-12-10 01:13:38 +00:00
jmcneill
cda2869251 Deregister input class handler on detach. 2007-12-10 01:11:49 +00:00
jmcneill
94d68e1562 pmf_driver_register -> pmf_device_register 2007-12-09 23:58:40 +00:00
jmcneill
5430a31312 Register with power management framework. 2007-12-09 23:47:53 +00:00
smb
9428ee68f7 Add Sierra 5725 miniPCI wireless card (CDMA EVDO) 2007-12-09 21:26:47 +00:00
smb
8167a34333 Correct error in 5725 commit 2007-12-09 21:24:30 +00:00
smb
38fba18e22 Add Sierra 5725 mini-PCI card 2007-12-09 21:21:21 +00:00
xtraeme
747de0248d Register to pmf(9). 2007-12-09 20:59:37 +00:00
martin
14587719e2 Add missing <sys/device.h> include. 2007-12-09 20:57:19 +00:00
jmcneill
4c1d81b2b5 Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
xtraeme
6797f052ff Erm fix some defines in previous... 2007-12-09 00:24:46 +00:00
jmcneill
0273402379 kern/37501: cosmetic error in acpi_tz probe messages 2007-12-08 23:01:30 +00:00
pooka
db06a930e6 Remove cn_lwp from struct componentname. curlwp should be used
from on.  The NDINIT() macro no longer takes the lwp parameter and
associates the credentials of the calling thread with the namei
structure.
2007-12-08 19:29:36 +00:00
xtraeme
1e1bd31956 Add some more firmware command/status codes from the freebsd driver. 2007-12-08 16:53:19 +00:00
tsutsui
0ac5343d25 Pull several fixes from OpenBSD's fxp.c:
Rev 1.41:
> use a nop with I bit set at the end of the tx chain.  This avoids a race
> between status update and clearing the suspend bit on machines which can't
> write data smaller than 32bits at a time.
This should fix PR port-alpha/30560.

Rev 1.50:
> Fix nasty bug where driver would not correctly catch and handle an rnr
> condition when it was due to the the recieve buffers being exhausted with
> no packet transmits during that time. Symptom was that the fxp would
> simply stop interrupting for the next 15 seconds until the watchdog kicked
> in and reset the chip due to 15 seconds of inactivity, making the fxp very
> poorly behaved when hammered on hard.

Rev 1.61:
> Defer reinitialisation of the RU until after the interrupt handler has had
> a chance to process all pending packets, otherwise the chip may overwrite
> their mbuf clusters after we have freed them.
>
> Eliminates a race that can cause random pool corruption when reconfiguring
> an interface under heavy network load.

And one more change for RX sanity:
- put RU into suspend when the last RFA is processed.

These RNR/RU changes may fix pool corruption problems on fxp.

Tested on AlphaPC164 and i386 with i82559 and i82550.
2007-12-08 15:45:43 +00:00
xtraeme
10f7c0a4da Add BIOC_SVMIGRATING to bio(4) and bioctl(8) to report if a volume
is migrating currently showing the percentage.

Update arcmsr(4) to report this, like:

$ sudo ./bioctl -h arcmsr0
    Volume Status     Size Device
 arcmsr0 0 Migrating  698G ARC-1210-VOL#00 RAID 5 7% done
	 0 Online     234G 0:0.0   noencl <WDC WD2500YS-01SHB1 20.06C06>
	 1 Online     234G 0:1.0   noencl <WDC WD2500YS-01SHB1 20.06C06>
	 2 Online     234G 0:2.0   noencl <WDC WD2500YS-01SHB1 20.06C06>
	 3 Online     234G 0:3.0   noencl <WDC WD2500YS-01SHB1 20.06C06>
$
2007-12-07 11:51:21 +00:00
xtraeme
820f120b52 Add ENVSYS_DRIVE_MIGRATING for ENVSYS_DRIVE sensors, this is for RAID
volumes that are migrating such as when you change the stripe size.

While I'm here use the same string than we had in the old framework to
report status "online" vs "drive is online", because the sensor might be
a RAID volume and not just a drive.
2007-12-07 11:47:49 +00:00
xtraeme
2a8e937fbd - Improve the locking based in comments from ad@.
- malloc(9) -> kmem(9) now that most of the bio code doesn't need to run
  on interrupt context.
- Reduce code that runs in interrupt context to a small part in
  arc_msgbuf() and is protected by arc_lock()/arc_unlock().

Reviewed and help by ad@.
2007-12-07 08:50:36 +00:00
bjs
2e1c69e6e8 Bring in some modest fixes from GIT that seemed appropriate to me and did not
break functionality.  I've tested this on a PCIE R423 (X800).

- In drm_drv.c, check that the requested context lock matches the holder
of the lock.

- Unify radeon offset checking.  (r300_cmdbuf.c, radeon_drv.h, radeon_state.c)
[Replace r300_check_offset() with generic radeon_check_offset(), which doesn't
reject valid offsets when the framebuffer area is at the very end of the card's
32 bit address space. Make radeon_check_and_fixup_offset() use
radeon_check_offset() as well.
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=7697]

NOTE: There is another AGP fix that I didn't have time to merge
that I thought might help with getting this to work on macppc.
Contact me if you're interested. Hi macallan@! ;)

radeon_cp.c, radeon_drv.h: (GIT id: bb5f2158dbd30dbbffa3881fac75b71d71ecaaf9)
- set the address to access the aperture on the CPU side correctly
[This code relied on the CPU and GPU address for the aperture being the same,
On some r5xx hardware I was playing with I noticed that this isn't always true.
I wonder if this will fix some of those r4xx DRI issues we've seen in the past.]

- Commit the ring after earch partial texture. (radeon_state.c)
(GIT ID: ac8406420ea80ffe5ccaadc1ff0124f95709a23d)
[Commit the ring after each partial texture upload blit.
This makes sure each blit starts as early as possible, which may improve
texture upload performance in some cases.]

If anyone's having any issues in particular--especially those which
can be _teased apart from AGP driver issues--please let me know
and I'll investigate.  Thanks.  There are also tons of fixes for the i915,
but I don't want to change too much at once.
2007-12-07 08:02:48 +00:00
gmcgarry
11f250300f Fix locking botch. 2007-12-05 23:20:27 +00:00
xtraeme
21d75f870d Boh! I spoke too soon before, without the rwlock(9) sometimes
arc_wait() waits forever, so put it back until I figure any other way
to remove the rwlock(9).
2007-12-05 18:58:00 +00:00
xtraeme
1b48221099 Use SCSIPI_CHAN_NOSETTLE... the driver doesn't have to wait. 2007-12-05 18:25:53 +00:00
dyoung
550024b13d Use IFADDR_EMPTY().
(This driver should go away, comments indicate that it does not
even compile.)
2007-12-05 18:23:23 +00:00
xtraeme
dc5ade8ebb Make it use mutex(9) and condvar(9), bye bye spl(9) and tsleep(9).
Fully stable with all debugging options turned on, unless someday any
problem appears :-)
2007-12-05 18:07:34 +00:00
pooka
4e38160d4d Do not "return 1" from kqfilter for errors. That value is passed
directly to the userland caller and results in a mysterious EPERM.
Instead, return EINVAL or something else sensible depending on the
case.
2007-12-05 17:19:46 +00:00
xtraeme
220ed74e1e - arc_msgbuf: free wbuf and rbuf with the correct type (M_TEMP vs M_DEVBUF)
this fixes a panic with debugging options.
- Do not use a callout to refresh sensor data, and make it available
  every time someone requests it.
- Enable ENVSYS_FMONSTCHANGED for notifications in the volumes.
2007-12-05 16:02:25 +00:00
xtraeme
9d0a9ec5d9 Add arcmsr(4) and aps(4). 2007-12-05 09:10:25 +00:00
ad
a0ca06de3d lockmgr -> mutex 2007-12-05 08:39:46 +00:00
ad
6874e511b7 lockmgr -> mutex 2007-12-05 07:58:29 +00:00
ad
5a24480bf8 lockmgr -> mutex 2007-12-05 07:15:53 +00:00
ad
598ab03ad0 Match the docs: MUTEX_DRIVER/SPIN are now only for porting code written
for Solaris.
2007-12-05 07:06:50 +00:00
ad
ba369f0439 MUTEX_SPIN -> MUTEX_DEFAULT. 2007-12-05 06:52:27 +00:00
xtraeme
11b3a747bd Rename the Areca RAID driver (known as arc(4) to arcmsr(4) to avoid
namespace conflict with NetBSD/arc.

Found by tsutsui@.
2007-12-05 00:18:06 +00:00
xtraeme
e505e7cc51 Use a rwlock(4) for arc_lock/unlock. arc_msgbuf() is too fragile and
we want to be sure that only one consumer is using it at a time.
2007-12-04 21:09:56 +00:00
xtraeme
8e6cf74867 Areca Technology Corporation SATA RAID controller driver, ported
from OpenBSD.

arc0 at pci2 dev 14 function 0: interrupting at ioapic0 pin 18 (irq 5)
arc0: Areca ARC-1210 Host Adapter RAID controller
arc0: 4 ports, 256MB SDRAM, firmware <V1.43 2007-4-17>
scsibus0 at arc0: 16 targets, 8 luns per target
[...]
scsibus0: waiting 2 seconds for devices to settle...
sd0 at scsibus0 target 0 lun 0: <Areca, ARC-1210-VOL#00, R001> disk fixed
sd0: 465 GB, 56514 cyl, 36 head, 480 sec, 512 bytes/sect x 976562176 sectors
sd1 at scsibus0 target 0 lun 1: <Areca, ARC-1210-VOL#01, R001> disk fixed
sd1: 465 GB, 56514 cyl, 36 head, 480 sec, 512 bytes/sect x 976562176 sectors

bioctl(4) output with two RAID0 volumes:

Volume  Status               Size Device
 arc0 0 Online               466G ARC-1210-VOL#00 RAID0
      0 Online               234G 0:0.0   noencl <WDC WD2500YS-01SHB1 20.06C06>
      1 Online               234G 0:1.0   noencl <WDC WD2500YS-01SHB1 20.06C06>
 arc0 1 Online               466G ARC-1210-VOL#01 RAID0
      0 Online               234G 0:2.0   noencl <WDC WD2500YS-01SHB1 20.06C06>
      1 Online               234G 0:3.0   noencl <WDC WD2500YS-01SHB1 20.06C06>

The driver still needs changes related to locking and talking to the
firmware, which sometimes is unable to answer...

Raid card donated by Areca Technology Corporation via Trent George.
Disks used for testing were contributed by TNF.

Thank you very much.
2007-12-04 18:47:50 +00:00
xtraeme
05237843cf Newer nForce MCP SMBus devices use different PCI BARs than the old ones
(nForce 2/3/4).

nfsmb(4) is now properly working on newer MCPs, tested by wiz@ on MCP55:

nfsmbc0 at pci0 dev 1 function 1: NVIDIA nForce MCP55 SMBus Controller (rev. 0xa2)
nfsmb0 at nfsmbc0 SMBus 1
iic0 at nfsmb0: I2C bus
spdmem0 at iic0 addr 0x51
spdmem0: DDR2 SDRAM memory, data ECC, 1024MB, 667MHz, PC2-5300
spdmem0: 14 rows, 10 cols, 2 ranks, 4 banks/chip, 3.00ns cycle time
spdmem0: voltage SSTL 1.8V, refresh time 7.8us (self-refreshing)
nfsmb1 at nfsmbc0 SMBus 2
iic1 at nfsmb1: I2C bus
2007-12-04 15:58:11 +00:00
spz
3d1270e2c8 try fixing up broken revision string again 2007-12-04 15:42:05 +00:00
spz
5bfaf1ebca fix up broken revision string 2007-12-04 15:41:20 +00:00
bjs
72127ffc00 drm unbreaking, round 1:
Fix the bus_dma(9) use in drm_pci.c and chnage struct drm_dma_handle_t
to match it.  Remove member dmaaddr from drm_dma_handle_t as well,
as I don't see it used anywhere.  Compile-tested only for now; please
report any problems to me.  Thanks.
2007-12-04 12:51:13 +00:00
dyoung
2fae21685a Reprogram multicast filter after SIOCADDMULTI / SIOCDELMULTI.
Fixes IPv6 stateless address configuration problems reported on
tech-net@.  Patch tested and found to work by Martti Kuparinen.
2007-12-04 09:22:05 +00:00
ad
4b293a84e1 Interrupt handling changes, in discussion since February:
- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
2007-12-03 15:33:00 +00:00
pooka
af3b65635e Allow EVFILT_WRITE kqfilters to be registered and map them to
seltrue_filtops.
2007-12-03 15:24:06 +00:00
plunky
d8436629a8 initialize loop variable as loop is not necessarily undertaken 2007-12-03 10:41:59 +00:00
hannken
d556dc98b0 Fscow_run(): add a flag "bool data_valid" to note still valid data.
Buffers run through copy-on-write are marked B_COWDONE.  This condition
is valid until the buffer has run through bwrite() and gets cleared from
biodone().

Welcome to 4.99.39.

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>
2007-12-02 13:56:15 +00:00
jmcneill
61d5fb95a4 No need to waste more than one line of output at attach time. 2007-12-02 06:26:40 +00:00
kiyohara
791b5cdccd Add bcsp and btbc and btuart. 2007-12-02 03:33:09 +00:00
kiyohara
13aed8da30 Print name of firmware on fail for firmware_open(). 2007-12-02 02:06:30 +00:00