Commit Graph

14589 Commits

Author SHA1 Message Date
Gleb Smirnoff
f051cb85e8 Correctly switch IFCAP_VLAN_HWTAGGING on and off.
Reported & tested by:	Peter Blok <pblok bsd4all.org>
2006-03-03 12:32:51 +00:00
Matt Jacob
c1504bc00d micro fix from justin 2006-03-03 07:04:43 +00:00
Maksim Yevmenkin
af0618e9d4 Fix endian bugs accessing ioctl arguments that are passed by value.
Pointed out by:	marius
MFC after:	1 day
2006-03-03 00:46:28 +00:00
Maksim Yevmenkin
b569776d07 Provide ability to disable kbdmux(4) with the hint.kbdmux.0.disabled="1" hint.
Document hint in the kbdmux(4) man page.

Requested by:	scottl
MFC after:	1 day
2006-03-01 18:34:48 +00:00
Roman Kurakin
c068fdddc4 Update low-level code. (to version 1.4)
Obtained from:	Cronyx Engineering
MFC after:	3 days
2006-03-01 09:50:20 +00:00
Søren Schmidt
0b03bcd2f9 Work around the deadlock that occours when ATA waits for the taskqueue
to call back for completition and something else is holding the taskqueue
waiting for ATA to return data.
This should clear up the "semaphore timeout !! DANGER Will Robinson !!"
in most situations, and log "taskqueue timeout - completing request directly"
instead, with a delayed "WARNING - freeing taskqueue zombie request" when
the taskqueue finally calls us back with the now stale request.
(It would have been nice if there was a way to remove a scheduled item from
 a taskqueue, but that is not currently implemented in the kernel).

A real fix for this is in the works but wont make it to 6.1RELEASE

definite MFC candidate.
2006-03-01 07:48:41 +00:00
Scott Long
3469383f4f Big update to the iir driver:
- Don't use a common buffer in the softc to store per-command data.  Reserve
  a buffer in the command itself.
- Don't allocate DMA memory for the kernel command structures when all you
  really need is DMA memory for the scratch buffer embedded in them.  Instead
  allocate a slab for the scratch buffers and divide it up as needed.
- Call bus_dmamap_unload() at the completion of commands.
- Preserve and clear the CAM CCB status flags at completion.
- Reorder some low-level command operations to try to close races.
- Limit the simq to 32 commands for now.  There are some serious problems
  with the driver under load that are not well understood, so keeping the
  simq lower helps avoid this.  It has been tested at a higher value, but
  this is a safe value that doesn't show much performance degredation.

These changes allow the driver to work reliably with >4GB of memory on i386
and amd64, and also work around deadlocks seen under very high load in
certain situations.  The work-around is far from ideal, but without and
documentation it is hard to know what the right fix is.

MFC candidate
2006-03-01 07:24:39 +00:00
Warner Losh
e8bfdb2a33 Don't free ifaces yet, should fix a panic 2006-03-01 06:31:24 +00:00
Maksim Yevmenkin
d168d95487 Integrate kbdmux(4) into syscons(4) and kbd code.
By default syscons(4) will look for the kbdmux(4) keyboard first, and then,
if not found, look for any keyboard.

Current kbd code is modified so if kbdmux(4) is the current keyboard, all
new keyboards are automatically added to the kbdmux(4).

Switch to kbdmux(4) can be done at boot time, by loading kbdmux module at
the loader prompt, or at runtime, by kldload'ing the kbdmux module and
releasing current active keyboard.

If, for whatever reason, kbdmux(4) is not required/desired then just do
not load it and everything should work as before. It is also possible to
kldunload kbdmux at runtime and syscons(4) will automatically switch to
the first available keyboard.

No response from:	freebsd-current@
MFC after:		1 day
2006-02-28 23:46:23 +00:00
Matt Jacob
29ae59edff Fix mpt_reset to try mpt_hard_reset more than once, and to try
mpt_soft_reset more than once. And to wait for MPT_DB_STATE_READY
twice. I mean, this is crucial- give the IOC a chance to get
ready.

