Commit Graph

22684 Commits

Author SHA1 Message Date
ad 2823fb7428 Defer wakeup() to a soft interrupt, since lptintr() can be called above
IPL_SCHED.
2007-10-09 12:45:27 +00:00
ad c97e9c4ea7 brelse() stragglers. 2007-10-08 20:12:05 +00:00
ad 9f56dfa520 Merge brelse() changes from the vmlocking branch. 2007-10-08 18:02:53 +00:00
ad 1d7050e5e2 Merge from vmlocking: fix many timing problems on mips. 2007-10-08 16:52:49 +00:00
ad be0770a433 Merge from vmlocking: use mutexes and the softint API. 2007-10-08 16:50:45 +00:00
ad 2af68666da Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
2007-10-08 16:41:05 +00:00
ad 46ed8f7d77 Use the softint API. 2007-10-08 16:18:02 +00:00
xtraeme 6a0ca41c22 Set the monitor value only once in the acpitz_init_envsys(),
not multiple times in the callout handler.
2007-10-07 23:14:53 +00:00
joerg 1b78992d21 Add some basic parsing of the PCI Express capabilities register.
This is enough to help detect the source of interrupt storms at least
for my Thinkpad.
2007-10-07 23:00:47 +00:00
xtraeme ab21cdda12 sme_event_unregister: remove a goto that is not needed anymore. 2007-10-07 14:07:21 +00:00
hannken 3856acafe2 Update the file system copy-on-write handler.
- Instead of hooking the handler on the specdev of a mounted file system
  hook directly on the `struct mount'.

- Rename from `vn_cow_*' to `fscow_*' and move to `kern/vfs_trans.c'.  Use
  `mount_*specific' instead of clobbering `struct mount' or `struct specinfo'.

- Replace the hand-made reader/writer lock with a krwlock.

- Keep `vn_cow_*' functions and mark as obsolete.