If mpt_reset is called to reinit things, and we succeed, make
sure to re-enable interrupts. This is what has mostly led to
system lockup after having to hard reset the chip. Also, if
we think that interrupts aren't function in mpt_cam_timeout,
for goodness sake, turn them on again.

In read_cfg_header, return distinguishing errnos so the caller
can decide what's an error. It's *not* an error to fail to
read a RAID page from a non-RAID capable device like the FC929X.

Some whitespace fixes (removing spaces from ends of lines).
2006-02-28 07:44:50 +00:00
Maksim Yevmenkin
2d6b1da721 Make ukbd(4) to not delay break scancodes in "raw" mode.
Developed with:		Norbert Koch < NKoch at demig dot de >
No response from:	freebsd-current@
Tested by:		Norbert Koch < NKoch at demig dot de >
MFC after:		1 day
2006-02-28 03:34:06 +00:00
Maksim Yevmenkin
40a3c5ea70 Plug memory leak
MFC after:	1 day
2006-02-27 21:47:38 +00:00
Warner Losh
04a6a8a8e5 Since we set the decription, we don't need to also print it. Noticed by: ru@ 2006-02-27 19:40:37 +00:00
Warner Losh
b0e8c55437 Don't forget to free the ifaces when we free the ivars 2006-02-27 19:36:22 +00:00
Sam Leffler
ebecf80294 backout 1.136 until we can resolve report that it causes output to stall 2006-02-27 17:20:23 +00:00
Maksim Yevmenkin
0722466d60 Disable custom locking in the vkbd(4) for now and make it rely on the
Giant mutex (just like the rest of keyboard drivers and syscons(4) do).

Tested by:	markus
MFC after:	1 day
2006-02-27 06:17:48 +00:00
Ian Dowse
564d760afe Add the Tripp-Lite U209-000-R serial adapter.
PR:		usb/78543, usb/93347
MFC after:	1 week
2006-02-27 01:01:27 +00:00
Matt Jacob
6a9fa0152c Remove the ill-considered effect of using the type definitions as
distributed by LSI-Logic. For FreeBSD, just use the posix defines
instead of trying to figure out how wide an int is. Apologies to all.
2006-02-26 22:50:14 +00:00
Matt Jacob
c6435ff3dd propagate role of device for ISP_GET_PDBINFO 2006-02-26 22:40:56 +00:00
Ian Dowse
cc06b755fe The UQ_OPEN_CLEARSTALL entry added in revision 1.48 is no longer
required now that we save the data toggle when closing a pipe.

Verified by:	Fredrik Lindberg
2006-02-26 22:20:45 +00:00
Warner Losh
6e5832cd99 Repo copy de driver to dev/de, and adjust. 2006-02-26 17:52:04 +00:00
Matt Jacob
8b14319c98 Shorten the time for waiting for TMF commands to complete- let's
not hang the system for 5 seconds. If a TMF doesn't complete within,
oh, say 500ms, that's enough.

Put in a printout to catch mpt_recover_commands being activated with
no commands.
2006-02-26 07:46:09 +00:00
Matt Jacob
ca8ee7080f a) Delay for port enable to succeed should be 30 seconds (at least) for
*both* SAS and FC, not just SAS.

b) Don't tell the chip we want it to do FIFO signalling if we actually
don't set up the address where the FIFO signal is supposed to be written
(oops).
2006-02-26 07:44:31 +00:00
Ian Dowse
78e3c96cc9 Save and restore the data toggle value when a pipe to an endpoint
is closed and then reopened. This appears to be necessary now that
we no longer clear endpoint stalls every time a pipe is opened.
Previously we could assume an initial toggle value of zero because
the clear-stall operation resets the device's toggle state.

Reported by:	Holger Kipp
MFC after:	3 days
2006-02-26 02:57:57 +00:00
Maksim Yevmenkin
65b70c1dfd Put a comment, explaining why kbdmux(4) had to be fixed.
While I'm here fix a couple of whitespaces.

Requested by:	netchild
MFC after:	1 day
2006-02-25 22:59:01 +00:00
Maksim Yevmenkin
fd4df69975 Fix hard lockup caused by kbdmux(4) when kbdmux(4), PS/2 keyboard
(atkbd(4)) and PS/2 mouse (psm(4)) are used together.

Turns out that atkbd(4) check_char() method may return "true" while
read_char() method returns NOKEY. When this happens kbdmux(4) was
simply stuck in the dead loop. Avoid dead loop in kbdmux(4) by breaking
out of the loop if read_char() method returns NOKEY.

It almost seems like a bug in atkkbd(4), atkbd_check_char() calls
kbdc_data_ready(), and, the later will return "true" if there are
pending data in either kbd or aux queue. However, because both aux
and kbd are on the same controller, I'm not sure if this is a bug
or feature.

Tested by:	markus
MFC after:	1 day
2006-02-25 21:59:29 +00:00
Ian Dowse
b184cddcc2 Add a missing ohci_waitintr() call that allows polled operation of
bulk transfers to have a chance of working.

PR:		usb/93720
Submitted by:	Nate Nielsen
MFC after:	1 week
2006-02-25 17:44:29 +00:00
Søren Schmidt
a62b100d96 Fix ata_reinit so it does things in the right order to prevent panic's.
Lock the channel so master/slave setups wont trash during reinit.
2006-02-25 17:27:33 +00:00
Matt Jacob
0b80d21bdf Role a microrev of the MPI Library in preparation for target mode work.
Make my portions of the license clearer.

Thank Chris Ellsworth for his support in getting a bunch of this done.
2006-02-25 07:45:54 +00:00
Sam Leffler
8fe92b6cf6 fix a race whereby a tx descriptor might get reused before the hardware
is finished with it; this may only occur when the tx queue is setup as
dba-gated but since the fix is cheap apply it to all queues

while here make the queue depth signed for use in assertions