- Welcome to NetBSD 4.99.32 - `struct specinfo' changed size.

Reviewed by: Jason Thorpe <thorpej@netbsd.org>
2007-10-07 13:38:53 +00:00
nisimura 1e20a40aee A typo fix in one of comments and some adjustments of register field names.
No functionality change intented.

IHAE "IP Header Alignment Enable" feature of RXC register;
- careful cross referencing at KSZ8692P/8841P/8842P PDFs indicates IHEA
  bit works as follows; When the feature is turned on, Rx DMA engine
  will populate Rx frame data in the Rx memory with +2 or +3 byte swifted
  to make its IP head field 32bit aligned.  The shift amount is recorded
  inside RDES0 to tell 0, 2 or 3.  The automatic alignment is done only
  when IHAE is enabled _and_ the Rx frame was IP frame.  In other cases,
  RDES0 swift amount field keeps 0.
- KSZ8841P document mentions the IHAE bit but its reference link is broken
  to tell the new RDES0 field.  KSZ8842P lacks both.  The bit usage of
  RDES0 23:20 seems different from KSZ8692P, which brings me a vague
  suspiction of documentation error.
2007-10-07 07:23:56 +00:00
xtraeme 6c4da82b5e New changes to support the new configuration file format for
envstat(8) and the envsys framework:

- Modify the ENVSYS_SETDICTIONARY ioctl to support the following
  plist structure:

  <dict>
	<key>foo0</key>
	<array>
		<dict>
			<key>index</key>
			<string>sensor0</string>
			<key>description</key>
			<string>cpu temp</string>
			...
			Another property for this sensor
			...
		</dict>
		...
		Another dictionary for other sensor
		...
	</array>
	...
	Another device as above
	...
  </dict>

  Multiple devices with multiple sensors can now be specified, that means
  that to set the properties only one copyin(9) is needed now.

- Added the ENVSYS_REMOVEPROPS ioctl, that accepts a boolean object
  "envsys-remove-props" and when set to true, all properties that were
  set previously by ENVSYS_SETDICTIONARY will be removed. That means that
  you can now set multiple critical limits, descriptions and all they
  will be removed or changed to its default value (for rfact and
  description objects).

- Added the 'index' and 'allow-rfact' objects into the sensor dictionaries,
  for better interactivity with userland. To know the position of the
  sensor and to know if sensor allows to change the rfact.

- Misc cosmetic changes for consistency.

- Use a two clause license for all my code.
2007-10-07 04:11:15 +00:00
xtraeme 50509ea822 Forgot to change the kmem_zalloc(9) calls to use KM_NOSLEEP in previous,
as was suggested by rmind.
2007-10-06 22:07:42 +00:00
xtraeme 4814127d51 Fix a bug that happened when two or more events were received almost
at the same time and the code accessed to an unexistent dictionary:

- Rather than using a global dictionary, use a singly linked list to
  access to the dictionaries, one per event.
- When the dictionary has been sent to userland, destroy it and remove
  it from the list.

With that change it is possible to receive multiple events at the
same time without panics; again thanks to rmind@ for comments and help
with locking.

Reviewed and ok by rmind.
2007-10-06 21:58:40 +00:00
bouyer 975e5c30a0 Move check for b_resid value to the right place. Should definitively fix
kern/36690.
2007-10-06 12:52:43 +00:00
xtraeme 8b2678bd7e Use a two clause license for all the code I contributed.
The envsys code will be changed later.
2007-10-06 07:21:02 +00:00
xtraeme 07f9bca5af - sysmon_power_daemon_task: check if pev is valid before use.
- Add two more KASSERTS in strategic places.
2007-10-06 02:49:46 +00:00
jmcneill 02ef36ec48 Sort IO resources before attempting to attach; resolves issues on ACPI
firmware that reports 0x64,0x60 instead of 0x60,0x64. Patch tested by
Greg A. Woods.
2007-10-05 18:31:46 +00:00
oster 8b11ddb95c Implement dumping kernel cores to RAID 1 sets. The component used
for the dump is selected in this order of preference:
   1) the master
   2) a used_spare of the master
   3) the slave
   4) a used_spare of the slave
2007-10-05 01:40:04 +00:00
kiyohara 97cc00811e Fix some bugs.
* Cast to integer the 2nd args of m_adj().
  * Move test/set flag BTF_XMIT to bcsp_start().
  * The initialization of the array was clarified.
2007-10-04 14:43:06 +00:00
xtraeme 63467beed0 AMD CS5536 Companion Device is able to work in Ultra DMA Mode 5,
patch from Andreas Wrede in PR kern/37059.
2007-10-04 13:30:59 +00:00
veego d7415fbd43 Add support to ignore hid attachments for some devices, right now MGE and
APC UPS devices.
No objections on tech-kern at the end of June 2007
Patch is from PR kern/31884
2007-10-03 15:01:28 +00:00
plunky 2e43d32311 fix typo : -> ; 2007-10-02 05:53:47 +00:00
junyoung 24ae586ea3 Use __packed rather than __attribute__ ((__packed__)). 2007-10-02 05:40:10 +00:00
plunky 0327efae31 clean up activate function 2007-10-02 05:38:06 +00:00
plunky 41358e9b10 remove unused activate function 2007-10-02 05:37:50 +00:00
bouyer 511e912cd0 When checking for invalid b_resid valyes, also check negative ones.
Should fix kern/36690.
2007-10-01 18:43:30 +00:00
bouyer 8d743383a3 Properly initialize xs_callout in sddump(). We're using a static scsipi_xfer
here which didn't get through scsipi_get_xs().
Pointed out by Greg Oster.
2007-10-01 18:16:05 +00:00
martin c51526f373 Back out accidently commited part of previous 2007-10-01 12:54:39 +00:00
martin 163215473e Do not stop callouts for polled commands. 2007-10-01 09:43:00 +00:00
martin eb9963a5e5 Do not stop callouts on polled commands. Problem noticed by Chris Ross
when trying to do a kernel dump on sparc64.
Approved by Manuel Bouyer.
2007-09-30 11:59:41 +00:00
kiyohara 09fa5a563a Add bcsp(4). However, it is debuging state. 2007-09-30 04:07:41 +00:00
scw eeb9826d3b s/NPBFILTER/NBPFILTER/ in some #endif comments. No functional change. 2007-09-29 18:32:50 +00:00
scw 35b1297a77 - Fix bpf radiotap: s/NPBFILTER/NBPFILTER/
- In rt2661_set_chan(), handle the case where there is no previous channel.
  (Can happen if we go directly to monitor mode before UP'ing the i/f)
2007-09-29 18:30:22 +00:00
bouyer adc1896a31 Properly set b_resid in an error case.
Clamp b_resid to b_bcount in case the info field is larger. Fix a KASSERT
in physio() when a media error occurs on my SDLT320 drive (maybe this drive
is bogus for not setting the highter bits to 0 in the INFO field in this
case).
2007-09-29 11:04:51 +00:00
kiyohara 3e56b57e2a We must not call bus_space_unmap() here. 2007-09-29 10:20:31 +00:00
msaitoh fff21ff359 Fix three bugs.
1) Move a magic number writing code.
Fix a watchdog timeout and "block failed to stop" problem on BCM5701 B5 card.

2) Fix incorrect register write.
Fix a watchdog timeout "block failed to stop" problem on BCM5700 B2 card.

3) Wait more long time for PCISTATE register to return to its original
pre-reset state.
Fix "pcistate failed to revert" problem on BCM5703 A2 card.
2007-09-28 15:37:45 +00:00
njoly 69b70bfe60 Add ACPI address32 resource type support (DWord Address Space
Descriptor), for fixed size io and mem.

Fix hpet@acpi attachement on Dell Poweredge 860.
Tested by Wouter Schoot, thanks.

While here:
- Update some indentation
- Correct function check
- Add missing break
- Update wrong debug message

Reviewed by cube.
2007-09-28 15:16:16 +00:00
ad 9c412e0cbf x86 changes for pcc and LKMs.
- Replace most inline assembly with proper functions. As a side effect
  this reduces the size of amd64 GENERIC by about 120kB, and i386 by a
  smaller amount. Nearly all of the inlines did something slow, or something
  that does not need to be fast.
- Make curcpu() and curlwp functions proper, unless __GNUC__ && _KERNEL.
  In that case make them inlines. Makes curlwp LKM and preemption safe.
- Make bus_space and bus_dma more LKM friendly.
- Share a few more files between the ports.
- Other minor changes.
2007-09-26 19:48:34 +00:00
macallan 2d476100ad add a few more register definitions 2007-09-26 05:47:41 +00:00
macallan db7f214b33 allow to override the check for an external precision resistor via device
property so we can have 40MB/s on SGI O2
2007-09-26 01:22:29 +00:00
ad 37a012a7c2 Use splhigh(), not disable_intr(). 2007-09-25 23:11:24 +00:00
xtraeme 2e97fc9309 - Don't use _nocopy in prop_dictionary_set_cstring, the string is part
of another object that will be released shortly.
- Fix a memleak: add sysmon_power_destroy_dictionary() and remove
  all objects that are currently in the dictionary and finally release
  the dictionary.
2007-09-25 19:27:08 +00:00
ad 1934283e4a Use selinit() / seldestroy(). 2007-09-25 14:04:07 +00:00
joerg e70e336960 Convert bge(4) to device/softc separation. Use aprint_* instead of
printf all over the place. Only the debug macros are kept. Place the TSO
message about the hard case under debug.
2007-09-24 21:25:45 +00:00
xtraeme 636631cccc sme_add_sensor_dictionary: don't forget to release the dictionary when
an error ocurrs. This is the last memleak in the code, let me know if
you find more and I'll pay you a beer.
2007-09-24 19:46:38 +00:00
plunky 43ed9716b7 do not use _nocopy, this string is part of another object that
will be released shortly..
2007-09-24 18:09:17 +00:00
cube 9d4a2bf213 - If the chip doesn't support jumbo frames, don't use bus_dmamap_load_mbuf
which expects a properly filled mbuf chain, but bus_dmamap_load for the
  mbuf storage space instead.

- If the chip supports jumbo frames
    + keep track of which RX descriptor uses which jumbo mbuf buffer, so
      that we can rewrite the physaddr field of the descriptor later, as it
      might be partially overwritten by the hw
    + when we're out of jumbo mbufs, and if the packet is small enough,
      copy it into a cluster mbuf

Those changes make my nfe(4) stable in both cases (defining NFE_NO_JUMBO
for the first one).
2007-09-24 13:17:53 +00:00
cube 5b396aa2c0 From OpenBSD, rev 1.72:
In nfe_start() do a fast return if IFF_OACTIVE is set, in
this case we need a Tx interrupt to clean up the DMA ring
before if_start can be properly called.
2007-09-24 13:11:08 +00:00