Reviewed by:	apatti
MFC after:	2 weeks
2006-02-24 23:10:08 +00:00
Ariff Abdullah
df010ca869 Trim unnecessary pointer alignment. 2006-02-24 09:29:32 +00:00
Marcel Moolenaar
ea54941449 Replace our local UART_SIGMASK_* with the global SER_MASK_*. 2006-02-24 05:40:17 +00:00
Marcel Moolenaar
0bb90c9d57 When we probe a SAB82532, return BUS_PROBE_GENERIC. This allows puc(4)
or scc(4) to grab the device by default. In fact, we probably shouldn't
even claim the device at all...
2006-02-24 05:36:44 +00:00
Marcel Moolenaar
2d5118050a MFp4:
Stop using our local UART_IPEND_* and instead use the global SER_INT_*
as defined in <sys/serial.h>.
2006-02-24 02:42:26 +00:00
Marcel Moolenaar
c9ccf50a36 MFp4:
Return BUS_PROBE_LOW_PRIORITY for a successful probe. This is in
preparation of the introduction of scc(4), which is going to handle
SCCs in the near future.
2006-02-24 02:06:57 +00:00
Marcel Moolenaar
1ba1685b25 MFp4:
Add CHAN_A & CHAN_B for channel register offsets.
While here, fix a comment.
2006-02-24 02:03:35 +00:00
Søren Schmidt
28baad63bd Keep the parent device (in this case the channel) around in ata_request,
so we dont panic device removal or failure.
Clean up ata_fail_requests to prevent the queue munging to fail.
2006-02-23 20:15:22 +00:00
John Baldwin
de49f3252c Remove some dead code.
Coverity ID:	822
Found by:	Coverity Prevent
Reviewed by:	ariff
MFC after:	1 week
2006-02-23 19:23:55 +00:00
John Baldwin
9fc9d84b9b - Use callout_init_mtx() to initialize toffhandle callout using the fdc's
mutex.
- Don't use callout_drain() to stop the toffhandle callout while holding the
  fdc mutex (this could deadlock) in functions called from softclock
  (callouts aren't allowed to do voluntary sleeps).  Instead, use
  callout_stop().  Note that since we hold the associated mutex and are now
  using callout_init_mtx(), callout_stop() is just as effective as
  callout_drain().  (Though callout_drain() is still needed in detach to
  make sure softclock isn't contesting on our mutex before we destroy the
  mutex.)
- Remove unused callout 'tohandle' from softc.

MFC after:	1 week
2006-02-23 19:11:16 +00:00
Søren Schmidt
c94b3e542e In ata_cmd_allocate() only call ata_pci_allocate once.
found by:	jhb@
2006-02-23 18:52:15 +00:00
John Baldwin
44a4a80962 Check the return value of copyin() and return an error if it fails.
Coverity ID:	839
Found by:	Coverity Prevent
MFC after:	1 week
Reviewed by:	ps, scottl
2006-02-23 18:05:38 +00:00
John Baldwin
93d74675d6 G/C unused variable. 2006-02-22 21:47:04 +00:00
John Baldwin
57fb5e6097 - Use bus_setup_intr() and bus_teardown_intr() to register device driver
interrupt handlers rather than BUS_SETUP_INTR() and BUS_TEARDOWN_INTR().
  Uses of the BUS_*() versions in the implementation of foo_intr methods
  in bus drivers were not changed.  Mostly this just means that some
  drivers might start printing diagnostic messages like [FAST] when
  appropriate as well as honoring mpsafenet=0.
- Fix two more of the ppbus drivers' identify routines to function
  correctly in the mythical case of a machine with more than one ppbus.
2006-02-22 18:16:26 +00:00
John Baldwin
3df4e47b1e Use bus_setup_intr() rather than invoking BUS_SETUP_INTR() directly so that
puc still prints out [FAST] on Peter's box.
2006-02-22 17:19:10 +00:00
Gleb Smirnoff
9cc9484cb5 Back out 1.112,1.113. I don't have enough resources to fix breakages
introduced by this change.
2006-02-22 14:11:16 +00:00
Matt Jacob
696e0ce44d Remove commented out qualifier to dumping a message. 2006-02-22 05:19:50 +00:00
Marius Strobl
0c05ab41ab - In the interrupt handler clear the interrupt source flags before
processing the interrupt events. If we clear them afterwards we
  can completely miss some events as the NIC can change the source
  flags while we're in the handler. In order to not get another
  interrupt while we're in ifp->if_input() with the driver lock
  dropped we now turn off NIC interrupts while in the interrupt
  handler. Previously this was meant to be achieved by clearing the
  interrupt source flags after processing the interrupt events but
  didn't really work as clearing these flags doesn't actually
  acknowledge and re-enable the events.
  This fixes the device timeouts seen with the VMware LANCE.
- Relax the watchdog timer somewhat; don't enable it until the last
  packet is enqueued and if there is a TX interrupt but there are
  still outstanding ones reload the timer.

Reported and tested by:	Morten Rodal <morten@rodal.no>
MFC after:		3 days
2006-02-21 20:20:43 +00:00
Yoshihiro Takahashi
c15ff0bc7b Initialize the port_bst and port_bsh variables.
The ed driver on pc98 was broken by if_edvar.h rev1.31.

Reported by:	Kaho Toshikazu (kaho at elam kais kyoto-u ac jp)
Tested by:	Eiji Kato (ekato at a1 mbn or jp)
MFC after:	3 days
2006-02-21 12:01:39 +00:00
Nate Lawson
ce1a23d397 Remove unused variable.
Coverity ID:	558
Found by:	Coverity Prevent
2006-02-21 03:19:24 +00:00
Nate Lawson
987b1ad6d5 Remove unused variable.
Coverity ID:	548
Found by:	Coverity Prevent
2006-02-21 03:16:58 +00:00