The NetBSD Project

CVS log for src/sys/dev/ic/wdc.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / dev / ic

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.291.4.2 / (download) - annotate - [select for diffs], Fri Dec 30 14:39:09 2022 UTC (15 months, 2 weeks ago) by martin
Branch: netbsd-9
Changes since 1.291.4.1: +6 -24 lines
Diff to previous 1.291.4.1 (colored) to branchpoint 1.291 (colored) next main 1.292 (colored) to selected 1.30 (colored)

Pull up following revision(s) (requested by tsutsui in ticket #1557):

	sys/dev/ic/ahcisata_core.c: revision 1.83
	sys/dev/ic/ahcisata_core.c: revision 1.102
	sys/dev/ata/ata.c: revision 1.164
	sys/dev/ata/ata_wdc.c: revision 1.115
	sys/dev/ata/ata_recovery.c: revision 1.4
	sys/dev/ic/siisata.c: revision 1.42
	sys/dev/ic/wdc.c: revision 1.308
	sys/dev/ic/mvsata.c: revision 1.56
	sys/dev/scsipi/atapi_wdc.c: revision 1.138
	sys/dev/ic/siisata.c: revision 1.49
	sys/dev/ata/atavar.h: revision 1.105
	sys/dev/ata/wd.c: revision 1.460
	sys/dev/ata/ata.c: revision 1.155
	sys/dev/ata/wd.c: revision 1.462
	sys/dev/ata/atavar.h: revision 1.109
	sys/dev/ata/satapmp_subr.c: revision 1.16
	sys/dev/ic/wdc.c: revision 1.299
	sys/dev/ic/ahcisata_core.c: revision 1.93
	sys/dev/ata/ata_wdc.c: revision 1.120
	sys/dev/ic/wdcvar.h: revision 1.100
	sys/dev/scsipi/atapi_wdc.c: revision 1.141
	sys/dev/ic/mvsata.c: revision 1.61
	sys/dev/usb/umass_isdata.c	(apply patch)

drop wd lock in wdstart1() before calling the ata_bio hook; when called
from ata thread context, that can still need to sleep for wdc attachments
in wdcwait()

fix use-after-free for ata xfer on bio submission found by KASAN
driver ata_bio hooks read parts of the xfer after ata_exec_xfer()
call in order to determine return value, change so that the hook
doesn't return any value - callers do not care already,
as all I/O requests are asynchronous

this problem was uncovered by recent change for wd(4) to not hold
wd mutex during ata_bio call, the interrupt for the xfer might
thus actually fire immediately

adjust also ata_exec_command driver hooks similarily - remove all
completion and waiting logic from drivers, upper layer ata code
using AT_WAIT/AT_POLL changed to call ata_wait_cmd() itself
PR kern/55169 by Nick Hudson

Function declaration formating whitespace consistency.  NFCI.

PR kern/56403
Fix kernel freeze for wdc(4) variants with ATAC_CAP_NOIRQ:

(1) Change ata_xfer_ops:c_poll from void to int function. When it returns
    ATAPOLL_AGAIN, let ata_xfer_start() iterate itself again.
(2) Let wdc_ata_bio_poll() return ATAPOLL_AGAIN until ATA_ITSDONE is
    achieved.

A similar change has been made for mvsata(4) (see mvsata_bio_poll()),
and no functional changes for other devices.

This is how the drivers worked before jdolecek-ncq branch was merged.
Note that this changes are less likely to cause infinite recursion:

(1) wdc_ata_bio_intr() called from wdc_ata_bio_poll() asserts ATA_ITSDONE
    in its error handling paths via wdc_ata_bio_done().
(2) Return value from c_start (= wdc_ata_bio_start()) is checked in
    ata_xfer_start().

Therefore, errors encountered in ata_xfer_ops:c_poll and c_start routines
terminate the recursion for wdc(4). The situation is similar for mvsata(4).

Still, there is a possibility where ata_xfer_start() takes long time to
finish a normal operation. This can result in a delayed response for lower
priority interrupts. But, I've never observed such a situation, even when
heavy thrashing takes place for swap partition in wd(4).
"Go ahead" by jdolecek@.

Revision 1.310 / (download) - annotate - [select for diffs], Tue May 31 08:43:15 2022 UTC (22 months, 2 weeks ago) by andvar
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Changes since 1.309: +3 -3 lines
Diff to previous 1.309 (colored) to selected 1.30 (colored)

fix various typos in comments, documentation and messages.

Revision 1.309 / (download) - annotate - [select for diffs], Tue May 24 20:50:19 2022 UTC (22 months, 3 weeks ago) by andvar
Branch: MAIN
Changes since 1.308: +3 -3 lines
Diff to previous 1.308 (colored) to selected 1.30 (colored)

fix various typos in comment, documentation and log messages.

Revision 1.308 / (download) - annotate - [select for diffs], Tue Oct 5 08:01:05 2021 UTC (2 years, 6 months ago) by rin
Branch: MAIN
Changes since 1.307: +5 -4 lines
Diff to previous 1.307 (colored) to selected 1.30 (colored)

PR kern/56403

Fix kernel freeze for wdc(4) variants with ATAC_CAP_NOIRQ:

(1) Change ata_xfer_ops:c_poll from void to int function. When it returns
    ATAPOLL_AGAIN, let ata_xfer_start() iterate itself again.

(2) Let wdc_ata_bio_poll() return ATAPOLL_AGAIN until ATA_ITSDONE is
    achieved.

A similar change has been made for mvsata(4) (see mvsata_bio_poll()),
and no functional changes for other devices.

This is how the drivers worked before jdolecek-ncq branch was merged.

Note that this changes are less likely to cause infinite recursion:

(1) wdc_ata_bio_intr() called from wdc_ata_bio_poll() asserts ATA_ITSDONE
    in its error handling paths via wdc_ata_bio_done().

(2) Return value from c_start (= wdc_ata_bio_start()) is checked in
    ata_xfer_start().

Therefore, errors encountered in ata_xfer_ops:c_poll and c_start routines
terminate the recursion for wdc(4). The situation is similar for mvsata(4).

Still, there is a possibility where ata_xfer_start() takes long time to
finish a normal operation. This can result in a delayed response for lower
priority interrupts. But, I've never observed such a situation, even when
heavy thrashing takes place for swap partition in wd(4).

"Go ahead" by jdolecek@.

Revision 1.307 / (download) - annotate - [select for diffs], Fri Sep 17 10:15:35 2021 UTC (2 years, 7 months ago) by rin
Branch: MAIN
Changes since 1.306: +5 -3 lines
Diff to previous 1.306 (colored) to selected 1.30 (colored)

wdc_sataprobe: Fix lock leak when atabus_alloc_drives() fails.

Revision 1.303.2.1 / (download) - annotate - [select for diffs], Sat Apr 3 22:28:45 2021 UTC (3 years ago) by thorpej
Branch: thorpej-futex
Changes since 1.303: +21 -21 lines
Diff to previous 1.303 (colored) next main 1.304 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.306 / (download) - annotate - [select for diffs], Mon Jan 4 15:14:32 2021 UTC (3 years, 3 months ago) by skrll
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.305: +3 -3 lines
Diff to previous 1.305 (colored) to selected 1.30 (colored)

KNF

Revision 1.305 / (download) - annotate - [select for diffs], Mon Jan 4 15:13:50 2021 UTC (3 years, 3 months ago) by skrll
Branch: MAIN
Changes since 1.304: +19 -19 lines
Diff to previous 1.304 (colored) to selected 1.30 (colored)

Trailing whitespace

Revision 1.304 / (download) - annotate - [select for diffs], Mon Jan 4 15:13:06 2021 UTC (3 years, 3 months ago) by skrll
Branch: MAIN
Changes since 1.303: +3 -3 lines
Diff to previous 1.303 (colored) to selected 1.30 (colored)

Spell interrupts correctly

Revision 1.303 / (download) - annotate - [select for diffs], Wed Jun 3 18:25:26 2020 UTC (3 years, 10 months ago) by bouyer
Branch: MAIN
Branch point for: thorpej-futex
Changes since 1.302: +3 -5 lines
Diff to previous 1.302 (colored) to selected 1.30 (colored)

Don't print an error message on spurious interrupt. Way too noisy for Xen.

Revision 1.302 / (download) - annotate - [select for diffs], Sat May 30 13:23:14 2020 UTC (3 years, 10 months ago) by jdolecek
Branch: MAIN
Changes since 1.301: +19 -14 lines
Diff to previous 1.301 (colored) to selected 1.30 (colored)

fix wdcprobe_with_reset() to avoid allocating big structures on stack

Revision 1.301 / (download) - annotate - [select for diffs], Thu May 21 09:24:17 2020 UTC (3 years, 10 months ago) by jdolecek
Branch: MAIN
Changes since 1.300: +3 -6 lines
Diff to previous 1.300 (colored) to selected 1.30 (colored)

in wdctimeout(), do not schedule another timeout handler, as that only
creates race with eventual xfer resubmission - the c_intr()
method does all the necessary handling, including re-scheduling of the
timeout handler if appropriate

also make sure to clear ATACH_IRQ_WAIT before calling c_intr(), same
as real interrupt does; this is important so that eventual spurious timeout
would not interfere with xfer handling in the atabus thread

fixes another race in the atabus thread found by KASAN, reported by Paul Ripke

Revision 1.300 / (download) - annotate - [select for diffs], Tue May 19 08:21:29 2020 UTC (3 years, 11 months ago) by jdolecek
Branch: MAIN
Changes since 1.299: +8 -3 lines
Diff to previous 1.299 (colored) to selected 1.30 (colored)

in wdctimeout() ignore timeout if not actually waiting for IRQ, to avoid
processing xfer which is not quite setup

in wdcintr() actually write the error message on invocation when
not waiting for IRQ even without ATADEBUG option, as usually that
is a driver bug; might revisit this if this ends up too noisy for
PCI-IDE which seems to ignore WDCTL_IDS and hence trigger irq even
for polled commands

Revision 1.288.4.4 / (download) - annotate - [select for diffs], Tue Apr 21 18:42:16 2020 UTC (3 years, 11 months ago) by martin
Branch: phil-wifi
Changes since 1.288.4.3: +1 -20 lines
Diff to previous 1.288.4.3 (colored) to branchpoint 1.288 (colored) next main 1.289 (colored) to selected 1.30 (colored)

Sync with HEAD

Revision 1.298.2.1 / (download) - annotate - [select for diffs], Mon Apr 20 11:29:03 2020 UTC (4 years ago) by bouyer
Branch: bouyer-xenpvh
Changes since 1.298: +3 -22 lines
Diff to previous 1.298 (colored) next main 1.299 (colored) to selected 1.30 (colored)

Sync with HEAD

Revision 1.299 / (download) - annotate - [select for diffs], Mon Apr 13 10:49:34 2020 UTC (4 years ago) by jdolecek
Branch: MAIN
CVS Tags: phil-wifi-20200421, bouyer-xenpvh-base2, bouyer-xenpvh-base1
Changes since 1.298: +3 -22 lines
Diff to previous 1.298 (colored) to selected 1.30 (colored)

fix use-after-free for ata xfer on bio submission found by KASAN

driver ata_bio hooks read parts of the xfer after ata_exec_xfer()
call in order to determine return value, change so that the hook
doesn't return any value - callers do not care already,
as all I/O requests are asynchronous

this problem was uncovered by recent change for wd(4) to not hold
wd mutex during ata_bio call, the interrupt for the xfer might
thus actually fire immediately

adjust also ata_exec_command driver hooks similarily - remove all
completion and waiting logic from drivers, upper layer ata code
using AT_WAIT/AT_POLL changed to call ata_wait_cmd() itself

PR kern/55169 by Nick Hudson

Revision 1.288.4.3 / (download) - annotate - [select for diffs], Mon Apr 13 08:04:22 2020 UTC (4 years ago) by martin
Branch: phil-wifi
Changes since 1.288.4.2: +18 -10 lines
Diff to previous 1.288.4.2 (colored) to branchpoint 1.288 (colored) to selected 1.30 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.288.4.2 / (download) - annotate - [select for diffs], Wed Apr 8 14:08:06 2020 UTC (4 years ago) by martin
Branch: phil-wifi
Changes since 1.288.4.1: +6 -6 lines
Diff to previous 1.288.4.1 (colored) to branchpoint 1.288 (colored) to selected 1.30 (colored)

Merge changes from current as of 20200406

Revision 1.298 / (download) - annotate - [select for diffs], Sat Apr 4 21:36:15 2020 UTC (4 years ago) by jdolecek
Branch: MAIN
CVS Tags: phil-wifi-20200411, phil-wifi-20200406, bouyer-xenpvh-base
Branch point for: bouyer-xenpvh
Changes since 1.297: +3 -4 lines
Diff to previous 1.297 (colored) to selected 1.30 (colored)

fix deadlock in wdcwait() when xfer timeout happens while the atabus
thread sleeps in wdcwait() - check current lwp rather than relying
on global ATACH_TH_RUN channel flag

should fix the hang part of the problem reported in
http://mail-index.netbsd.org/netbsd-users/2020/03/12/msg024249.html

thanks to Paul Ripke for providing extensive debugging info

Revision 1.296.2.1 / (download) - annotate - [select for diffs], Sat Feb 29 20:19:08 2020 UTC (4 years, 1 month ago) by ad
Branch: ad-namecache
Changes since 1.296: +4 -3 lines
Diff to previous 1.296 (colored) next main 1.297 (colored) to selected 1.30 (colored)

Sync with head.

Revision 1.297 / (download) - annotate - [select for diffs], Mon Feb 10 20:11:48 2020 UTC (4 years, 2 months ago) by jdolecek
Branch: MAIN
CVS Tags: is-mlppp-base, is-mlppp, ad-namecache-base3
Changes since 1.296: +4 -3 lines
Diff to previous 1.296 (colored) to selected 1.30 (colored)

use wdc_maxdrives for atabus_alloc_drives() also in wdc_sataprobe()
instead of magic 1; no functional change, all wdc_sataprobe() users
actually set wdc_maxdrives to 1

Revision 1.296 / (download) - annotate - [select for diffs], Fri Dec 27 09:41:50 2019 UTC (4 years, 3 months ago) by msaitoh
Branch: MAIN
CVS Tags: ad-namecache-base2, ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Changes since 1.295: +3 -3 lines
Diff to previous 1.295 (colored) to selected 1.30 (colored)

s/transfered/transferred/

Revision 1.295 / (download) - annotate - [select for diffs], Mon Nov 4 15:12:10 2019 UTC (4 years, 5 months ago) by prlw1
Branch: MAIN
CVS Tags: phil-wifi-20191119
Changes since 1.294: +3 -3 lines
Diff to previous 1.294 (colored) to selected 1.30 (colored)

Fix locking bug seen when using WDCNDELAY_DEBUG in PR kern/52126
(Observed
  piixide0:0:0: warning: busy-wait took 200us
with no panic)

Revision 1.294 / (download) - annotate - [select for diffs], Wed Oct 23 14:44:41 2019 UTC (4 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.293: +5 -3 lines
Diff to previous 1.293 (colored) to selected 1.30 (colored)

Missing ata_channel_unlock(chp). Noted by mjg@freebsd.

Revision 1.293 / (download) - annotate - [select for diffs], Tue Oct 22 12:09:11 2019 UTC (4 years, 5 months ago) by martin
Branch: MAIN
Changes since 1.292: +6 -7 lines
Diff to previous 1.292 (colored) to selected 1.30 (colored)

Fix channel locking - patch from Christos.

Revision 1.291.4.1 / (download) - annotate - [select for diffs], Mon Sep 23 07:09:47 2019 UTC (4 years, 6 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1
Changes since 1.291: +12 -5 lines
Diff to previous 1.291 (colored) to selected 1.30 (colored)

Pull up following revision(s) (requested by tsutsui in ticket #232):

	sys/arch/evbppc/mpc85xx/wdc_obio.c: revision 1.7
	sys/arch/dreamcast/dev/g1/wdc_g1.c: revision 1.4
	sys/arch/dreamcast/dev/g1/wdc_g1.c: revision 1.5
	sys/arch/mmeye/dev/wdc_mainbus.c: revision 1.7
	sys/dev/ic/wdcvar.h: revision 1.99
	sys/dev/ic/wdc.c: revision 1.292
	sys/arch/mips/adm5120/dev/wdc_extio.c: revision 1.11

adjust several missed drivers for wdcprobe() changes of ATA NCQ branch
for dreamcast g1 just drop the custom reset function, it doesn't seem to do
anything useful over the generic variant

PR kern/54538 by Izumi Tsutsui

Restore interface to pass a MD reset function to MI wdcprobe().

Fixes silent hang on G1IDE on Dreamcast. PR kern/54538
Should be pulled up to netbsd-9 with the previous changes.

Revision 1.292 / (download) - annotate - [select for diffs], Sat Sep 14 17:11:39 2019 UTC (4 years, 7 months ago) by tsutsui
Branch: MAIN
Changes since 1.291: +12 -5 lines
Diff to previous 1.291 (colored) to selected 1.30 (colored)

Restore interface to pass a MD reset function to MI wdcprobe().

Fixes silent hang on G1IDE on Dreamcast. PR kern/54538
Should be pulled up to netbsd-9 with the previous changes.

Revision 1.288.4.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:07:11 2019 UTC (4 years, 10 months ago) by christos
Branch: phil-wifi
Changes since 1.288: +50 -50 lines
Diff to previous 1.288 (colored) to selected 1.30 (colored)

Sync with HEAD

Revision 1.288.2.1 / (download) - annotate - [select for diffs], Mon Nov 26 01:52:31 2018 UTC (5 years, 4 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.288: +50 -50 lines
Diff to previous 1.288 (colored) next main 1.289 (colored) to selected 1.30 (colored)

Sync with HEAD, resolve a couple of conflicts

Revision 1.291 / (download) - annotate - [select for diffs], Sat Oct 27 05:38:08 2018 UTC (5 years, 5 months ago) by maya
Branch: MAIN
CVS Tags: phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, netbsd-9-base, isaki-audio2-base, isaki-audio2
Branch point for: netbsd-9
Changes since 1.290: +4 -4 lines
Diff to previous 1.290 (colored) to selected 1.30 (colored)

Fix previous misnamed initializer elements

committed wrong version of patch, sorry!

Revision 1.290 / (download) - annotate - [select for diffs], Sat Oct 27 05:35:41 2018 UTC (5 years, 5 months ago) by maya
Branch: MAIN
Changes since 1.289: +12 -11 lines
Diff to previous 1.289 (colored) to selected 1.30 (colored)

Add missing ata_recovery struct element, NULL, same as wdc_ata_bustype
in the NWD > 0 case.

Build fix for the case where wd(4) is not built, reported by
John D. Baker on current-users.

Revision 1.289 / (download) - annotate - [select for diffs], Mon Oct 22 20:13:47 2018 UTC (5 years, 5 months ago) by jdolecek
Branch: MAIN
Changes since 1.288: +40 -41 lines
Diff to previous 1.288 (colored) to selected 1.30 (colored)

Merge jdolecek-ncqfixes branch

- ata_xfer's are dynamicall allocated as needed using a pool, no longer
  limited to number of possible openings supported by controller; dump
  and recovery paths use dedicated pre-allocated storage
- moved callouts and condvars from ata_xfer to queue or channel, so that
  ata_xfer does not need special initialization
- slot allocation now done when xfer is being activated, uncoupled
  from memory allocation; active slots are no longer tracked by controller
  code
- channel and drive reset is done always via the atabus thread, and
  now executes with channel locked the whole time
- NCQ recovery moved to shared function, and run via the thread also
- added some workarounds for buggy error recovery AHCI emulation in QEMU
  and Parallels

designed to primarily fix kern/52614, but might also help with kern/47041
and kern/53183

Revision 1.288.6.3 / (download) - annotate - [select for diffs], Wed Oct 3 19:20:48 2018 UTC (5 years, 6 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.288.6.2: +11 -11 lines
Diff to previous 1.288.6.2 (colored) to branchpoint 1.288 (colored) next main 1.289 (colored) to selected 1.30 (colored)

change channel reset and drive reset for all ATA controllers to always
run via thread, and with channel lock held the whole time; the queue is
frozen while reset is pending

for this repurpose ata_reset_channel() into new ata_thread_run()

also adjust some device printfs to not leak xfer pointer, and avoid
aprint_* for non-autoconf messages

Revision 1.288.6.2 / (download) - annotate - [select for diffs], Mon Sep 17 18:36:14 2018 UTC (5 years, 7 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.288.6.1: +15 -11 lines
Diff to previous 1.288.6.1 (colored) to branchpoint 1.288 (colored) to selected 1.30 (colored)

move low-level protocol handlers hooks from ata_xfer to separate struct,
initialized statically

primarily to reduce ata_xfer struct size, but also improves readibility,
and enforces consistency

Revision 1.288.6.1 / (download) - annotate - [select for diffs], Fri Aug 31 19:08:03 2018 UTC (5 years, 7 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.288: +18 -23 lines
Diff to previous 1.288 (colored) to selected 1.30 (colored)

refactor ata_xfer to be just dumb structure; move all callouts/condvars out

retry callout to wd(4); reset callout and the active/cmd finish condvars
to channel queue; change code using the condvars so it works if there
are multiple waiters

simplify the async wait code for cmds, replace ata_wait_xfer()/ata_wake_xfer()
with ata_wait_cmd()

fix the callout_invoking/ack race handling code for timeouts to
actually have chance to work; change mvsata(4) to use generic timeout func

towards resolution of kern/52614

Revision 1.274.2.4 / (download) - annotate - [select for diffs], Sun Dec 3 11:37:04 2017 UTC (6 years, 4 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.274.2.3: +278 -263 lines
Diff to previous 1.274.2.3 (colored) to branchpoint 1.274 (colored) next main 1.275 (colored) to selected 1.30 (colored)

update from HEAD

Revision 1.288 / (download) - annotate - [select for diffs], Fri Oct 20 07:06:07 2017 UTC (6 years, 6 months ago) by jdolecek
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, phil-wifi-base, pgoyette-compat-base, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, jdolecek-ncqfixes-base
Branch point for: phil-wifi, pgoyette-compat, jdolecek-ncqfixes
Changes since 1.287: +2 -4 lines
Diff to previous 1.287 (colored) to selected 1.30 (colored)

move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606

Revision 1.287 / (download) - annotate - [select for diffs], Tue Oct 17 18:52:50 2017 UTC (6 years, 6 months ago) by jdolecek
Branch: MAIN
Changes since 1.286: +14 -2 lines
Diff to previous 1.286 (colored) to selected 1.30 (colored)

reintroduce ATACH_IRQ_WAIT flag for attachments using wdcintr(), only
process the interrupt when the flag is set - this fixes spurious interrupt
during post-reset drive setup in wdc_ata_bio_start(), and wdc_atapi_start()

while those functions set WDCTL_IDS, this seems to be ignored by certain
(maybe all) PCI-IDE controllers; usually the implicit KERNEL_LOCK() would
prevent the interrupt anyway, but not when the start routine is started
from the atabus thread, which doesn't take it

fixes 'panic: wdc_ata_bio_intr: bad state' reported on current-users
by Chavdar Ivanov

Revision 1.286 / (download) - annotate - [select for diffs], Mon Oct 16 05:52:43 2017 UTC (6 years, 6 months ago) by jdolecek
Branch: MAIN
Changes since 1.285: +3 -3 lines
Diff to previous 1.285 (colored) to selected 1.30 (colored)

fix comment - it's WDCTL_IDS which is supposed to disable interrupts

Revision 1.285 / (download) - annotate - [select for diffs], Sun Oct 15 18:02:33 2017 UTC (6 years, 6 months ago) by jdolecek
Branch: MAIN
Changes since 1.284: +14 -2 lines
Diff to previous 1.284 (colored) to selected 1.30 (colored)

explicitely ignore polled xfers in wdcintr(), so it won't be processed
twice - seems setting WDSD_IBM actually has no effect at least
on some PCI-IDE, and the interrupt ends up being triggered when we release
the channel lock to call c_poll hook

fixes PR kern/52605, and should also fix the 'New panic in wdc_ata_bio_intr'
reported on current-users@

Revision 1.284 / (download) - annotate - [select for diffs], Sat Oct 7 16:05:32 2017 UTC (6 years, 6 months ago) by jdolecek
Branch: MAIN
Changes since 1.283: +245 -234 lines
Diff to previous 1.283 (colored) to selected 1.30 (colored)

Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)

Revision 1.283.2.17 / (download) - annotate - [select for diffs], Wed Sep 27 07:19:34 2017 UTC (6 years, 6 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.283.2.16: +23 -10 lines
Diff to previous 1.283.2.16 (colored) to branchpoint 1.283 (colored) next main 1.284 (colored) to selected 1.30 (colored)

change wdc_init_shadow_regs() to accept only struct wdc_regs, it doesn't
touch anything else

factor out the probe-only struct ata_channel initialization to wdcprobe(), to
reduce duplication of logic in individual drivers, and to actually work now
that more init is needed beyond the memset()

Revision 1.283.2.16 / (download) - annotate - [select for diffs], Tue Sep 19 21:06:25 2017 UTC (6 years, 7 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.283.2.15: +57 -54 lines
Diff to previous 1.283.2.15 (colored) to branchpoint 1.283 (colored) to selected 1.30 (colored)

replace all remaining tsleep()/wakeup() calls with condition variables, or
calls to ata_delay(), as appropriate; change ata_delay() to require the
channel lock on entry, and pass the lock to kpause() for unlocking while
sleeping

Revision 1.283.2.15 / (download) - annotate - [select for diffs], Mon Sep 11 22:19:23 2017 UTC (6 years, 7 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.283.2.14: +3 -3 lines
Diff to previous 1.283.2.14 (colored) to branchpoint 1.283 (colored) to selected 1.30 (colored)

fix condition for calling atastart() when command is done

Revision 1.283.2.14 / (download) - annotate - [select for diffs], Sun Sep 10 19:31:15 2017 UTC (6 years, 7 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.283.2.13: +49 -28 lines
Diff to previous 1.283.2.13 (colored) to branchpoint 1.283 (colored) to selected 1.30 (colored)

refactor code so that xfer c_start() hook is called with channel mutex held,
and hence the controller submit code no longer relies on spl

tested all the affected drivers - wdc (via piixide), ahci, mvsata, siisata,
both disk and atapi I/O

Revision 1.279.6.4 / (download) - annotate - [select for diffs], Mon Aug 28 17:52:04 2017 UTC (6 years, 7 months ago) by skrll
Branch: nick-nhusb
Changes since 1.279.6.3: +3 -3 lines
Diff to previous 1.279.6.3 (colored) to branchpoint 1.279 (colored) next main 1.280 (colored) to selected 1.30 (colored)

Sync with HEAD

Revision 1.283.2.13 / (download) - annotate - [select for diffs], Sat Aug 12 14:41:54 2017 UTC (6 years, 8 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.283.2.12: +3 -4 lines
Diff to previous 1.283.2.12 (colored) to branchpoint 1.283 (colored) to selected 1.30 (colored)

convert the atabus thread to use the channel lock and a condvar, adjust
code which sets the relevant channel flags to take the lock while doing so

Revision 1.283.2.12 / (download) - annotate - [select for diffs], Sat Aug 12 13:41:46 2017 UTC (6 years, 8 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.283.2.11: +2 -3 lines
Diff to previous 1.283.2.11 (colored) to branchpoint 1.283 (colored) to selected 1.30 (colored)

remove debug printf

Revision 1.283.2.11 / (download) - annotate - [select for diffs], Sat Aug 12 09:52:28 2017 UTC (6 years, 8 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.283.2.10: +75 -72 lines
Diff to previous 1.283.2.10 (colored) to branchpoint 1.283 (colored) to selected 1.30 (colored)

remove all logic around ATACH_IRQ_WAIT and channel-global ch_error/ch_status,
so that there is less hidden state shared by commands; primary intent is
to make the NCQ and non-NCQ paths more similar, and remove possibility
of incorrect handling for the NCQ commands

tested both disk and ATAPI - piixide(4) on QEMU, and siisata(4),
ahcisata(4), mvsata(4) on real hw

Revision 1.283.2.10 / (download) - annotate - [select for diffs], Tue Jun 27 18:36:04 2017 UTC (6 years, 9 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.283.2.9: +20 -10 lines
Diff to previous 1.283.2.9 (colored) to branchpoint 1.283 (colored) to selected 1.30 (colored)

attend error paths, more strict asserts and code consistency

- atastart() and ata_kill_pending() now KASSERT() that all xfers on queue
  have same channel
- inactive xfers are killed via new reason KILL_GONE_INACTIVE, controller
  code must not call any resource deactivation in that case
- c_intr() must call ata_waitdrain_xfer_check() as first thing, and must not
  further touch any xfer structures on exit path; any resource cleanup
  is supposed to be done in c_kill_xfer()
- c_kill_xfer() should never call atastart()
- ata_waitdrain_check() removed, replaced by ata_waitdrain_xfer_check()
- ATA_DRIVE_WAITDRAIN handling converted to use condvar
- removed unused ata_c callback

Revision 1.283.2.9 / (download) - annotate - [select for diffs], Wed Jun 21 19:38:43 2017 UTC (6 years, 9 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.283.2.8: +6 -6 lines
Diff to previous 1.283.2.8 (colored) to branchpoint 1.283 (colored) to selected 1.30 (colored)

change ata_queue_hwslot_to_xfer() and ata_queue_get_active_xfer() to take
ata_channel instead of ata_queue as parameter, and lock the channel while
traversing the queue

Revision 1.283.2.8 / (download) - annotate - [select for diffs], Wed Jun 21 19:21:25 2017 UTC (6 years, 9 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.283.2.7: +2 -3 lines
Diff to previous 1.283.2.7 (colored) to branchpoint 1.283 (colored) to selected 1.30 (colored)

actually remove the KASSERT() for queue_active in wdc.c as it's superfluous,
and make struct ata_queue completly opaque to attachment code; fix two other
places which were not converted to ata_queue_alloc() which were surfaced
by this change

Revision 1.283.2.7 / (download) - annotate - [select for diffs], Tue Jun 20 20:58:22 2017 UTC (6 years, 10 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.283.2.6: +11 -15 lines
Diff to previous 1.283.2.6 (colored) to branchpoint 1.283 (colored) to selected 1.30 (colored)

remove ata queue downsizing - every device, attached to the same channel,
uses slots according to it's own limits

wdc code changed to expect maximum one active xfer, and not check number
of openings in the channel; this is to facilitate using wdc functions
for e.g. handling of atapi commands  for drivers which support both ATAPI
and NCQ

Revision 1.283.2.6 / (download) - annotate - [select for diffs], Mon Jun 19 21:00:00 2017 UTC (6 years, 10 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.283.2.5: +3 -2 lines
Diff to previous 1.283.2.5 (colored) to branchpoint 1.283 (colored) to selected 1.30 (colored)

add ata_channel lock, use it to protect queue manipulation (only that for now);
add ata_channel_detach() to destroy the locks

change ata_get_xfer() so that it can wait for xfer, convert all on-stack
xfer code to use the blocking variant

fix siisata_reset_drive() to use polled reset and not try ata_activate_xfer(),
convert drive probe code also over from slot0 XXX to ata_get_xfer()

drive reset and PMP now works on siisata(4) too; changes tested also
on piixide(4), ahci(4), mvsata(4)

Revision 1.283.2.5 / (download) - annotate - [select for diffs], Fri Jun 16 20:40:49 2017 UTC (6 years, 10 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.283.2.4: +27 -53 lines
Diff to previous 1.283.2.4 (colored) to branchpoint 1.283 (colored) to selected 1.30 (colored)

adjust reset channel and dump paths
- channel reset now always kills active transfer, even on dump path, but
  now doesn't touch the queued waiting transfers; also kill_xfer hook is
  always called, so that HBA can free any private xfer resources and thus
  the dump request has chance to work
- kill_xfer routines now always call ata_deactivate_xfer(); added KASSERT()s
  to ata_free_xfer() to expect deactivated xfer
- when called during channel reset before dump, ata_kill_active() drops
  any queued waiting transfers without processing
- do not (re)queue any transfers in wddone() when dumping
- kill AT_RST_NOCMD flag

This should also hopefully fix the 'polled command has been queued' panic
as reported in:
PR kern/11811 by John Hawkinson
PR kern/47041 by Taylor R Campbell
PR kern/51979 by Martin Husemann

dump tested working with piixide(4) and ahci(4). mvsata(4) dump times out,
but otherwise tested working, will be fixed separately. siisata(4) mechanically
changed and not tested.

Revision 1.281.2.1 / (download) - annotate - [select for diffs], Wed Apr 26 02:53:11 2017 UTC (6 years, 11 months ago) by pgoyette
Branch: pgoyette-localcount
Changes since 1.281: +3 -3 lines
Diff to previous 1.281 (colored) next main 1.282 (colored) to selected 1.30 (colored)

Sync with HEAD

Revision 1.282.2.1 / (download) - annotate - [select for diffs], Fri Apr 21 16:53:46 2017 UTC (6 years, 11 months ago) by bouyer
Branch: bouyer-socketcan
Changes since 1.282: +3 -3 lines
Diff to previous 1.282 (colored) next main 1.283 (colored) to selected 1.30 (colored)

Sync with HEAD

Revision 1.283.2.4 / (download) - annotate - [select for diffs], Wed Apr 19 20:49:17 2017 UTC (7 years ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.283.2.3: +9 -9 lines
Diff to previous 1.283.2.3 (colored) to branchpoint 1.283 (colored) to selected 1.30 (colored)

adjust ata code to support more than one active command, including the
timeout handling, add support for NCQ commands

move probe for NCQ and number of tags to middle layer, negotiate mutual
support between drive and controller

implement NCQ support in ahci(4)

Revision 1.283.2.3 / (download) - annotate - [select for diffs], Sat Apr 15 17:14:11 2017 UTC (7 years ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.283.2.2: +9 -16 lines
Diff to previous 1.283.2.2 (colored) to branchpoint 1.283 (colored) to selected 1.30 (colored)

pass also ata_command via ata_xfer, callers of ata_exec_command() is now
responsible for allocation/disposal of the structure

change code to allocate ata_xfer for commands on stack same way as previously
the ata_command were, using c_slot 0; adjust asserts so that it would allow
several xfers with same c_slot, as long as only one such transfer is active
at a time

Revision 1.283.2.2 / (download) - annotate - [select for diffs], Sat Apr 15 12:01:23 2017 UTC (7 years ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.283.2.1: +3 -4 lines
Diff to previous 1.283.2.1 (colored) to branchpoint 1.283 (colored) to selected 1.30 (colored)

make ata_xfer's allocated as part of ata_queue and make it include ata_bio;
they are pre-allocated on attach and ata_get_xfer() now never sleep, drop the
pool

modify wd(4) to file the bio requests using the xfers and hence
make it possible to have more than one active I/O request in flight;
ata_bio callback doesn't need to allocate any memory any more,
require it to never return ATACMD_TRY_AGAIN

move lp, badsect, multi from ata_bio to ata_drive_datas, as they are per-drive,
not per transfer

drop unused drv atac_claim_hw/atac_free_hw hooks, and also drop again ata_bio
c_hwslot

Revision 1.283.2.1 / (download) - annotate - [select for diffs], Mon Apr 10 22:57:02 2017 UTC (7 years ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.283: +18 -17 lines
Diff to previous 1.283 (colored) to selected 1.30 (colored)

ATA infrastructure improvements to eventually support more outstanding
commands

patch by Matt Thomas

Revision 1.283 / (download) - annotate - [select for diffs], Wed Mar 29 09:04:35 2017 UTC (7 years ago) by msaitoh
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, jdolecek-ncq-base, bouyer-socketcan-base1
Branch point for: jdolecek-ncq
Changes since 1.282: +3 -3 lines
Diff to previous 1.282 (colored) to selected 1.30 (colored)

 Fix 0x%d and 0x%u.

Revision 1.279.6.3 / (download) - annotate - [select for diffs], Wed Oct 5 20:55:41 2016 UTC (7 years, 6 months ago) by skrll
Branch: nick-nhusb
Changes since 1.279.6.2: +20 -20 lines
Diff to previous 1.279.6.2 (colored) to branchpoint 1.279 (colored) to selected 1.30 (colored)

Sync with HEAD

Revision 1.282 / (download) - annotate - [select for diffs], Wed Aug 17 22:03:02 2016 UTC (7 years, 8 months ago) by skrll
Branch: MAIN
CVS Tags: pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, nick-nhusb-base-20170204, nick-nhusb-base-20161204, nick-nhusb-base-20161004, localcount-20160914, bouyer-socketcan-base
Branch point for: bouyer-socketcan
Changes since 1.281: +3 -3 lines
Diff to previous 1.281 (colored) to selected 1.30 (colored)

Spelling in comment

Revision 1.279.6.2 / (download) - annotate - [select for diffs], Sun May 29 08:44:21 2016 UTC (7 years, 10 months ago) by skrll
Branch: nick-nhusb
Changes since 1.279.6.1: +13 -17 lines
Diff to previous 1.279.6.1 (colored) to branchpoint 1.279 (colored) to selected 1.30 (colored)

Sync with HEAD

Revision 1.281 / (download) - annotate - [select for diffs], Fri May 6 04:46:17 2016 UTC (7 years, 11 months ago) by msaitoh
Branch: MAIN
CVS Tags: pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20160907, nick-nhusb-base-20160529
Branch point for: pgoyette-localcount
Changes since 1.280: +13 -17 lines
Diff to previous 1.280 (colored) to selected 1.30 (colored)

KNF. No functional change.

Revision 1.279.6.1 / (download) - annotate - [select for diffs], Sat Mar 19 11:30:09 2016 UTC (8 years, 1 month ago) by skrll
Branch: nick-nhusb
Changes since 1.279: +16 -30 lines
Diff to previous 1.279 (colored) to selected 1.30 (colored)

Sync with HEAD

Revision 1.280 / (download) - annotate - [select for diffs], Mon Jan 18 04:46:47 2016 UTC (8 years, 3 months ago) by msaitoh
Branch: MAIN
CVS Tags: nick-nhusb-base-20160422, nick-nhusb-base-20160319
Changes since 1.279: +16 -30 lines
Diff to previous 1.279 (colored) to selected 1.30 (colored)

 Fix a bug that wdcprobe1() accesses NULL pointer when the DEBUG_PROBE bit
is set in atadebug_mask variable. The caller passes data which has
temporary-generated wdc_softc in it, but the device_t has not initialized
because it's not determined yet. So it can't use device_xname(). Use
__function__ instead.

Revision 1.274.2.3 / (download) - annotate - [select for diffs], Wed Aug 20 00:03:38 2014 UTC (9 years, 8 months ago) by tls
Branch: tls-maxphys
Changes since 1.274.2.2: +2 -2 lines
Diff to previous 1.274.2.2 (colored) to branchpoint 1.274 (colored) to selected 1.30 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.265.2.5 / (download) - annotate - [select for diffs], Thu May 22 11:40:22 2014 UTC (9 years, 11 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.265.2.4: +15 -11 lines
Diff to previous 1.265.2.4 (colored) to branchpoint 1.265 (colored) next main 1.266 (colored) to selected 1.30 (colored)

sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.278.4.1 / (download) - annotate - [select for diffs], Sun May 18 17:45:38 2014 UTC (9 years, 11 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.278: +4 -4 lines
Diff to previous 1.278 (colored) next main 1.279 (colored) to selected 1.30 (colored)

sync with head

Revision 1.279 / (download) - annotate - [select for diffs], Sun Sep 15 16:08:28 2013 UTC (10 years, 7 months ago) by martin
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, nick-nhusb-base-20151226, nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7
Branch point for: nick-nhusb
Changes since 1.278: +4 -4 lines
Diff to previous 1.278 (colored) to selected 1.30 (colored)

Mark potentially unused variables

Revision 1.274.2.2 / (download) - annotate - [select for diffs], Sun Jun 23 06:20:17 2013 UTC (10 years, 9 months ago) by tls
Branch: tls-maxphys
Changes since 1.274.2.1: +3 -3 lines
Diff to previous 1.274.2.1 (colored) to branchpoint 1.274 (colored) to selected 1.30 (colored)

resync from head

Revision 1.278 / (download) - annotate - [select for diffs], Wed Apr 3 17:15:07 2013 UTC (11 years ago) by bouyer
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, khorben-n900
Branch point for: rmind-smpnet
Changes since 1.277: +3 -3 lines
Diff to previous 1.277 (colored) to selected 1.30 (colored)

Fix kernel dump on ahci controller, by making sure we won't sleep
while dumping:
- introduce ata_delay() which either use delay() or kpause()
  depending on flags. use it in sata_reset_interface() and
  some ahci functions
- kill ATA_NOSLEEP, it was tested but never set. use ATA_POLL instead.
- reduce delay while polling in ahci, to speed up the dump

Should fix PR kern/41095

Revision 1.274.2.1 / (download) - annotate - [select for diffs], Mon Feb 25 00:29:15 2013 UTC (11 years, 1 month ago) by tls
Branch: tls-maxphys
Changes since 1.274: +56 -33 lines
Diff to previous 1.274 (colored) to selected 1.30 (colored)

resync with head

Revision 1.277 / (download) - annotate - [select for diffs], Sun Feb 3 20:13:28 2013 UTC (11 years, 2 months ago) by jakllsch
Branch: MAIN
CVS Tags: agc-symver-base, agc-symver
Changes since 1.276: +12 -8 lines
Diff to previous 1.276 (colored) to selected 1.30 (colored)

Add argument to wdccommandext() to allow the entire contents of the
device/head register to be specified.  Needed for upcoming port multipler
support in mvsata(4).

Revision 1.265.2.4 / (download) - annotate - [select for diffs], Wed Jan 23 00:06:07 2013 UTC (11 years, 2 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.265.2.3: +3 -2 lines
Diff to previous 1.265.2.3 (colored) to branchpoint 1.265 (colored) to selected 1.30 (colored)

sync with head

Revision 1.265.2.3 / (download) - annotate - [select for diffs], Wed Jan 16 05:33:15 2013 UTC (11 years, 3 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.265.2.2: +45 -27 lines
Diff to previous 1.265.2.2 (colored) to branchpoint 1.265 (colored) to selected 1.30 (colored)

sync with (a bit old) head

Revision 1.276 / (download) - annotate - [select for diffs], Wed Dec 19 14:05:29 2012 UTC (11 years, 4 months ago) by kiyohara
Branch: MAIN
CVS Tags: yamt-pagecache-base8
Changes since 1.275: +3 -2 lines
Diff to previous 1.275 (colored) to selected 1.30 (colored)

Restore spl before continue.

Revision 1.275 / (download) - annotate - [select for diffs], Mon Nov 19 22:22:56 2012 UTC (11 years, 5 months ago) by rkujawa
Branch: MAIN
CVS Tags: yamt-pagecache-base7
Changes since 1.274: +45 -27 lines
Diff to previous 1.274 (colored) to selected 1.30 (colored)

Introduce WDC_CAPABILITY_NO_AUXCTL flag. For lame controllers that don't
have aux control registers (driver coming soon).

Revision 1.265.2.2 / (download) - annotate - [select for diffs], Tue Oct 30 17:21:11 2012 UTC (11 years, 5 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.265.2.1: +86 -77 lines
Diff to previous 1.265.2.1 (colored) to branchpoint 1.265 (colored) to selected 1.30 (colored)

sync with head

Revision 1.274 / (download) - annotate - [select for diffs], Tue Jul 31 15:50:34 2012 UTC (11 years, 8 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-pagecache-base6
Branch point for: tls-maxphys
Changes since 1.273: +77 -75 lines
Diff to previous 1.273 (colored) to selected 1.30 (colored)

Apply back changes that were reverted on Jul 24 and Jul 26 (general ata/wdc
cleanup and SATA PMP support), now that I'm back to fix the fallouts.

Revision 1.273 / (download) - annotate - [select for diffs], Sun Jul 29 18:20:13 2012 UTC (11 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.272: +13 -6 lines
Diff to previous 1.272 (colored) to selected 1.30 (colored)

PR/46599: Onno van der Linden: Don't call bus space commands with 0 len.
Causes the sil 3112 controller to lock up.

Revision 1.272 / (download) - annotate - [select for diffs], Thu Jul 26 20:49:48 2012 UTC (11 years, 8 months ago) by jakllsch
Branch: MAIN
Changes since 1.271: +57 -59 lines
Diff to previous 1.271 (colored) to selected 1.30 (colored)

Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@

Revision 1.271 / (download) - annotate - [select for diffs], Tue Jul 24 14:04:30 2012 UTC (11 years, 8 months ago) by jakllsch
Branch: MAIN
Changes since 1.270: +41 -41 lines
Diff to previous 1.270 (colored) to selected 1.30 (colored)

Revert dsl@'s changes of Sun, 15 Jul 2012 10:55:35 +0000 and
Sun, 15 Jul 2012 10:56:50 +0000, excepting the kernel version bump.
First step in reverting regressions to ata(4) subsystem during the addition of
port multiplier support.

Revision 1.270 / (download) - annotate - [select for diffs], Sun Jul 15 10:55:30 2012 UTC (11 years, 9 months ago) by dsl
Branch: MAIN
Changes since 1.269: +43 -43 lines
Diff to previous 1.269 (colored) to selected 1.30 (colored)

Some namespace protection (and add greppablity).
Prefix the DRIVE_ and DRIVET_ constants from atavar.h with ATA_.
Don't use an enum for drive_type - you don't know how big it will be.
Move driver_type to avoid implicit structure padding (esp on arm).
This change is purely lexical and mechanical.

Update to 6.99.9 - this wasn't done when the SATA PMP changes
were made - I'm sure they warranted a bump.

Revision 1.269 / (download) - annotate - [select for diffs], Mon Jul 2 18:15:47 2012 UTC (11 years, 9 months ago) by bouyer
Branch: MAIN
Changes since 1.268: +59 -57 lines
Diff to previous 1.268 (colored) to selected 1.30 (colored)

Add sata Port MultiPlier (PMP) support to the ata bus layer,
as described in
http://mail-index.netbsd.org/tech-kern/2012/06/23/msg013442.html
PMP support in integrated to the atabus layer.
struct ata_channel's ch_drive[] is not dynamically allocated, and ch_ndrive
(renamed to ch_ndrives) closely reflects the size of the ch_drive[] array.
Add helper functions atabus_alloc_drives() and atabus_free_drives()
to manage ch_drive[]/ch_ndrives.
Add wdc_maxdrives to struct wdc_softc so that bus front-end can specify
how much drive they really support (master/slave or single).
ata_reset_drive() callback gains a uint32_t *sigp argument which,
when not NULL, will contain the signature of the device being reset.
While there, some cosmetic changes:
- added a drive_type enum to ata_drive_datas, and stop encoding the
  probed drive type in drive_flags (we were out of drive flags anyway).
- rename DRIVE_ATAPIST to DRIVE_ATAPIDSCW to better reflect what this
  really is
- remove ata_channel->ata_drives, it's redundant with the pointer in
  ata_drive_datas
- factor out the interpretation of SATA signatures in sata_interpet_sig()

propagate these changes to the ATA HBA drivers, and add support for PMP
to ahcisata(4) and siisata(4).

Thanks to:
- Protocase (http://www.protocase.com/) which provided a system
  with lots of controllers, SATA PMP and drive slots
- Conservation Genomics Laboratory, Department of Biology, New Mexico State
  University for hosting the above system
- Brook Milligan, who set up remote access and has been very responsive
  when SATA cable move was needed

Revision 1.265.2.1 / (download) - annotate - [select for diffs], Tue Apr 17 00:07:37 2012 UTC (12 years ago) by yamt
Branch: yamt-pagecache
Changes since 1.265: +75 -34 lines
Diff to previous 1.265 (colored) to selected 1.30 (colored)

sync with head

Revision 1.265.6.1 / (download) - annotate - [select for diffs], Sat Feb 18 07:34:26 2012 UTC (12 years, 2 months ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.265: +75 -34 lines
Diff to previous 1.265 (colored) next main 1.266 (colored) to selected 1.30 (colored)

merge to -current.

Revision 1.268 / (download) - annotate - [select for diffs], Tue Jan 24 20:04:08 2012 UTC (12 years, 2 months ago) by jakllsch
Branch: MAIN
CVS Tags: yamt-pagecache-base5, yamt-pagecache-base4, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10
Changes since 1.267: +59 -18 lines
Diff to previous 1.267 (colored) to selected 1.30 (colored)

Rework struct ata_command to support LBA28 and LBA48-protocol commands.
Implement 28- and 48-bit command issuance and parameter read-back in the
various ATA host drivers. Add LBA28-protocol support to ATAIOCCOMMAND ioctl.

Revision 1.267 / (download) - annotate - [select for diffs], Mon Jan 9 01:01:49 2012 UTC (12 years, 3 months ago) by jakllsch
Branch: MAIN
Changes since 1.266: +13 -13 lines
Diff to previous 1.266 (colored) to selected 1.30 (colored)

Instead of assume that 'features' is 0 in wdccommandext(),
pass it as an argument, as is done for wdccommand().

Revision 1.266 / (download) - annotate - [select for diffs], Sun Dec 4 19:48:36 2011 UTC (12 years, 4 months ago) by jakllsch
Branch: MAIN
Changes since 1.265: +7 -7 lines
Diff to previous 1.265 (colored) to selected 1.30 (colored)

correct some typos in comments, whitespace adjustments

Revision 1.265 / (download) - annotate - [select for diffs], Sun Aug 28 10:21:41 2011 UTC (12 years, 7 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache, jmcneill-usbmp
Changes since 1.264: +7 -9 lines
Diff to previous 1.264 (colored) to selected 1.30 (colored)

Revert previous and fix properly by just removing the #error and a bogus
KASSERT() (these 2 are leftover from the experiments on the fuloong
and were not intended to be commited).

Revision 1.264 / (download) - annotate - [select for diffs], Sun Aug 28 09:32:21 2011 UTC (12 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.263: +11 -11 lines
Diff to previous 1.263 (colored) to selected 1.30 (colored)

Make this compile again without WDC_NO_IDS.

Revision 1.263 / (download) - annotate - [select for diffs], Sat Aug 27 17:05:58 2011 UTC (12 years, 7 months ago) by bouyer
Branch: MAIN
Changes since 1.262: +52 -18 lines
Diff to previous 1.262 (colored) to selected 1.30 (colored)

The loongon2f+cs5526+jmicron PATA->SATA bridge cause an interresting issue:
1) because the CS5536 is not associated with a x86 CPU, interrupts are not
  ack'ed as it expects so interrupts cannot configured as edge-triggered
  (as is expected for a PCIIDE in compat mode)
2) the PATA->SATA bridge ignores the WDC_IDS (interrupt disable bit) so
  the PATA IRQ line gets asserted when resetting or running some polled
  commands. It also wrongly asserts IRQ when the (nonexistent) slave
  device is selected
2) wouldn't be an issue with edge-triggered interrupt because we would
   get a spurious interrupt and continue operation, a new interrupt only shows
   up when the PATA IRQ line goes low and high again. But because of 1),
   we get an unclearable interrupt instead, and the system loops on the
   interrupt handler.

To workaround this, introduce a WDC_NO_IDS compile option which runs
all polled commands (including reset) at splbio() and without sleeps,
so that the controller's interrupt is effectively disabled and
won't be reenabled before the interrupt can be cleared.

The conditions triggering this problem are speficic enough to handle
this via a compile-time option; no need for a run-time (e.g. a
config(9), device property or callback to disable interrupts) solution.

Revision 1.262 / (download) - annotate - [select for diffs], Sat Aug 13 16:02:48 2011 UTC (12 years, 8 months ago) by jakllsch
Branch: MAIN
Changes since 1.261: +4 -2 lines
Diff to previous 1.261 (colored) to selected 1.30 (colored)

It's hard to get a backtrace after calling a NULL function pointer,
add KASSERT before calling.

Revision 1.253.4.4 / (download) - annotate - [select for diffs], Wed Aug 11 22:53:33 2010 UTC (13 years, 8 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.253.4.3: +3 -3 lines
Diff to previous 1.253.4.3 (colored) to branchpoint 1.253 (colored) next main 1.254 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.260.4.1 / (download) - annotate - [select for diffs], Sun May 30 05:17:26 2010 UTC (13 years, 10 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.260: +3 -3 lines
Diff to previous 1.260 (colored) next main 1.261 (colored) to selected 1.30 (colored)

sync with head

Revision 1.260.2.1 / (download) - annotate - [select for diffs], Fri Apr 30 14:43:23 2010 UTC (13 years, 11 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.260: +3 -3 lines
Diff to previous 1.260 (colored) next main 1.261 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.255.4.1.4.1 / (download) - annotate - [select for diffs], Wed Apr 21 00:27:38 2010 UTC (14 years ago) by matt
Branch: matt-nb5-mips64
CVS Tags: matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-k15
Changes since 1.255.4.1: +24 -13 lines
Diff to previous 1.255.4.1 (colored) next main 1.255.4.2 (colored) to selected 1.30 (colored)

sync to netbsd-5

Revision 1.261 / (download) - annotate - [select for diffs], Sun Mar 28 20:46:18 2010 UTC (14 years ago) by snj
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, uebayasi-xip-base1, rmind-uvmplock-nbase, rmind-uvmplock-base, matt-mips64-premerge-20101231, jruoho-x86intr-base, jruoho-x86intr, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Changes since 1.260: +3 -3 lines
Diff to previous 1.260 (colored) to selected 1.30 (colored)

Spell "enough" properly.

Revision 1.253.4.3 / (download) - annotate - [select for diffs], Thu Mar 11 15:03:36 2010 UTC (14 years, 1 month ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.253.4.2: +24 -46 lines
Diff to previous 1.253.4.2 (colored) to branchpoint 1.253 (colored) to selected 1.30 (colored)

sync with head

Revision 1.260 / (download) - annotate - [select for diffs], Thu Nov 12 19:37:17 2009 UTC (14 years, 5 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9, uebayasi-xip-base, matt-premerge-20091211
Branch point for: uebayasi-xip, rmind-uvmplock
Changes since 1.259: +2 -30 lines
Diff to previous 1.259 (colored) to selected 1.30 (colored)

Remove superfluous activation hook.

Revision 1.259 / (download) - annotate - [select for diffs], Mon Oct 19 18:41:13 2009 UTC (14 years, 6 months ago) by bouyer
Branch: MAIN
CVS Tags: jym-xensuspend-nbase
Changes since 1.258: +2 -7 lines
Diff to previous 1.258 (colored) to selected 1.30 (colored)

Remove closes 3 & 4 from my licence. Lots of thanks to Soren Jacobsen
for the booring work !

Revision 1.255.4.2 / (download) - annotate - [select for diffs], Sun Oct 18 16:39:13 2009 UTC (14 years, 6 months ago) by bouyer
Branch: netbsd-5
CVS Tags: netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, matt-nb5-pq3-base, matt-nb5-pq3
Changes since 1.255.4.1: +24 -13 lines
Diff to previous 1.255.4.1 (colored) to branchpoint 1.255 (colored) next main 1.256 (colored) to selected 1.30 (colored)

Pull up following revision(s) (requested by sborrill in ticket #1074):
	sys/dev/ic/wdc.c: revision 1.258
Commit patch from PR#41926. Confirmed to work by PR submitter on two
controllers as well myself and another on viaide.
Stops errors such as the following when probing SATA drives through
controllers that offer the legacy pciide interface:
viaide1 channel 0: reset failed for drive 0
OK bouyer@

Revision 1.258 / (download) - annotate - [select for diffs], Tue Oct 6 13:45:01 2009 UTC (14 years, 6 months ago) by sborrill
Branch: MAIN
Changes since 1.257: +24 -13 lines
Diff to previous 1.257 (colored) to selected 1.30 (colored)

Commit patch from PR#41926. Confirmed to work by PR submitter on two
controllers as well myself and another on viaide.

Stops errors such as the following when probing SATA drives through
controllers that offer the legacy pciide interface:
viaide1 channel 0: reset failed for drive 0

OK bouyer@

Revision 1.253.4.2 / (download) - annotate - [select for diffs], Mon May 4 08:12:45 2009 UTC (14 years, 11 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.253.4.1: +3 -3 lines
Diff to previous 1.253.4.1 (colored) to branchpoint 1.253 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.255.2.1 / (download) - annotate - [select for diffs], Mon Jan 19 13:17:56 2009 UTC (15 years, 3 months ago) by skrll
Branch: nick-hppapmap
Changes since 1.255: +6 -6 lines
Diff to previous 1.255 (colored) next main 1.256 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.252.6.4 / (download) - annotate - [select for diffs], Sat Jan 17 13:28:56 2009 UTC (15 years, 3 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.252.6.3: +4 -4 lines
Diff to previous 1.252.6.3 (colored) to branchpoint 1.252 (colored) next main 1.253 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.254.6.2 / (download) - annotate - [select for diffs], Sat Dec 13 01:14:15 2008 UTC (15 years, 4 months ago) by haad
Branch: haad-dm
Changes since 1.254.6.1: +6 -6 lines
Diff to previous 1.254.6.1 (colored) to branchpoint 1.254 (colored) next main 1.255 (colored) to selected 1.30 (colored)

Update haad-dm branch to haad-dm-base2.

Revision 1.257 / (download) - annotate - [select for diffs], Mon Dec 8 11:23:39 2008 UTC (15 years, 4 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base2, nick-hppapmap-base, mjf-devfs2-base, jymxensuspend-base, jym-xensuspend-base, jym-xensuspend, haad-nbase2, haad-dm-base2, haad-dm-base
Changes since 1.256: +3 -3 lines
Diff to previous 1.256 (colored) to selected 1.30 (colored)

Warn about large struct on stack in comment.

Revision 1.255.4.1 / (download) - annotate - [select for diffs], Thu Nov 20 02:45:36 2008 UTC (15 years, 5 months ago) by snj
Branch: netbsd-5
CVS Tags: netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20091211, matt-nb4-mips64-k7-u2a-k9b
Branch point for: matt-nb5-mips64
Changes since 1.255: +5 -5 lines
Diff to previous 1.255 (colored) to selected 1.30 (colored)

Pull up following revision(s) (requested by bouyer in ticket #67):
	sys/dev/ic/wdc.c: revision 1.256
	sys/dev/ata/ata.c: revision 1.102
	sys/dev/scsipi/atapi_wdc.c: revision 1.109
	sys/dev/ata/atavar.h: revision 1.78
	sys/dev/ata/ata_wdc.c: revision 1.91
cpu_intr_p() doesn't account for software interrupts (e.g. callouts) so
we can't use it here. Rssurect ATACH_TH_RUN, backing out
src/sys/dev/ata/ata.c 1.101
src/sys/dev/ata/ata_wdc.c 1.90
src/sys/dev/ata/atavar.h 1.77
src/sys/dev/ic/wdc.c 1.255
src/sys/dev/scsipi/atapi_wdc.c 1.108
Should fix kern/39927 and kern/39725.

Revision 1.256 / (download) - annotate - [select for diffs], Sun Nov 16 19:31:21 2008 UTC (15 years, 5 months ago) by bouyer
Branch: MAIN
CVS Tags: ad-audiomp2-base, ad-audiomp2
Changes since 1.255: +3 -3 lines
Diff to previous 1.255 (colored) to selected 1.30 (colored)

cpu_intr_p() doesn't account for software interrupts (e.g. callouts) so
we can't use it here. Rssurect ATACH_TH_RUN, backing out
src/sys/dev/ata/ata.c 1.101
src/sys/dev/ata/ata_wdc.c 1.90
src/sys/dev/ata/atavar.h 1.77
src/sys/dev/ic/wdc.c 1.255
src/sys/dev/scsipi/atapi_wdc.c 1.108
Should fix kern/39927 and kern/39725.

Revision 1.254.6.1 / (download) - annotate - [select for diffs], Sun Oct 19 22:16:27 2008 UTC (15 years, 6 months ago) by haad
Branch: haad-dm
Changes since 1.254: +5 -5 lines
Diff to previous 1.254 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.254.2.1 / (download) - annotate - [select for diffs], Fri Oct 10 22:30:58 2008 UTC (15 years, 6 months ago) by skrll
Branch: wrstuden-revivesa
Changes since 1.254: +5 -5 lines
Diff to previous 1.254 (colored) next main 1.255 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.252.6.3 / (download) - annotate - [select for diffs], Sun Oct 5 20:11:29 2008 UTC (15 years, 6 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.252.6.2: +3 -3 lines
Diff to previous 1.252.6.2 (colored) to branchpoint 1.252 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.255 / (download) - annotate - [select for diffs], Thu Oct 2 21:05:17 2008 UTC (15 years, 6 months ago) by bouyer
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4, netbsd-5-base, matt-mips64-base2, haad-dm-base1
Branch point for: nick-hppapmap, netbsd-5
Changes since 1.254: +5 -5 lines
Diff to previous 1.254 (colored) to selected 1.30 (colored)

Kill ATACH_TH_RUN and use cpu_intr_p() instead.

Revision 1.252.6.2 / (download) - annotate - [select for diffs], Mon Jun 2 13:23:28 2008 UTC (15 years, 10 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.252.6.1: +0 -7 lines
Diff to previous 1.252.6.1 (colored) to branchpoint 1.252 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.253.2.1 / (download) - annotate - [select for diffs], Sun May 18 12:33:46 2008 UTC (15 years, 11 months ago) by yamt
Branch: yamt-pf42
Changes since 1.253: +2 -9 lines
Diff to previous 1.253 (colored) next main 1.254 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.253.4.1 / (download) - annotate - [select for diffs], Fri May 16 02:24:06 2008 UTC (15 years, 11 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.253: +2 -9 lines
Diff to previous 1.253 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.254 / (download) - annotate - [select for diffs], Mon Apr 28 20:23:51 2008 UTC (15 years, 11 months ago) by martin
Branch: MAIN
CVS Tags: yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-nfs-mp-base2, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, simonb-wapbl-nbase, simonb-wapbl-base, simonb-wapbl, hpcarm-cleanup-nbase
Branch point for: wrstuden-revivesa, haad-dm
Changes since 1.253: +2 -9 lines
Diff to previous 1.253 (colored) to selected 1.30 (colored)

Remove clause 3 and 4 from TNF licenses

Revision 1.252.6.1 / (download) - annotate - [select for diffs], Thu Apr 3 12:42:43 2008 UTC (16 years ago) by mjf
Branch: mjf-devfs2
Changes since 1.252: +55 -54 lines
Diff to previous 1.252 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.224.2.8 / (download) - annotate - [select for diffs], Mon Mar 24 09:38:50 2008 UTC (16 years ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.224.2.7: +55 -54 lines
Diff to previous 1.224.2.7 (colored) next main 1.225 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.252.2.1 / (download) - annotate - [select for diffs], Mon Mar 24 07:15:18 2008 UTC (16 years ago) by keiichi
Branch: keiichi-mipv6
Changes since 1.252: +55 -54 lines
Diff to previous 1.252 (colored) next main 1.253 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.248.8.2 / (download) - annotate - [select for diffs], Sun Mar 23 02:04:39 2008 UTC (16 years, 1 month ago) by matt
Branch: matt-armv6
Changes since 1.248.8.1: +87 -70 lines
Diff to previous 1.248.8.1 (colored) to branchpoint 1.248 (colored) next main 1.249 (colored) to selected 1.30 (colored)

sync with HEAD

Revision 1.253 / (download) - annotate - [select for diffs], Tue Mar 18 20:46:36 2008 UTC (16 years, 1 month ago) by cube
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base, yamt-nfs-mp-base, yamt-lazymbuf-base15, yamt-lazymbuf-base14, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, ad-socklock-base1
Branch point for: yamt-pf42, yamt-nfs-mp
Changes since 1.252: +55 -54 lines
Diff to previous 1.252 (colored) to selected 1.30 (colored)

Split device_t and softc for ATA devices, as well as wd(4).  Other
cosmetic changes where appropriate.

Revision 1.249.2.1 / (download) - annotate - [select for diffs], Mon Feb 18 21:05:41 2008 UTC (16 years, 2 months ago) by mjf
Branch: mjf-devfs
Changes since 1.249: +34 -18 lines
Diff to previous 1.249 (colored) next main 1.250 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.224.2.7 / (download) - annotate - [select for diffs], Mon Feb 4 09:23:25 2008 UTC (16 years, 2 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.224.2.6: +4 -8 lines
Diff to previous 1.224.2.6 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.252 / (download) - annotate - [select for diffs], Mon Jan 28 18:17:05 2008 UTC (16 years, 2 months ago) by dyoung
Branch: MAIN
CVS Tags: nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, hpcarm-cleanup-base
Branch point for: mjf-devfs2, keiichi-mipv6
Changes since 1.251: +4 -8 lines
Diff to previous 1.251 (colored) to selected 1.30 (colored)

If something still holds a reference to our scsipi_adapter, do not
warn and complete the detachment, but return EBUSY.

Revision 1.224.2.6 / (download) - annotate - [select for diffs], Mon Jan 21 09:43:11 2008 UTC (16 years, 3 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.224.2.5: +32 -12 lines
Diff to previous 1.224.2.5 (colored) to selected 1.30 (colored)

sync with head

Revision 1.249.8.2 / (download) - annotate - [select for diffs], Sun Jan 20 17:51:34 2008 UTC (16 years, 3 months ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.249.8.1: +3 -4 lines
Diff to previous 1.249.8.1 (colored) to branchpoint 1.249 (colored) next main 1.250 (colored) to selected 1.30 (colored)

Sync with HEAD

Revision 1.251 / (download) - annotate - [select for diffs], Sat Jan 19 22:22:14 2008 UTC (16 years, 3 months ago) by dyoung
Branch: MAIN
CVS Tags: bouyer-xeni386-nbase, bouyer-xeni386-base
Changes since 1.250: +5 -6 lines
Diff to previous 1.250 (colored) to selected 1.30 (colored)

In wdcdetach(), if config_detach() fails, get out early.

Revision 1.249.8.1 / (download) - annotate - [select for diffs], Thu Jan 10 23:44:16 2008 UTC (16 years, 3 months ago) by bouyer
Branch: bouyer-xeni386
CVS Tags: bouyer-xeni386-merge1
Changes since 1.249: +29 -8 lines
Diff to previous 1.249 (colored) to selected 1.30 (colored)

Sync with HEAD

Revision 1.250 / (download) - annotate - [select for diffs], Thu Jan 10 07:44:07 2008 UTC (16 years, 3 months ago) by dyoung
Branch: MAIN
Changes since 1.249: +29 -8 lines
Diff to previous 1.249 (colored) to selected 1.30 (colored)

Let us detach atabus* from wdc*, and wdc* from isa*.

Use device_t, device_private().

Revision 1.248.8.1 / (download) - annotate - [select for diffs], Tue Nov 6 23:27:18 2007 UTC (16 years, 5 months ago) by matt
Branch: matt-armv6
CVS Tags: matt-armv6-prevmlocking
Changes since 1.248: +4 -4 lines
Diff to previous 1.248 (colored) to selected 1.30 (colored)

sync with HEAD

Revision 1.224.2.5 / (download) - annotate - [select for diffs], Sat Oct 27 11:31:13 2007 UTC (16 years, 5 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.224.2.4: +4 -4 lines
Diff to previous 1.224.2.4 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.248.6.1 / (download) - annotate - [select for diffs], Fri Oct 26 15:45:06 2007 UTC (16 years, 5 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.248: +4 -4 lines
Diff to previous 1.248 (colored) next main 1.249 (colored) to selected 1.30 (colored)

Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.

Revision 1.248.12.1 / (download) - annotate - [select for diffs], Thu Oct 25 22:38:02 2007 UTC (16 years, 5 months ago) by bouyer
Branch: bouyer-xenamd64
Changes since 1.248: +4 -4 lines
Diff to previous 1.248 (colored) next main 1.249 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.246.6.5 / (download) - annotate - [select for diffs], Tue Oct 23 20:07:52 2007 UTC (16 years, 6 months ago) by ad
Branch: vmlocking
Changes since 1.246.6.4: +4 -4 lines
Diff to previous 1.246.6.4 (colored) to branchpoint 1.246 (colored) next main 1.247 (colored) to selected 1.30 (colored)

Sync with head.

Revision 1.249 / (download) - annotate - [select for diffs], Fri Oct 19 12:00:04 2007 UTC (16 years, 6 months ago) by ad
Branch: MAIN
CVS Tags: yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, vmlocking2-base3, vmlocking2-base2, vmlocking2-base1, vmlocking2, vmlocking-nbase, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, matt-armv6-base, jmcneill-pm-base, jmcneill-base, cube-autoconf-base, cube-autoconf, bouyer-xenamd64-base2, bouyer-xenamd64-base
Branch point for: mjf-devfs, bouyer-xeni386
Changes since 1.248: +4 -4 lines
Diff to previous 1.248 (colored) to selected 1.30 (colored)

machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h

Revision 1.246.6.4 / (download) - annotate - [select for diffs], Sun Sep 16 18:27:40 2007 UTC (16 years, 7 months ago) by ad
Branch: vmlocking
Changes since 1.246.6.3: +2 -4 lines
Diff to previous 1.246.6.3 (colored) to branchpoint 1.246 (colored) to selected 1.30 (colored)

Remove debug code that crept in.

Revision 1.224.2.4 / (download) - annotate - [select for diffs], Mon Sep 3 14:35:22 2007 UTC (16 years, 7 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.224.2.3: +33 -43 lines
Diff to previous 1.224.2.3 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.246.6.3 / (download) - annotate - [select for diffs], Sun Aug 19 19:24:27 2007 UTC (16 years, 8 months ago) by ad
Branch: vmlocking
Changes since 1.246.6.2: +4 -2 lines
Diff to previous 1.246.6.2 (colored) to branchpoint 1.246 (colored) to selected 1.30 (colored)

- Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).

Revision 1.246.8.1 / (download) - annotate - [select for diffs], Wed Jul 11 20:06:18 2007 UTC (16 years, 9 months ago) by mjf
Branch: mjf-ufs-trans
Changes since 1.246: +33 -43 lines
Diff to previous 1.246 (colored) next main 1.247 (colored) to selected 1.30 (colored)

Sync with head.

Revision 1.246.6.2 / (download) - annotate - [select for diffs], Sun May 27 14:30:08 2007 UTC (16 years, 10 months ago) by ad
Branch: vmlocking
Changes since 1.246.6.1: +3 -3 lines
Diff to previous 1.246.6.1 (colored) to branchpoint 1.246 (colored) to selected 1.30 (colored)

Sync with head.

Revision 1.246.2.2 / (download) - annotate - [select for diffs], Mon May 7 10:55:27 2007 UTC (16 years, 11 months ago) by yamt
Branch: yamt-idlelwp
Changes since 1.246.2.1: +3 -3 lines
Diff to previous 1.246.2.1 (colored) to branchpoint 1.246 (colored) next main 1.247 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.248 / (download) - annotate - [select for diffs], Mon Apr 16 05:25:36 2007 UTC (17 years ago) by dyoung
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, yamt-idlelwp-base8, vmlocking-base, nick-csl-alignment-base5, nick-csl-alignment-base, nick-csl-alignment, mjf-ufs-trans-base, matt-mips64-base, matt-mips64, hpcarm-cleanup
Branch point for: matt-armv6, jmcneill-pm, bouyer-xenamd64
Changes since 1.247: +3 -3 lines
Diff to previous 1.247 (colored) to selected 1.30 (colored)

Make this compile with or without 'options ATADEBUG'.

Revision 1.246.6.1 / (download) - annotate - [select for diffs], Tue Apr 10 13:24:32 2007 UTC (17 years ago) by ad
Branch: vmlocking
Changes since 1.246: +32 -42 lines
Diff to previous 1.246 (colored) to selected 1.30 (colored)

Sync with head.

Revision 1.246.2.1 / (download) - annotate - [select for diffs], Sat Mar 24 14:55:29 2007 UTC (17 years, 1 month ago) by yamt
Branch: yamt-idlelwp
Changes since 1.246: +32 -42 lines
Diff to previous 1.246 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.246.10.1 / (download) - annotate - [select for diffs], Sun Mar 18 00:06:42 2007 UTC (17 years, 1 month ago) by reinoud
Branch: reinoud-bufcleanup
Changes since 1.246: +32 -42 lines
Diff to previous 1.246 (colored) next main 1.247 (colored) to selected 1.30 (colored)

First attempt to bring branch in sync with HEAD

Revision 1.247 / (download) - annotate - [select for diffs], Sat Mar 17 06:41:35 2007 UTC (17 years, 1 month ago) by dyoung
Branch: MAIN
CVS Tags: thorpej-atomic-base, thorpej-atomic
Changes since 1.246: +32 -42 lines
Diff to previous 1.246 (colored) to selected 1.30 (colored)

Let config(1) know that #define ATADEBUG goes in opt_ata.h.  In
dev/ic/wdc.c and in dev/ata/ata.c, #include "opt_ata.h", and make
both the files compile with or *without* ATADEBUG.  Do not compile
with ATADEBUG by default.

Revision 1.224.2.3 / (download) - annotate - [select for diffs], Mon Feb 26 09:10:13 2007 UTC (17 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.224.2.2: +116 -2 lines
Diff to previous 1.224.2.2 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.237.2.3 / (download) - annotate - [select for diffs], Thu Feb 1 08:48:21 2007 UTC (17 years, 2 months ago) by ad
Branch: newlock2
Changes since 1.237.2.2: +116 -2 lines
Diff to previous 1.237.2.2 (colored) to branchpoint 1.237 (colored) next main 1.238 (colored) to selected 1.30 (colored)

Sync with head.

Revision 1.243.2.3 / (download) - annotate - [select for diffs], Mon Jan 29 22:25:16 2007 UTC (17 years, 2 months ago) by bouyer
Branch: netbsd-4
CVS Tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, matt-nb4-arm-base, matt-nb4-arm
Changes since 1.243.2.2: +4 -0 lines
Diff to previous 1.243.2.2 (colored) to branchpoint 1.243 (colored) next main 1.244 (colored) to selected 1.30 (colored)

Pull up following revision(s) (requested by sborrill in ticket #389):
	sys/dev/ic/wdc.c: revision 1.246
Add missing bus_space_(read,write)_stream macros.
Approved by martin@

Revision 1.246 / (download) - annotate - [select for diffs], Fri Jan 26 16:28:18 2007 UTC (17 years, 2 months ago) by sborrill
Branch: MAIN
CVS Tags: post-newlock2-merge, newlock2-nbase, newlock2-base, ad-audiomp-base, ad-audiomp
Branch point for: yamt-idlelwp, vmlocking, reinoud-bufcleanup, mjf-ufs-trans
Changes since 1.245: +6 -2 lines
Diff to previous 1.245 (colored) to selected 1.30 (colored)

Add missing bus_space_(read,write)_stream macros.
Approved by martin@

Revision 1.243.2.2 / (download) - annotate - [select for diffs], Tue Jan 23 18:35:32 2007 UTC (17 years, 2 months ago) by tron
Branch: netbsd-4
Changes since 1.243.2.1: +76 -30 lines
Diff to previous 1.243.2.1 (colored) to branchpoint 1.243 (colored) to selected 1.30 (colored)

Pull up following revision(s) (requested by bouyer in ticket #380):
	sys/dev/ic/wdc.c: revision 1.245
For the unaligned case:
	Be consistant with the spaces around * and +
	Use data32io[th] for 32bit access
	Use stream bus_space access unless we have DRIVE_NOSTREAM
all pointed out by enami tsugutomo, thanks !

Revision 1.245 / (download) - annotate - [select for diffs], Thu Jan 18 21:42:57 2007 UTC (17 years, 3 months ago) by bouyer
Branch: MAIN
Changes since 1.244: +79 -33 lines
Diff to previous 1.244 (colored) to selected 1.30 (colored)

For the unaligned case:
	Be consistant with the spaces around * and +
	Use data32io[th] for 32bit access
	Use stream bus_space access unless we have DRIVE_NOSTREAM
all pointed out by enami tsugutomo, thanks !

Revision 1.243.2.1 / (download) - annotate - [select for diffs], Mon Jan 15 22:15:13 2007 UTC (17 years, 3 months ago) by pavel
Branch: netbsd-4
Changes since 1.243: +66 -2 lines
Diff to previous 1.243 (colored) to selected 1.30 (colored)

Pull up following revision(s) (requested by martin in ticket #371):
	sys/dev/scsipi/cd.c: revision 1.261
	sys/dev/ic/wdc.c: revision 1.244
If __NO_STRICT_ALIGNMENT is not defined, take special care to do PIO
transfers with proper alignement - this removes alignement restrictions
of the buffer pointer passed.
Thanks to bouyer, reinoud, jdc for helping with the code, and special
thanks to Dave Huang for testing.
The previous fix for PR 34202 was wrong (some sizeof used the union, not
the command block) - but instead of fixing this, we can now revert it
completley: the real fix has been applied to ../ic/wdc.c in rev. 1.244,
removing the alignement constraints.

Revision 1.244 / (download) - annotate - [select for diffs], Sun Jan 14 09:18:39 2007 UTC (17 years, 3 months ago) by martin
Branch: MAIN
Changes since 1.243: +66 -2 lines
Diff to previous 1.243 (colored) to selected 1.30 (colored)

If __NO_STRICT_ALIGNMENT is not defined, take special care to do PIO
transfers with proper alignement - this removes alignement restrictions
of the buffer pointer passed.
Thanks to bouyer, reinoud, jdc for helping with the code, and special
thanks to Dave Huang for testing.

Revision 1.237.2.2 / (download) - annotate - [select for diffs], Fri Jan 12 00:57:36 2007 UTC (17 years, 3 months ago) by ad
Branch: newlock2
Changes since 1.237.2.1: +7 -48 lines
Diff to previous 1.237.2.1 (colored) to branchpoint 1.237 (colored) to selected 1.30 (colored)

Sync with head.

Revision 1.224.2.2 / (download) - annotate - [select for diffs], Sat Dec 30 20:48:04 2006 UTC (17 years, 3 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.224.2.1: +86 -5 lines
Diff to previous 1.224.2.1 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.237.4.2 / (download) - annotate - [select for diffs], Sun Dec 10 07:17:07 2006 UTC (17 years, 4 months ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.237.4.1: +71 -4 lines
Diff to previous 1.237.4.1 (colored) to branchpoint 1.237 (colored) next main 1.238 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.243 / (download) - annotate - [select for diffs], Wed Nov 29 21:37:42 2006 UTC (17 years, 4 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, netbsd-4-base
Branch point for: netbsd-4
Changes since 1.242: +3 -3 lines
Diff to previous 1.242 (colored) to selected 1.30 (colored)

Use mstohz() for callout argument instead of local arithmetic.

Revision 1.242 / (download) - annotate - [select for diffs], Mon Nov 20 23:42:21 2006 UTC (17 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.241: +6 -47 lines
Diff to previous 1.241 (colored) to selected 1.30 (colored)

Move part of wdc_sataprobe() to sys/dev/ata/sata_subr.c so that it can be
shared with non-wdc SATA controllers.

Revision 1.237.2.1 / (download) - annotate - [select for diffs], Sat Nov 18 21:34:15 2006 UTC (17 years, 5 months ago) by ad
Branch: newlock2
Changes since 1.237: +125 -3 lines
Diff to previous 1.237 (colored) to selected 1.30 (colored)

Sync with head.

Revision 1.241 / (download) - annotate - [select for diffs], Tue Nov 14 18:39:10 2006 UTC (17 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.240: +15 -3 lines
Diff to previous 1.240 (colored) to selected 1.30 (colored)

wdc_sataprobe():
- wait up to 1s for SStatus_DET_DEV after SControl_DET_INIT toggle (from
  FreeBSD)
- reset the drive once we know it's there. It may be in some PM state and
  not able to properly reply to IDENTIFY. Tested by Teemu Rinta-aho,
  fixes PR kern/35049 and should also fix PR kern/35008.

Revision 1.240 / (download) - annotate - [select for diffs], Wed Oct 25 20:14:00 2006 UTC (17 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.239: +5 -2 lines
Diff to previous 1.239 (colored) to selected 1.30 (colored)

Exclude wdc_sataprobe() when no SATA controllers are present. Fix
build of *_TINY kernels.

Revision 1.239 / (download) - annotate - [select for diffs], Wed Oct 25 17:33:02 2006 UTC (17 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.238: +96 -3 lines
Diff to previous 1.238 (colored) to selected 1.30 (colored)

Add sata registers to struct wdc_regs. Add wdc_sataprobe(), a function
probing drives using the standard SATA registers; taken from various
PCI sata drivers. Export wdc_drvprobe() too.

Revision 1.237.4.1 / (download) - annotate - [select for diffs], Sun Oct 22 06:05:45 2006 UTC (17 years, 6 months ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.237: +16 -2 lines
Diff to previous 1.237 (colored) to selected 1.30 (colored)

sync with head

Revision 1.238 / (download) - annotate - [select for diffs], Sat Sep 30 15:56:17 2006 UTC (17 years, 6 months ago) by itohy
Branch: MAIN
CVS Tags: yamt-splraiseipl-base2
Changes since 1.237: +16 -2 lines
Diff to previous 1.237 (colored) to selected 1.30 (colored)

A little effort against kernel bloat....
Exclude ATA DMA support if no ATA DMA capable drivers are compiled in.

Revision 1.234.2.1 / (download) - annotate - [select for diffs], Sat Sep 9 02:50:03 2006 UTC (17 years, 7 months ago) by rpaulo
Branch: rpaulo-netinet-merge-pcb
Changes since 1.234: +7 -7 lines
Diff to previous 1.234 (colored) next main 1.235 (colored) to selected 1.30 (colored)

sync with head

Revision 1.235.2.2 / (download) - annotate - [select for diffs], Sun Sep 3 15:23:57 2006 UTC (17 years, 7 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.235.2.1: +3 -3 lines
Diff to previous 1.235.2.1 (colored) to branchpoint 1.235 (colored) next main 1.236 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.237 / (download) - annotate - [select for diffs], Thu Aug 17 17:11:28 2006 UTC (17 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: yamt-splraiseipl-base, yamt-pdpolicy-base9, yamt-pdpolicy-base8, rpaulo-netinet-merge-pcb-base
Branch point for: yamt-splraiseipl, newlock2
Changes since 1.236: +3 -3 lines
Diff to previous 1.236 (colored) to selected 1.30 (colored)

Fix all the -D*DEBUG* code that it was rotting away and did not even compile.
Mostly from Arnaud Lacombe, many thanks!

Revision 1.224.2.1 / (download) - annotate - [select for diffs], Wed Jun 21 15:02:57 2006 UTC (17 years, 10 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.224: +91 -75 lines
Diff to previous 1.224 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.234.4.1 / (download) - annotate - [select for diffs], Sat Apr 22 11:38:56 2006 UTC (18 years ago) by simonb
Branch: simonb-timecounters
CVS Tags: simonb-timcounters-final
Changes since 1.234: +6 -6 lines
Diff to previous 1.234 (colored) next main 1.235 (colored) to selected 1.30 (colored)

Sync with head.

Revision 1.235.4.1 / (download) - annotate - [select for diffs], Wed Apr 19 03:24:41 2006 UTC (18 years ago) by elad
Branch: elad-kernelauth
Changes since 1.235: +4 -4 lines
Diff to previous 1.235 (colored) next main 1.236 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.235.2.1 / (download) - annotate - [select for diffs], Sat Apr 1 12:06:59 2006 UTC (18 years ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.235: +4 -4 lines
Diff to previous 1.235 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.235.6.1 / (download) - annotate - [select for diffs], Tue Mar 28 09:42:11 2006 UTC (18 years ago) by tron
Branch: peter-altq
Changes since 1.235: +4 -4 lines
Diff to previous 1.235 (colored) next main 1.236 (colored) to selected 1.30 (colored)

Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.

Revision 1.236 / (download) - annotate - [select for diffs], Sat Mar 18 10:59:58 2006 UTC (18 years, 1 month ago) by bouyer
Branch: MAIN
CVS Tags: yamt-pdpolicy-base7, yamt-pdpolicy-base6, yamt-pdpolicy-base5, yamt-pdpolicy-base4, yamt-pdpolicy-base3, simonb-timecounters-base, gdamore-uart-base, gdamore-uart, elad-kernelauth-base, chap-midi-nbase, chap-midi-base, chap-midi, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.235: +4 -4 lines
Diff to previous 1.235 (colored) to selected 1.30 (colored)

__wdcwait_reset(): if we hare there we have a wdc pointer, so no need to check
if wdc is not NULL here at all (we were doing it after wdc has been
dereferenced anyway).
Coverity ID 2441.

Revision 1.231.2.2 / (download) - annotate - [select for diffs], Wed Mar 1 09:28:13 2006 UTC (18 years, 1 month ago) by yamt
Branch: yamt-uio_vmspace
Changes since 1.231.2.1: +4 -4 lines
Diff to previous 1.231.2.1 (colored) to branchpoint 1.231 (colored) next main 1.232 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.235 / (download) - annotate - [select for diffs], Mon Feb 20 16:50:37 2006 UTC (18 years, 2 months ago) by thorpej
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5, yamt-pdpolicy-base2, yamt-pdpolicy-base, peter-altq-base
Branch point for: yamt-pdpolicy, peter-altq, elad-kernelauth
Changes since 1.234: +4 -4 lines
Diff to previous 1.234 (colored) to selected 1.30 (colored)

Use device_is_active() rather than testing dv_flags for DVF_ACTIVE
directly.

Revision 1.231.2.1 / (download) - annotate - [select for diffs], Wed Feb 1 14:52:08 2006 UTC (18 years, 2 months ago) by yamt
Branch: yamt-uio_vmspace
Changes since 1.231: +24 -22 lines
Diff to previous 1.231 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.220.2.8.2.1 / (download) - annotate - [select for diffs], Thu Jan 26 21:21:12 2006 UTC (18 years, 2 months ago) by jdc
Branch: netbsd-3-0
CVS Tags: netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE
Changes since 1.220.2.8: +6 -2 lines
Diff to previous 1.220.2.8 (colored) next main 1.220.2.9 (colored) to selected 1.30 (colored)

Pull up revision 1.231 (requested by bouyer in ticket #1125).

After a reset don't wait for drives to come ready if there's no drives.
Fix a 30s hang after resume. Problem reported and fix tested by Brian de Alwis.

Revision 1.220.2.9 / (download) - annotate - [select for diffs], Thu Jan 26 21:09:23 2006 UTC (18 years, 2 months ago) by jdc
Branch: netbsd-3
CVS Tags: netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1
Changes since 1.220.2.8: +6 -2 lines
Diff to previous 1.220.2.8 (colored) to branchpoint 1.220 (colored) next main 1.221 (colored) to selected 1.30 (colored)

Pull up revision 1.231 (requested by bouyer in ticket #1125).

After a reset don't wait for drives to come ready if there's no drives.
Fix a 30s hang after resume. Problem reported and fix tested by Brian de Alwis.

Revision 1.234 / (download) - annotate - [select for diffs], Tue Jan 24 21:43:26 2006 UTC (18 years, 2 months ago) by bouyer
Branch: MAIN
Branch point for: simonb-timecounters, rpaulo-netinet-merge-pcb
Changes since 1.233: +6 -3 lines
Diff to previous 1.233 (colored) to selected 1.30 (colored)

Revert part of previous: checking the drive's status after a read seems to
cause interrupt timeouts on some hardware.

Revision 1.233 / (download) - annotate - [select for diffs], Sun Jan 22 16:44:45 2006 UTC (18 years, 3 months ago) by bouyer
Branch: MAIN
Changes since 1.232: +12 -6 lines
Diff to previous 1.232 (colored) to selected 1.30 (colored)

Make some debug printf more verbose.
In wdccommand_intr(), after a data read check that the drive is ready again.

Revision 1.232 / (download) - annotate - [select for diffs], Mon Jan 16 20:30:19 2006 UTC (18 years, 3 months ago) by bouyer
Branch: MAIN
Changes since 1.231: +11 -18 lines
Diff to previous 1.231 (colored) to selected 1.30 (colored)

properly use ata_channel->ch_ndrive:
- initialize it properly in the bus front-ends (all 2, exept in wdc_pcmcia.c
  for the "Sandisk CompactFlash Card" where it's set to 1)
- remplace hardcoded '2' by ata_channel->ch_ndrive in MI IDE drivers.

From Christos Zoulas in kern/32501.

Revision 1.123.2.11 / (download) - annotate - [select for diffs], Sun Dec 11 10:28:51 2005 UTC (18 years, 4 months ago) by christos
Branch: ktrace-lwp
Changes since 1.123.2.10: +6 -2 lines
Diff to previous 1.123.2.10 (colored) next main 1.124 (colored) to selected 1.30 (colored)

Sync with head.

Revision 1.230.6.1 / (download) - annotate - [select for diffs], Tue Nov 22 16:08:07 2005 UTC (18 years, 5 months ago) by yamt
Branch: yamt-readahead
Changes since 1.230: +6 -2 lines
Diff to previous 1.230 (colored) next main 1.231 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.231 / (download) - annotate - [select for diffs], Wed Nov 16 23:39:08 2005 UTC (18 years, 5 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-readahead-base3, yamt-readahead-base2, ktrace-lwp-base
Branch point for: yamt-uio_vmspace
Changes since 1.230: +6 -2 lines
Diff to previous 1.230 (colored) to selected 1.30 (colored)

After a reset don't wait for drives to come ready if there's no drives.
Fix a 30s hang after resume. Problem reported and fix tested by Brian de Alwis.

Revision 1.123.2.10 / (download) - annotate - [select for diffs], Thu Nov 10 14:04:16 2005 UTC (18 years, 5 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.123.2.9: +117 -95 lines
Diff to previous 1.123.2.9 (colored) to selected 1.30 (colored)

Sync with HEAD. Here we go again...

Revision 1.172.2.7.2.11 / (download) - annotate - [select for diffs], Fri Oct 28 01:38:58 2005 UTC (18 years, 5 months ago) by jmc
Branch: netbsd-2
Changes since 1.172.2.7.2.10: +4 -3 lines
Diff to previous 1.172.2.7.2.10 (colored) to branchpoint 1.172.2.7 (colored) next main 1.173 (colored) to selected 1.30 (colored)

Pullup (via patch) requested by bouyer in ticket #5852
  In __wdccommand_start(), don't cann wdcwait() with ata_c->flags, as this gives
  information about the context in which wdc_exec_command() was called, but
  we may be in interrupt context here. Call wdcwait() with flags derived from
  xfer->c_flags instead, as do other wdcwait() callers. PR#31083

Revision 1.220.2.8 / (download) - annotate - [select for diffs], Tue Sep 13 21:37:46 2005 UTC (18 years, 7 months ago) by tron
Branch: netbsd-3
CVS Tags: netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1
Branch point for: netbsd-3-0
Changes since 1.220.2.7: +4 -3 lines
Diff to previous 1.220.2.7 (colored) to branchpoint 1.220 (colored) to selected 1.30 (colored)

Pull up following revision(s) (requested by bouyer in ticket #780):
	sys/dev/ic/wdc.c: revision 1.230
In __wdccommand_start(), don't call wdcwait() with ata_c->flags, as this gives
information about the context in which wdc_exec_command() was called, but
we may be in interrupt context here. Call wdcwait() with flags derived from
xfer->c_flags instead, as do other wdcwait() callers.
Should fix kern/31083 by Jukka Salmi.

Revision 1.230 / (download) - annotate - [select for diffs], Mon Aug 29 19:30:07 2005 UTC (18 years, 7 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base, thorpej-vnode-attr-base, thorpej-vnode-attr
Branch point for: yamt-readahead
Changes since 1.229: +4 -3 lines
Diff to previous 1.229 (colored) to selected 1.30 (colored)

In __wdccommand_start(), don't cann wdcwait() with ata_c->flags, as this gives
information about the context in which wdc_exec_command() was called, but
we may be in interrupt context here. Call wdcwait() with flags derived from
xfer->c_flags instead, as do other wdcwait() callers.
Should fix kern/31083 by Jukka Salmi.

Revision 1.220.2.7 / (download) - annotate - [select for diffs], Wed Aug 24 21:53:46 2005 UTC (18 years, 7 months ago) by tron
Branch: netbsd-3
Changes since 1.220.2.6: +4 -3 lines
Diff to previous 1.220.2.6 (colored) to branchpoint 1.220 (colored) to selected 1.30 (colored)

Pull up revision 1.229 (requested by bouyer in ticket #693):
make CF on pcmcia works again.
Approved by bouyer.
closed kern/30998.

Revision 1.220.2.6 / (download) - annotate - [select for diffs], Wed Aug 24 21:53:23 2005 UTC (18 years, 7 months ago) by tron
Branch: netbsd-3
Changes since 1.220.2.5: +22 -18 lines
Diff to previous 1.220.2.5 (colored) to branchpoint 1.220 (colored) to selected 1.30 (colored)

Pull up revision 1.226 (requested by bouyer in ticket #693):
The ATA/ATAPI IDENTIFY data were designed to be converted on the fly to
host byte order (eventually the byte swapping could be wired in hardware, on
the 16 bit data bus). This was keept when wdc_exec_command() was created,
and as a result wdc_exec_command() is doing 16bit conversion to host byte
order. This is fine for IDENTIFY but doesn't work for other opaque data
structure, such as the ones for SMART.
So change wdc_exec_command() to do the conversion to host byte order only for
WDCC_IDENTIFY and ATAPI_IDENTIFY_DEVICE. This fixes atactl smart status
on big-endian hosts.
While here change __wdccommand_intr() to only use wdc_data{in,out}_pio, there
is no gain in doing the 32bit data port stuff locally.

Revision 1.172.2.7.2.10 / (download) - annotate - [select for diffs], Tue Aug 23 13:35:55 2005 UTC (18 years, 8 months ago) by tron
Branch: netbsd-2
CVS Tags: netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1
Changes since 1.172.2.7.2.9: +3 -3 lines
Diff to previous 1.172.2.7.2.9 (colored) to branchpoint 1.172.2.7 (colored) to selected 1.30 (colored)

Apply patch (requested by bouyer in ticket #5605):
On NetBSD 2.x chp->ch_wdc can be NULL in some case, check for this.
This avoids panics in wdcprobe().

Revision 1.172.2.7.2.9 / (download) - annotate - [select for diffs], Tue Aug 23 13:07:31 2005 UTC (18 years, 8 months ago) by tron
Branch: netbsd-2
Changes since 1.172.2.7.2.8: +3 -3 lines
Diff to previous 1.172.2.7.2.8 (colored) to branchpoint 1.172.2.7 (colored) to selected 1.30 (colored)

Apply patch (requested by bouyer in ticket #5604):
Fix error in patch from ticket #5603.

Revision 1.172.2.7.2.8 / (download) - annotate - [select for diffs], Mon Aug 22 22:10:48 2005 UTC (18 years, 8 months ago) by riz
Branch: netbsd-2
Changes since 1.172.2.7.2.7: +72 -23 lines
Diff to previous 1.172.2.7.2.7 (colored) to branchpoint 1.172.2.7 (colored) to selected 1.30 (colored)

Pull up following revision(s) (requested by bouyer in ticket #5603):
	sys/dev/ic/wdc.c: revision 1.226
The ATA/ATAPI IDENTIFY data were designed to be converted on the fly to
host byte order (eventually the byte swapping could be wired in hardware, on
the 16 bit data bus). This was keept when wdc_exec_command() was created,
and as a result wdc_exec_command() is doing 16bit conversion to host byte
order. This is fine for IDENTIFY but doesn't work for other opaque data
structure, such as the ones for SMART.
So change wdc_exec_command() to do the conversion to host byte order only for
WDCC_IDENTIFY and ATAPI_IDENTIFY_DEVICE. This fixes atactl smart status
on big-endian hosts.

        sys/dev/ic/wdc.c: revision 1.229
make CF on pcmcia works again.
Approved by bouyer.
closed kern/30998.

Revision 1.220.2.5 / (download) - annotate - [select for diffs], Thu Aug 18 20:10:52 2005 UTC (18 years, 8 months ago) by tron
Branch: netbsd-3
Changes since 1.220.2.4: +3 -2 lines
Diff to previous 1.220.2.4 (colored) to branchpoint 1.220 (colored) to selected 1.30 (colored)

Pull up revision 1.228 (requested by bouyer in ticket #653):
Add missing declaration/initialisation of wdc.
Pointed out by Rui Paulo.

Revision 1.220.2.4 / (download) - annotate - [select for diffs], Thu Aug 18 20:08:54 2005 UTC (18 years, 8 months ago) by tron
Branch: netbsd-3
Changes since 1.220.2.3: +5 -2 lines
Diff to previous 1.220.2.3 (colored) to branchpoint 1.220 (colored) to selected 1.30 (colored)

Pull up revision 1.227 (requested by bouyer in ticket #653):
Also initialize wdc->reset in wdcprobe() if the bus back-end didn't provide
one. Prevent NULL pointer dereference when wdcprobe() is called.

Revision 1.220.2.3 / (download) - annotate - [select for diffs], Thu Aug 18 20:02:46 2005 UTC (18 years, 8 months ago) by tron
Branch: netbsd-3
Changes since 1.220.2.2: +32 -32 lines
Diff to previous 1.220.2.2 (colored) to branchpoint 1.220 (colored) to selected 1.30 (colored)

Pull up revision 1.225 (requested by bouyer in ticket #653):
Add an optionnal controller callback for channel reset. If the callback
is set to NULL, use the generic reset code.
Use this to work around a bug in some Acer IDE controllers (like the
one found in some sparc systems) where a controller disable/enable
is required after a reset to avoid data corruption when Ultra-DMA is
used. Workaround from opensolaris, thanks to Hiroki Sato for testing.

Revision 1.229 / (download) - annotate - [select for diffs], Wed Aug 17 22:41:33 2005 UTC (18 years, 8 months ago) by tacha
Branch: MAIN
Changes since 1.228: +4 -3 lines
Diff to previous 1.228 (colored) to selected 1.30 (colored)

make CF on pcmcia works again.

Approved by bouyer.
closed kern/30998.

Revision 1.172.2.7.2.7 / (download) - annotate - [select for diffs], Sat Aug 13 23:35:26 2005 UTC (18 years, 8 months ago) by riz
Branch: netbsd-2
Changes since 1.172.2.7.2.6: +3 -3 lines
Diff to previous 1.172.2.7.2.6 (colored) to branchpoint 1.172.2.7 (colored) to selected 1.30 (colored)

Pull up patch (requested by bouyer in ticket #5561):

CHAN_TO_WDC() doesn't exist on netbsd-2; correct this pullup (as
requested by bouyer).

Revision 1.172.2.7.2.6 / (download) - annotate - [select for diffs], Sat Aug 13 23:27:22 2005 UTC (18 years, 8 months ago) by riz
Branch: netbsd-2
Changes since 1.172.2.7.2.5: +3 -2 lines
Diff to previous 1.172.2.7.2.5 (colored) to branchpoint 1.172.2.7 (colored) to selected 1.30 (colored)

Pull up revision 1.228 (requested by bouyer in ticket #5561):
Add missing declaration/initialisation of wdc.
Pointed out by Rui Paulo.

Revision 1.172.2.7.2.5 / (download) - annotate - [select for diffs], Sat Aug 13 23:26:04 2005 UTC (18 years, 8 months ago) by riz
Branch: netbsd-2
Changes since 1.172.2.7.2.4: +5 -2 lines
Diff to previous 1.172.2.7.2.4 (colored) to branchpoint 1.172.2.7 (colored) to selected 1.30 (colored)

Pull up revision 1.227 (requested by bouyer in ticket #5561):
Also initialize wdc->reset in wdcprobe() if the bus back-end didn't provide
one. Prevent NULL pointer dereference when wdcprobe() is called.

Revision 1.228 / (download) - annotate - [select for diffs], Wed Aug 10 13:15:42 2005 UTC (18 years, 8 months ago) by bouyer
Branch: MAIN
Changes since 1.227: +3 -2 lines
Diff to previous 1.227 (colored) to selected 1.30 (colored)

Add missing declaration/initialisation of wdc.
Pointed out by Rui Paulo.

Revision 1.227 / (download) - annotate - [select for diffs], Wed Aug 10 11:16:53 2005 UTC (18 years, 8 months ago) by bouyer
Branch: MAIN
Changes since 1.226: +5 -2 lines
Diff to previous 1.226 (colored) to selected 1.30 (colored)

Also initialize wdc->reset in wdcprobe() if the bus back-end didn't provide
one. Prevent NULL pointer dereference when wdcprobe() is called.

Revision 1.226 / (download) - annotate - [select for diffs], Tue Aug 9 22:08:16 2005 UTC (18 years, 8 months ago) by bouyer
Branch: MAIN
Changes since 1.225: +22 -18 lines
Diff to previous 1.225 (colored) to selected 1.30 (colored)

The ATA/ATAPI IDENTIFY data were designed to be converted on the fly to
host byte order (eventually the byte swapping could be wired in hardware, on
the 16 bit data bus). This was keept when wdc_exec_command() was created,
and as a result wdc_exec_command() is doing 16bit conversion to host byte
order. This is fine for IDENTIFY but doesn't work for other opaque data
structure, such as the ones for SMART.
So change wdc_exec_command() to do the conversion to host byte order only for
WDCC_IDENTIFY and ATAPI_IDENTIFY_DEVICE. This fixes atactl smart status
on big-endian hosts.

While here change __wdccommand_intr() to only use wdc_data{in,out}_pio, there
is no gain in doing the 32bit data port stuff locally.

Revision 1.172.2.7.2.4 / (download) - annotate - [select for diffs], Sun Aug 7 15:51:36 2005 UTC (18 years, 8 months ago) by riz
Branch: netbsd-2
Changes since 1.172.2.7.2.3: +38 -34 lines
Diff to previous 1.172.2.7.2.3 (colored) to branchpoint 1.172.2.7 (colored) to selected 1.30 (colored)

Pull up revision 1.225 via patch (requested by bouyer in ticket #5555):
Add an optionnal controller callback for channel reset. If the callback
is set to NULL, use the generic reset code.
Use this to work around a bug in some Acer IDE controllers (like the
one found in some sparc systems) where a controller disable/enable
is required after a reset to avoid data corruption when Ultra-DMA is
used. Workaround from opensolaris, thanks to Hiroki Sato for testing.

Revision 1.225 / (download) - annotate - [select for diffs], Sat Aug 6 22:07:24 2005 UTC (18 years, 8 months ago) by bouyer
Branch: MAIN
Changes since 1.224: +34 -34 lines
Diff to previous 1.224 (colored) to selected 1.30 (colored)

Add an optionnal controller callback for channel reset. If the callback
is set to NULL, use the generic reset code.
Use this to work around a bug in some Acer IDE controllers (like the
one found in some sparc systems) where a controller disable/enable
is required after a reset to avoid data corruption when Ultra-DMA is
used. Workaround from opensolaris, thanks to Hiroki Sato for testing.

Revision 1.172.2.7.2.3 / (download) - annotate - [select for diffs], Tue Jul 5 21:04:08 2005 UTC (18 years, 9 months ago) by riz
Branch: netbsd-2
Changes since 1.172.2.7.2.2: +30 -17 lines
Diff to previous 1.172.2.7.2.2 (colored) to branchpoint 1.172.2.7 (colored) to selected 1.30 (colored)

Pull up revision 1.224 via patch (requested by bouyer in ticket #2030):
In wdcprobe1(), wait 5s for the drive to deassert ready. In case of e.g.
pcmcia devices, the drive may still be doing its power-on reset.
XXX From the specs the delay could be up to 31s here, but we don't want to
    wait for 31s if we have a channel with no drives and pull-up resitors on
    the bus.
Based on patch submitted in kern/25659 by Steven M. Bellovin, part of fix for
kern/25659.

Revision 1.220.2.2 / (download) - annotate - [select for diffs], Sat Jul 2 23:15:30 2005 UTC (18 years, 9 months ago) by tron
Branch: netbsd-3
Changes since 1.220.2.1: +29 -16 lines
Diff to previous 1.220.2.1 (colored) to branchpoint 1.220 (colored) to selected 1.30 (colored)

Pull up revision 1.224 (requested by bouyer in ticket #499):
In wdcprobe1(), wait 5s for the drive to deassert ready. In case of e.g.
pcmcia devices, the drive may still be doing its power-on reset.
XXX From the specs the delay could be up to 31s here, but we don't want to
    wait for 31s if we have a channel with no drives and pull-up resitors on
    the bus.
Based on patch submitted in kern/25659 by Steven M. Bellovin, part of fix for
kern/25659.

Revision 1.220.2.1 / (download) - annotate - [select for diffs], Wed Jun 22 18:38:33 2005 UTC (18 years, 10 months ago) by tron
Branch: netbsd-3
Changes since 1.220: +3 -4 lines
Diff to previous 1.220 (colored) to selected 1.30 (colored)

Pull up revision 1.223 (requested by bouyer in ticket #480):
Remove a (wdc == NULL) test. We know wdc is not NULL at this point.

Revision 1.224 / (download) - annotate - [select for diffs], Sun Jun 19 18:14:27 2005 UTC (18 years, 10 months ago) by bouyer
Branch: MAIN
Branch point for: yamt-lazymbuf
Changes since 1.223: +31 -18 lines
Diff to previous 1.223 (colored) to selected 1.30 (colored)

In wdcprobe1(), wait 5s for the drive to deassert ready. In case of e.g.
pcmcia devices, the drive may still be doing its power-on reset.
XXX From the specs the delay could be up to 31s here, but we don't want to
    wait for 31s if we have a channel with no drives and pull-up resitors on
    the bus.
Based on patch submitted in kern/25659 by Steven M. Bellovin, part of fix for
kern/25659.

Revision 1.223 / (download) - annotate - [select for diffs], Thu Jun 16 20:15:04 2005 UTC (18 years, 10 months ago) by bouyer
Branch: MAIN
Changes since 1.222: +3 -4 lines
Diff to previous 1.222 (colored) to selected 1.30 (colored)

Remove a (wdc == NULL) test. We know wdc is not NULL at this point.

Revision 1.222 / (download) - annotate - [select for diffs], Sun May 29 22:10:28 2005 UTC (18 years, 10 months ago) by christos
Branch: MAIN
Changes since 1.221: +28 -28 lines
Diff to previous 1.221 (colored) to selected 1.30 (colored)

- sprinkle const.
- avoid variable shadowing.

Revision 1.217.4.1 / (download) - annotate - [select for diffs], Fri Apr 29 11:28:53 2005 UTC (18 years, 11 months ago) by kent
Branch: kent-audio2
Changes since 1.217: +60 -43 lines
Diff to previous 1.217 (colored) next main 1.218 (colored) to selected 1.30 (colored)

sync with -current

Revision 1.172.2.7.2.2 / (download) - annotate - [select for diffs], Sat Apr 16 10:59:50 2005 UTC (19 years ago) by tron
Branch: netbsd-2
Changes since 1.172.2.7.2.1: +36 -2 lines
Diff to previous 1.172.2.7.2.1 (colored) to branchpoint 1.172.2.7 (colored) to selected 1.30 (colored)

Pull up revision 1.217 via patch (requested by bouyer in ticket #1105):
Allow polled commands to be queued, if ata_exec_xfer() is called in thread
context. For this introduce 3 new xfer tags:
- C_WAIT, equivalent of AT_WAIT
- C_WAITACT, when there is a thread waiting on this xfer to become the active
  one (that is, to be at the head of the queue)
- C_FREE, set by ata_free_xfer() when it can't free the xfer because it's
  still in use. The holder should then free the xfer ASAP.
If ata_exec_xfer() is called with (C_POLL | C_WAIT), and there is already
xfers to be processed, assert C_WAITACT and sleep.
atastart() checks for C_WAITACT, and wakeup the thread waiting for this xfer
to become active if set. atastart() won't process this xfer, it's the
responsability of the thread waked up to handle it.
Fix (the right way) kern/27421 by Martin Husemann.

Revision 1.123.2.9 / (download) - annotate - [select for diffs], Fri Apr 1 14:29:52 2005 UTC (19 years ago) by skrll
Branch: ktrace-lwp
Changes since 1.123.2.8: +4 -4 lines
Diff to previous 1.123.2.8 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.221 / (download) - annotate - [select for diffs], Mon Mar 28 22:08:51 2005 UTC (19 years ago) by fvdl
Branch: MAIN
CVS Tags: kent-audio2-base
Changes since 1.220: +4 -4 lines
Diff to previous 1.220 (colored) to selected 1.30 (colored)

Reverse the cyl_lo and cyl_hi reads for the AT_READREG case; previously,
the cyl_lo information would have been thrown away.

Revision 1.217.6.2 / (download) - annotate - [select for diffs], Sat Mar 19 08:34:04 2005 UTC (19 years, 1 month ago) by yamt
Branch: yamt-km
Changes since 1.217.6.1: +22 -22 lines
Diff to previous 1.217.6.1 (colored) to branchpoint 1.217 (colored) next main 1.218 (colored) to selected 1.30 (colored)

sync with head.  xen and whitespace.  xen part is not finished.

Revision 1.172.2.7.2.1 / (download) - annotate - [select for diffs], Wed Mar 16 18:37:03 2005 UTC (19 years, 1 month ago) by jmc
Branch: netbsd-2
Changes since 1.172.2.7: +6 -19 lines
Diff to previous 1.172.2.7 (colored) to selected 1.30 (colored)

Pullup rev 1.180 (requested by mycroft in ticket #1018)

	Only downgrade modes due to an actual CRC error.  Downgrading on other errors
is anti-social -- especially given that there's no way to upgrade again short
of rebooting.

Also, downgrade UDMA modes more slowly.  It's entirely possible that they're
using an 80-wire cable, but it's just too long for the higher modes, or there
is minor crosstalk.

Revision 1.123.2.8 / (download) - annotate - [select for diffs], Fri Mar 4 16:41:35 2005 UTC (19 years, 1 month ago) by skrll
Branch: ktrace-lwp
Changes since 1.123.2.7: +22 -22 lines
Diff to previous 1.123.2.7 (colored) to selected 1.30 (colored)

Sync with HEAD.

Hi Perry!

Revision 1.220 / (download) - annotate - [select for diffs], Wed Mar 2 12:25:27 2005 UTC (19 years, 1 month ago) by mycroft
Branch: MAIN
CVS Tags: yamt-km-base4, yamt-km-base3, netbsd-3-base
Branch point for: netbsd-3
Changes since 1.219: +3 -3 lines
Diff to previous 1.219 (colored) to selected 1.30 (colored)

Copyright maintenance.

Revision 1.219 / (download) - annotate - [select for diffs], Sun Feb 27 00:27:03 2005 UTC (19 years, 1 month ago) by perry
Branch: MAIN
Changes since 1.218: +21 -21 lines
Diff to previous 1.218 (colored) to selected 1.30 (colored)

nuke trailing whitespace

Revision 1.123.2.7 / (download) - annotate - [select for diffs], Tue Feb 15 21:33:12 2005 UTC (19 years, 2 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.123.2.6: +38 -21 lines
Diff to previous 1.123.2.6 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.217.6.1 / (download) - annotate - [select for diffs], Sat Feb 12 18:17:44 2005 UTC (19 years, 2 months ago) by yamt
Branch: yamt-km
Changes since 1.217: +38 -21 lines
Diff to previous 1.217 (colored) to selected 1.30 (colored)

sync with head.

Revision 1.218 / (download) - annotate - [select for diffs], Fri Feb 11 21:11:15 2005 UTC (19 years, 2 months ago) by rearnsha
Branch: MAIN
CVS Tags: yamt-km-base2
Changes since 1.217: +38 -21 lines
Diff to previous 1.217 (colored) to selected 1.30 (colored)

Add support for Artisea chips operating in DPA mode, which has a
16-bit view of the ATA command registers for extended commands.

Approved by briggs.

Revision 1.123.2.6 / (download) - annotate - [select for diffs], Tue Nov 2 07:51:31 2004 UTC (19 years, 5 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.123.2.5: +19 -12 lines
Diff to previous 1.123.2.5 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.217 / (download) - annotate - [select for diffs], Sat Oct 30 23:10:37 2004 UTC (19 years, 5 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-km-base, kent-audio1-beforemerge, kent-audio1-base, kent-audio1
Branch point for: yamt-km, kent-audio2
Changes since 1.216: +5 -3 lines
Diff to previous 1.216 (colored) to selected 1.30 (colored)

Allow polled commands to be queued, if ata_exec_xfer() is called in thread
context. For this introduce 3 new xfer tags:
- C_WAIT, equivalent of AT_WAIT
- C_WAITACT, when there is a thread waiting on this xfer to become the active
  one (that is, to be at the head of the queue)
- C_FREE, set by ata_free_xfer() when it can't free the xfer because it's
  still in use. The holder should then free the xfer ASAP.

If ata_exec_xfer() is called with (C_POLL | C_WAIT), and there is already
xfers to be processed, assert C_WAITACT and sleep.
atastart() checks for C_WAITACT, and wakeup the thread waiting for this xfer
to become active if set. atastart() won't process this xfer, it's the
responsability of the thread waked up to handle it.

Fix (the right way) kern/27421 by Martin Husemann.

Revision 1.216 / (download) - annotate - [select for diffs], Sat Oct 30 17:17:21 2004 UTC (19 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.215: +9 -3 lines
Diff to previous 1.215 (colored) to selected 1.30 (colored)

Revert 1.215, with a comment explaining why we can't use interrupts here.

Revision 1.215 / (download) - annotate - [select for diffs], Tue Oct 26 21:21:59 2004 UTC (19 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.214: +4 -5 lines
Diff to previous 1.214 (colored) to selected 1.30 (colored)

wdc_drvprobe(): don't poll for the IDENTIFY, use interrupts. There's no
reasons to not use interrupts here, and polling cause problems when there is
a shared queue between 2 channels.
Fix kern/27421 by Martin Husemann.

Revision 1.214 / (download) - annotate - [select for diffs], Mon Oct 25 22:42:09 2004 UTC (19 years, 5 months ago) by enami
Branch: MAIN
Changes since 1.213: +10 -10 lines
Diff to previous 1.213 (colored) to selected 1.30 (colored)

Fill some entry in fake wdc_ata_bustype since those are called even
if no wd(4) device is configured in a kernel.

Revision 1.123.2.5 / (download) - annotate - [select for diffs], Tue Sep 21 13:28:09 2004 UTC (19 years, 7 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.123.2.4: +2 -2 lines
Diff to previous 1.123.2.4 (colored) to selected 1.30 (colored)

Fix the sync with head I botched.

Revision 1.123.2.4 / (download) - annotate - [select for diffs], Sat Sep 18 14:46:01 2004 UTC (19 years, 7 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.123.2.3: +2 -2 lines
Diff to previous 1.123.2.3 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.172.2.7 / (download) - annotate - [select for diffs], Fri Sep 17 04:04:57 2004 UTC (19 years, 7 months ago) by jmc
Branch: netbsd-2-0
CVS Tags: netbsd-2-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE
Branch point for: netbsd-2
Changes since 1.172.2.6: +6 -5 lines
Diff to previous 1.172.2.6 (colored) to branchpoint 1.172 (colored) next main 1.173 (colored) to selected 1.30 (colored)

Pullup patch (requested by bouyer in ticket #854)

__wdc_reset_channel(): give the loop over commands a chance to terminate by
- updating xfer on each iteration (ops)
- making sure that xfers gets removed from the queue

Revision 1.172.2.6 / (download) - annotate - [select for diffs], Sat Sep 11 18:32:01 2004 UTC (19 years, 7 months ago) by he
Branch: netbsd-2-0
Changes since 1.172.2.5: +3 -2 lines
Diff to previous 1.172.2.5 (colored) to branchpoint 1.172 (colored) to selected 1.30 (colored)

Apply patch (requested by bouyer in ticket #840):
  If we are not going to handle a reset request because one is
  already pending, decrease queue_freeze that we just increased.
  Otherwise, the queue stays frozen after the reset.
  Should fix PR#26873 and PR#26910.

Revision 1.123.2.3 / (download) - annotate - [select for diffs], Wed Aug 25 06:57:35 2004 UTC (19 years, 7 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.123.2.2: +477 -1073 lines
Diff to previous 1.123.2.2 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.213 / (download) - annotate - [select for diffs], Sat Aug 21 01:51:46 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.212: +15 -7 lines
Diff to previous 1.212 (colored) to selected 1.30 (colored)

Make some functions referenced only in wdc.c private to that file.

Revision 1.212 / (download) - annotate - [select for diffs], Sat Aug 21 00:28:34 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.211: +25 -4 lines
Diff to previous 1.211 (colored) to selected 1.30 (colored)

atastart() (called only at splbio(), and from interrupts) can change
drive_flags, to make sure all drive_flags manipulations are done at
splbio().

Revision 1.211 / (download) - annotate - [select for diffs], Fri Aug 20 23:26:54 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.210: +14 -42 lines
Diff to previous 1.210 (colored) to selected 1.30 (colored)

- Add an (*ata_reset_channel)() member to ata_bustype.
- Add an ata_reset_channel() function that performs the common parts
  of resetting an ATA channel, which uses the (*ata_reset_channel)()
  callback to do the heavy lifting.  Adjust callers to use ata_reset_channel()
  instead of wdc_reset_channel().

This removes the last wdc-specific code from ata.c!

Revision 1.210 / (download) - annotate - [select for diffs], Fri Aug 20 22:17:06 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.209: +5 -13 lines
Diff to previous 1.209 (colored) to selected 1.30 (colored)

Move common parts of attaching an ata_channel to a new ata_channel_attach()
function.

Revision 1.209 / (download) - annotate - [select for diffs], Fri Aug 20 22:02:40 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.208: +2 -140 lines
Diff to previous 1.208 (colored) to selected 1.30 (colored)

Move atabusconfig() to ata.c.

Revision 1.208 / (download) - annotate - [select for diffs], Fri Aug 20 20:52:31 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.207: +10 -4 lines
Diff to previous 1.207 (colored) to selected 1.30 (colored)

- Add an atac_bustype_ata member to atac_softc to hold a pointer to
  the ata_bustype for the controller.  Fill it in and use it instead
  of referencing wdc_ata_bustype directly.
- Add an atac_atapibus_attach member to atac_softc to hold a pointer
  to the function that attaches the ATAPI bus for the controller.  Fill
  it in and use it instead of referencing wdc_atapibus_attach directly.

Revision 1.207 / (download) - annotate - [select for diffs], Fri Aug 20 06:39:38 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.206: +115 -110 lines
Diff to previous 1.206 (colored) to selected 1.30 (colored)

Move most of wdc_softc into a new atac_softc structure that contains
info common to all types of ATA controllers.

Revision 1.206 / (download) - annotate - [select for diffs], Thu Aug 19 23:25:35 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.205: +3 -3 lines
Diff to previous 1.205 (colored) to selected 1.30 (colored)

- Add and use a CHAN_TO_WDC() macro to get the wdc_softc from an
  ata_channel.
- Add and use a CHAN_TO_WDC_REGS() macro to get the wdc_regs from an
  ata_channel.
- Add and use a CHAN_TO_PCIIDE() macro to get the pciide_softc from an
  ata_channel.
- Add and use a CHAN_TO_PCHAN() macro to get the pciide_channel from an
  ata_channel.  (This one just hides a cast, and is really just for
  consistency with the others.)

Revision 1.205 / (download) - annotate - [select for diffs], Sat Aug 14 15:08:05 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.204: +292 -263 lines
Diff to previous 1.204 (colored) to selected 1.30 (colored)

- Split the register handles out of struct wdc_channel into a separate
  wdc_regs structure, and array of which (indexed per channel) is pointed
  to by struct wdc_softc.
- Move the resulting wdc_channel structure to atavar.h and rename it to
  ata_channel.  Rename the corresponding flags.
- Add a "ch_ndrive" member to struct ata_channel, which indicates the
  maximum number of drives that can be present on the channel.  For now,
  this is always 2.  Add an ATA_MAXDRIVES constant that places an upper
  limit on this value, also currently 2.

Revision 1.204 / (download) - annotate - [select for diffs], Fri Aug 13 04:10:49 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.203: +51 -51 lines
Diff to previous 1.203 (colored) to selected 1.30 (colored)

WDCDEBUG -> ATADEBUG.

Revision 1.203 / (download) - annotate - [select for diffs], Fri Aug 13 03:12:59 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.202: +24 -24 lines
Diff to previous 1.202 (colored) to selected 1.30 (colored)

Don't bother with bits that tell of the presence of optional callbacks;
just check the function pointers for NULL.

Revision 1.202 / (download) - annotate - [select for diffs], Fri Aug 13 02:16:40 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.201: +5 -64 lines
Diff to previous 1.201 (colored) to selected 1.30 (colored)

Move wdcstart() to ata.c and rename it to atastart().

Revision 1.201 / (download) - annotate - [select for diffs], Fri Aug 13 02:10:43 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.200: +3 -21 lines
Diff to previous 1.200 (colored) to selected 1.30 (colored)

Move wdc_exec_xfer() to ata.c and rename it ata_exec_xfer().

Revision 1.200 / (download) - annotate - [select for diffs], Thu Aug 12 22:39:41 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.199: +3 -35 lines
Diff to previous 1.199 (colored) to selected 1.30 (colored)

Move wdc_addref() and wdc_delref() to ata.c and rename them to
ata_*.

Revision 1.199 / (download) - annotate - [select for diffs], Thu Aug 12 22:33:45 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.198: +2 -36 lines
Diff to previous 1.198 (colored) to selected 1.30 (colored)

Move wdc_kill_pending() to ata.c and rename it ata_kill_pending().

Revision 1.198 / (download) - annotate - [select for diffs], Thu Aug 12 21:34:52 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.197: +6 -44 lines
Diff to previous 1.197 (colored) to selected 1.30 (colored)

- Move wdc_xfer_pool, wdc_get_xfer(), wdc_free_xfer() to ata.c, and rename
  to ata_*.
- Use a static initializer for the ata_xfer_pool.

Revision 1.197 / (download) - annotate - [select for diffs], Thu Aug 12 21:10:18 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.196: +3 -230 lines
Diff to previous 1.196 (colored) to selected 1.30 (colored)

Move wdc_probe_caps() to ata.c and rename it ata_probe_caps().

Revision 1.196 / (download) - annotate - [select for diffs], Thu Aug 12 21:05:09 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.195: +2 -51 lines
Diff to previous 1.195 (colored) to selected 1.30 (colored)

Move wdc_downgrade_mode() to ata.c and rename it to ata_downgrade_mode().

Revision 1.195 / (download) - annotate - [select for diffs], Thu Aug 12 20:59:27 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.194: +4 -38 lines
Diff to previous 1.194 (colored) to selected 1.30 (colored)

Move wdc_print_modes() into ata.c and rename it ata_print_modes().

Revision 1.194 / (download) - annotate - [select for diffs], Thu Aug 12 14:36:46 2004 UTC (19 years, 8 months ago) by mycroft
Branch: MAIN
Changes since 1.193: +4 -4 lines
Diff to previous 1.193 (colored) to selected 1.30 (colored)

Whoops.  Swap the order of the delref() and the config_pending_decr().

Revision 1.123.2.2 / (download) - annotate - [select for diffs], Thu Aug 12 11:41:27 2004 UTC (19 years, 8 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.123.2.1: +257 -119 lines
Diff to previous 1.123.2.1 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.193 / (download) - annotate - [select for diffs], Thu Aug 12 05:02:50 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.192: +6 -6 lines
Diff to previous 1.192 (colored) to selected 1.30 (colored)

Rename some constants:
WDC_COMPLETE -> ATACMD_COMPLETE
WDC_QUEUED -> ATACMD_QUEUED
WDC_TRY_AGAIN -> ATACMD_TRY_AGAIN

Revision 1.192 / (download) - annotate - [select for diffs], Thu Aug 12 04:57:19 2004 UTC (19 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.191: +66 -66 lines
Diff to previous 1.191 (colored) to selected 1.30 (colored)

Rename "struct wdc_command" to "struct ata_command".

Revision 1.172.2.5 / (download) - annotate - [select for diffs], Wed Aug 11 19:43:58 2004 UTC (19 years, 8 months ago) by jmc
Branch: netbsd-2-0
Changes since 1.172.2.4: +80 -21 lines
Diff to previous 1.172.2.4 (colored) to branchpoint 1.172 (colored) to selected 1.30 (colored)

Pullup rev 1.182 (requested by bouyer in ticket #733)

Implement asynchronous channel reset.
Use this to reset the channel before doing a dump, instead of the hack in
  wdc_exec_xfer() based on C_POLL. This hack was causing problems on
  controllers with a shared queue, because we now can have C_POLL set during
  concurent channels probes

Revision 1.191 / (download) - annotate - [select for diffs], Wed Aug 11 18:41:46 2004 UTC (19 years, 8 months ago) by mycroft
Branch: MAIN
Changes since 1.190: +10 -4 lines
Diff to previous 1.190 (colored) to selected 1.30 (colored)

Make datain_pio and dataout_pio function pointers in wdc_softc, which can
be overridden by the backend if desired.  Add experimental code to wdc_pcmcia
to use this in memory-mapped mode, disabled by default.

Revision 1.190 / (download) - annotate - [select for diffs], Wed Aug 11 17:49:27 2004 UTC (19 years, 8 months ago) by mycroft
Branch: MAIN
Changes since 1.189: +79 -8 lines
Diff to previous 1.189 (colored) to selected 1.30 (colored)

Add two helper functions -- wdc_datain_pio() and wdc_dataout_pio() -- which
encapsulate the logic for the various methods of transferring data.  Use these
throughout.

Revision 1.189 / (download) - annotate - [select for diffs], Tue Aug 10 23:09:39 2004 UTC (19 years, 8 months ago) by mycroft
Branch: MAIN
Changes since 1.188: +5 -12 lines
Diff to previous 1.188 (colored) to selected 1.30 (colored)

Hold a reference between atabus_attach() and atabusconfig() to avoid an extra
enable/disable cycle.  Now my CF card attaches a bit faster.

XXX This code is split strangely between files.

Revision 1.188 / (download) - annotate - [select for diffs], Tue Aug 10 02:40:51 2004 UTC (19 years, 8 months ago) by mycroft
Branch: MAIN
Changes since 1.187: +9 -2 lines
Diff to previous 1.187 (colored) to selected 1.30 (colored)

Be robust against the case of the child devices failing to decrement the
refcnt.

Revision 1.187 / (download) - annotate - [select for diffs], Wed Aug 4 22:44:04 2004 UTC (19 years, 8 months ago) by bouyer
Branch: MAIN
Changes since 1.186: +31 -21 lines
Diff to previous 1.186 (colored) to selected 1.30 (colored)

Change wdc_kill_pending() to take a struct ata_drive_datas * as argument,
and kill only pending requests for this drive.
Implement a DRIVE_WAITDRAIN flag, which will cause the active command to
be killed once complete.
Other minor fixes.
Now it's possible to detach a ATA or ATAPI device from ioctl even when
a dd on the raw char partition is running.

Revision 1.186 / (download) - annotate - [select for diffs], Wed Aug 4 18:24:11 2004 UTC (19 years, 8 months ago) by bouyer
Branch: MAIN
Changes since 1.185: +78 -26 lines
Diff to previous 1.185 (colored) to selected 1.30 (colored)

Add
struct ata_xfer *active_xfer
to ata_queue. Now the active xfer isn't the head of the queue any more,
this makes a few things easier (this will also help for tagged queuing
support).
Remove the WDCF_ACTIVE flag, test active_xfer != NULL instead.
clean up wdc_free_xfer() and kill_xfer().
Clean up wdc_reset_channel(), and make it issue a ATAPI_SOFT_RESET if the
active command is ATAPI.
In wdc_atapi_get_params(), use AT_WAIT | AT_POLL for ATAPI_SOFT_RESET,
so that we'll use tsleep() instead of delay().
In wdc_atapi_start(), call wdc_dmawait() at the right place.

Revision 1.123.2.1 / (download) - annotate - [select for diffs], Tue Aug 3 10:46:21 2004 UTC (19 years, 8 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.123: +1087 -678 lines
Diff to previous 1.123 (colored) to selected 1.30 (colored)

Sync with HEAD

Revision 1.185 / (download) - annotate - [select for diffs], Mon Aug 2 22:20:54 2004 UTC (19 years, 8 months ago) by bouyer
Branch: MAIN
Changes since 1.184: +8 -7 lines
Diff to previous 1.184 (colored) to selected 1.30 (colored)

Make it possible for (*dma_finish)() to abort quietly a DMA op. Use this
in wdc_reset_channel().

Revision 1.184 / (download) - annotate - [select for diffs], Mon Aug 2 22:02:35 2004 UTC (19 years, 8 months ago) by bouyer
Branch: MAIN
Changes since 1.183: +55 -23 lines
Diff to previous 1.183 (colored) to selected 1.30 (colored)

Clean up interraction between wdc_reset_channel and the kernel thread.
Move kill_xfer() after the reset, and stop the DMA engine if needed
(this will unload the DMA maps).

Revision 1.183 / (download) - annotate - [select for diffs], Sun Aug 1 21:40:41 2004 UTC (19 years, 8 months ago) by bouyer
Branch: MAIN
Changes since 1.182: +17 -12 lines
Diff to previous 1.182 (colored) to selected 1.30 (colored)

Implement an atabus control device, and define some ATA bus control
IOCTLS. Implement ATABUSIORESET, which will reset the given ATA bus.

Revision 1.182 / (download) - annotate - [select for diffs], Sat Jul 31 21:26:42 2004 UTC (19 years, 8 months ago) by bouyer
Branch: MAIN
Changes since 1.181: +80 -21 lines
Diff to previous 1.181 (colored) to selected 1.30 (colored)

Implement asynchronous channel reset.
Use this to reset the channel before doing a dump, instead of the hack in
  wdc_exec_xfer() based on C_POLL. This hack was causing problems on
  controllers with a shared queue, because we now can have C_POLL set during
  concurent channels probes (problem found and analysed on sparc64 by
  Martin Husemann).
This should even make core dumps marginally more reliable on ATA drives.

Revision 1.172.2.4 / (download) - annotate - [select for diffs], Thu Jun 24 13:57:07 2004 UTC (19 years, 9 months ago) by he
Branch: netbsd-2-0
Changes since 1.172.2.3: +4 -2 lines
Diff to previous 1.172.2.3 (colored) to branchpoint 1.172 (colored) to selected 1.30 (colored)

Pull up revision 1.181 (requested by bouyer in ticket #543):
  For now, remove the ATAPI_SOFT_RESET done at attach time,
  which was added to get an IBM pcmcia external cdrom drive
  working.  However, this appears to cause trouble for other
  IDE/ATAPI devices.

Revision 1.181 / (download) - annotate - [select for diffs], Wed Jun 23 21:10:52 2004 UTC (19 years, 10 months ago) by bouyer
Branch: MAIN
Changes since 1.180: +4 -2 lines
Diff to previous 1.180 (colored) to selected 1.30 (colored)

For now, remove the ATAPI_SOFT_RESET done at attach time. I added this to get a
IBM pcmcia external cdrom drive working, but it cause troubles for others
IDE/ATAPI devices. Need to find another way to get this IBM drive to probe.

Revision 1.180 / (download) - annotate - [select for diffs], Tue Jun 1 19:32:30 2004 UTC (19 years, 10 months ago) by mycroft
Branch: MAIN
Changes since 1.179: +6 -19 lines
Diff to previous 1.179 (colored) to selected 1.30 (colored)

Only downgrade modes due to an actual CRC error.  Downgrading on other errors
is anti-social -- especially given that there's no way to upgrade again short
of rebooting.

Also, downgrade UDMA modes more slowly.  It's entirely possible that they're
using an 80-wire cable, but it's just too long for the higher modes, or there
is minor crosstalk.

Revision 1.172.2.3 / (download) - annotate - [select for diffs], Sat May 29 14:10:40 2004 UTC (19 years, 10 months ago) by tron
Branch: netbsd-2-0
Changes since 1.172.2.2: +4 -2 lines
Diff to previous 1.172.2.2 (colored) to branchpoint 1.172 (colored) to selected 1.30 (colored)

Pull up revision 1.175 (requested by bouyer in ticket #397):
Add a delay(5000) between the ATAPI_SOFT_RESET and the channel reset.
Some ATAPI device never get out of busy if touched too fast after a reset.
Delay value from atapi_wdc.c; fix problem reported by Nicolas Joly on
current-users.

Revision 1.172.2.2 / (download) - annotate - [select for diffs], Sat May 29 14:08:18 2004 UTC (19 years, 10 months ago) by tron
Branch: netbsd-2-0
Changes since 1.172.2.1: +178 -67 lines
Diff to previous 1.172.2.1 (colored) to branchpoint 1.172 (colored) to selected 1.30 (colored)

Pull up revision 1.174 (requested by bouyer in ticket #397):
In wdcprobe1(), protect the register writability test with splbio().
What we do here seems to trigger interrupts on some pcmcia adapters, which
cause the kernel to hang.
Add some WDCDEBUG_PRINT((), DEBUG_PROBE).
Avoid touching registers of nonexistent drives, once we know which drive is
or is not here.
This makes the "IBM PCMCIA Portable CD-ROM Drive" (external CD drive with
PCMCIA adapter) work.

Revision 1.172.2.1 / (download) - annotate - [select for diffs], Sat May 29 14:05:54 2004 UTC (19 years, 10 months ago) by tron
Branch: netbsd-2-0
Changes since 1.172: +3 -2 lines
Diff to previous 1.172 (colored) to selected 1.30 (colored)

Pull up revision 1.173 (requested by bouyer in ticket #396):
Add a delay(10) after re-enabling interrupts in the control register.
Some controllers/drives (e.g. SataLink 3114 with WD Raptor) require
it. Should fix kern/23808 by Chris Gilbert, patch suplied by Chris Gilbert
on tech-kern, extended to all places enabling interrupts by me.

Revision 1.179 / (download) - annotate - [select for diffs], Thu May 27 16:47:35 2004 UTC (19 years, 10 months ago) by mycroft
Branch: MAIN
Changes since 1.178: +17 -17 lines
Diff to previous 1.178 (colored) to selected 1.30 (colored)

Write the registers in the proscribed order -- sector,cyllo,cylhi (LSB first
for LBA).  This make no difference with real devices, but the funky IDE
analyzer can't search properly if the order is wrong.

Revision 1.178 / (download) - annotate - [select for diffs], Thu May 27 02:23:12 2004 UTC (19 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.177: +9 -9 lines
Diff to previous 1.177 (colored) to selected 1.30 (colored)

Clean-up of use of "precomp".  It is used as "features" everywhere, so
rename the fields in wdc_command as appropriate.

Revision 1.177 / (download) - annotate - [select for diffs], Thu May 27 02:09:26 2004 UTC (19 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.176: +4 -4 lines
Diff to previous 1.176 (colored) to selected 1.30 (colored)

In wdcccommand(), load wd_features, not wd_precomp, with the features
provided by callers.

From Jordan Rhody @ Wasabi.

Revision 1.176 / (download) - annotate - [select for diffs], Tue May 25 20:42:41 2004 UTC (19 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.175: +13 -2 lines
Diff to previous 1.175 (colored) to selected 1.30 (colored)

Add the notion of "shadow registers" to the wdc driver.  These shadow
registers are registers that overlap with others on many controllers, but
which may actually be distinct on some controllers.  Right now, the two
shadows are:

- wd_status (usually overlaps wd_command)
- wd_features (usually overlaps wd_error)

Add a new helper function, wdc_init_shadow_regs(), used to initialize
the shadow register handles on controllers where they do actually overlap.

Partially from Jordan Rhody @ Wasabi Systems, Inc.

Revision 1.175 / (download) - annotate - [select for diffs], Mon May 24 20:45:30 2004 UTC (19 years, 11 months ago) by bouyer
Branch: MAIN
Changes since 1.174: +4 -2 lines
Diff to previous 1.174 (colored) to selected 1.30 (colored)

Add a delay(5000) between the ATAPI_SOFT_RESET and the channel reset.
Some ATAPI device never get out of busy if touched too fast after a reset.
Delay value from atapi_wdc.c; fix problem reported by Nicolas Joly on
current-users.

Revision 1.174 / (download) - annotate - [select for diffs], Sat May 15 17:15:09 2004 UTC (19 years, 11 months ago) by bouyer
Branch: MAIN
Changes since 1.173: +180 -69 lines
Diff to previous 1.173 (colored) to selected 1.30 (colored)

In wdcprobe1(), protect the register writability test with splbio().
What we do here seems to trigger interrupts on some pcmcia adapters, which
cause the kernel to hang.
Add some WDCDEBUG_PRINT((), DEBUG_PROBE).
Avoid touching registers of nonexistent drives, once we know which drive is
or is not here.

This makes the "IBM PCMCIA Portable CD-ROM Drive" (external CD drive with
PCMCIA adapter) work.

Revision 1.173 / (download) - annotate - [select for diffs], Sat May 8 15:03:32 2004 UTC (19 years, 11 months ago) by bouyer
Branch: MAIN
Changes since 1.172: +3 -2 lines
Diff to previous 1.172 (colored) to selected 1.30 (colored)

Add a delay(10) after re-enabling interrupts in the control register.
Some controllers/drives (e.g. SataLink 3114 with WD Raptor) require
it. Should fix kern/23808 by Chris Gilbert, patch suplied by Chris Gilbert
on tech-kern, extended to all places enabling interrupts by me.

Revision 1.114.4.4 / (download) - annotate - [select for diffs], Sun Mar 28 22:24:10 2004 UTC (20 years ago) by jmc
Branch: netbsd-1-6
Changes since 1.114.4.3: +3 -3 lines
Diff to previous 1.114.4.3 (colored) to branchpoint 1.114 (colored) next main 1.115 (colored) to selected 1.30 (colored)

Pullup patch (requested by bouyer in ticket #1637)

Wait a bit more after reset before re-enabling interrupts. PR#24904

Revision 1.172 / (download) - annotate - [select for diffs], Thu Mar 25 19:45:09 2004 UTC (20 years ago) by bouyer
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.171: +5 -2 lines
Diff to previous 1.171 (colored) to selected 1.30 (colored)

Deassert RST before re-enabling interrupts. Some drives (or controller)
require it.
From Michael van Elst in kern/24904.

Revision 1.171 / (download) - annotate - [select for diffs], Wed Jan 7 22:03:56 2004 UTC (20 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.170: +4 -2 lines
Diff to previous 1.170 (colored) to selected 1.30 (colored)

Add a comment about some code that should be cleaned up.

Revision 1.170 / (download) - annotate - [select for diffs], Sat Jan 3 23:59:58 2004 UTC (20 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.169: +4 -4 lines
Diff to previous 1.169 (colored) to selected 1.30 (colored)

More structure member namespace cleanup: thread -> ch_thread

Revision 1.169 / (download) - annotate - [select for diffs], Sat Jan 3 22:56:53 2004 UTC (20 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.168: +144 -121 lines
Diff to previous 1.168 (colored) to selected 1.30 (colored)

More wdc_channel structure member namespace cleanup:
- channel -> ch_channel
- wdc -> ch_wdc

Revision 1.168 / (download) - annotate - [select for diffs], Sat Jan 3 01:50:53 2004 UTC (20 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.167: +43 -43 lines
Diff to previous 1.167 (colored) to selected 1.30 (colored)

Rename "struct channel_softc" to "struct wdc_channel".

Revision 1.167 / (download) - annotate - [select for diffs], Thu Jan 1 21:18:28 2004 UTC (20 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.166: +25 -26 lines
Diff to previous 1.166 (colored) to selected 1.30 (colored)

Tidy this file up a little.

Revision 1.166 / (download) - annotate - [select for diffs], Thu Jan 1 20:25:22 2004 UTC (20 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.165: +4 -4 lines
Diff to previous 1.165 (colored) to selected 1.30 (colored)

Prepend "wdc_" to wait_for_drq, wait_for_unbusy, and wait_for_ready.

Revision 1.165 / (download) - annotate - [select for diffs], Thu Jan 1 17:18:53 2004 UTC (20 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.164: +59 -57 lines
Diff to previous 1.164 (colored) to selected 1.30 (colored)

Rename:
- wdc_xfer to ata_xfer
- channel_queue to ata_queue
and move them to <dev/ata/atavar.h> so they can be used by non-wdc ATA
controllers.  Clean up the member names of these structures while at it.

Revision 1.164 / (download) - annotate - [select for diffs], Tue Dec 30 17:18:11 2003 UTC (20 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.163: +36 -26 lines
Diff to previous 1.163 (colored) to selected 1.30 (colored)

Move the drive probing code out of atabusconfig() and into a new
wdc_drvprobe() function.  wdc_drvprobe() is used if the controller
does not specify a custom one prior to calling wdcattach().  The
WDC_CAPABILITY_DRVPROBE bit is gone.

Revision 1.163 / (download) - annotate - [select for diffs], Tue Dec 30 16:40:12 2003 UTC (20 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.162: +49 -103 lines
Diff to previous 1.162 (colored) to selected 1.30 (colored)

Use ANSI function decls.

Revision 1.162 / (download) - annotate - [select for diffs], Tue Dec 30 16:28:37 2003 UTC (20 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.161: +23 -292 lines
Diff to previous 1.161 (colored) to selected 1.30 (colored)

Move most of the atabus layer into ata.c.

Revision 1.161 / (download) - annotate - [select for diffs], Mon Dec 15 00:27:13 2003 UTC (20 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.160: +9 -3 lines
Diff to previous 1.160 (colored) to selected 1.30 (colored)

Add a (*drv_probe)() optional callback into the driver to probe for
drives on a channel.  Drivers should provide this if they have some
sort of intelligent probing mechanism.

Revision 1.160 / (download) - annotate - [select for diffs], Sun Dec 14 18:51:10 2003 UTC (20 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.159: +6 -6 lines
Diff to previous 1.159 (colored) to selected 1.30 (colored)

Rename __wdcprobe() to wdcprobe1().

Revision 1.159 / (download) - annotate - [select for diffs], Sun Dec 14 05:35:06 2003 UTC (20 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.158: +2 -3 lines
Diff to previous 1.158 (colored) to selected 1.30 (colored)

No need to include wdvar.h anymore.

Revision 1.158 / (download) - annotate - [select for diffs], Sat Nov 29 16:17:31 2003 UTC (20 years, 4 months ago) by he
Branch: MAIN
Changes since 1.157: +3 -3 lines
Diff to previous 1.157 (colored) to selected 1.30 (colored)

Patterned after the rest of the code, add one more check that
chp->wdc is non-null before de-referencing it.

Revision 1.157 / (download) - annotate - [select for diffs], Thu Nov 27 23:02:40 2003 UTC (20 years, 4 months ago) by fvdl
Branch: MAIN
Changes since 1.156: +161 -133 lines
Diff to previous 1.156 (colored) to selected 1.30 (colored)

There are some cards that map the ATA control and IDE DMA registers
in a different fashion. Individually, they have the same functionality,
but their layout is different. An example of such a chipset is
the Promise 203xx.

To be able to deal with this, transform the cmd and dma bus_space handles
into an array of handles, each seperately created with bus_space_subregion.
The code generated by using the extra indirection shouldn't change much,
since the extra indirection is negated by having the offset calculation
already done in bus_space_subregion. E.g.

	bus_space_write_4(tag, handle, offset, value)

becomes

	bus_space_write_4(tag, handles[offset], 0, value)

Reviewed by Manuel Bouyer. Tested on wdc_isa, wdc_pcmcia, viaide, piixide (i386)
and on cmdide (sparc64).

Revision 1.156 / (download) - annotate - [select for diffs], Tue Nov 25 21:03:15 2003 UTC (20 years, 4 months ago) by bouyer
Branch: MAIN
Changes since 1.155: +17 -2 lines
Diff to previous 1.155 (colored) to selected 1.30 (colored)

Some combination of controller/drive sends a continous stream of
interrupt while SRST is asserted. Work around by blocking interrupts while
SRST is asserted, and clearing any pending interrupt before unblocking.
Fix kern/23529 from Michael Hertrick.

Revision 1.155 / (download) - annotate - [select for diffs], Mon Nov 17 20:01:35 2003 UTC (20 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.154: +9 -5 lines
Diff to previous 1.154 (colored) to selected 1.30 (colored)

Clear DRIVE_ATA|DRIVE_ATAPI for both drives only when we're sure this is
an old drive. Should fix kern/23468.
When we know there's no drive here, abort the probe and try next drive.

Revision 1.154 / (download) - annotate - [select for diffs], Thu Nov 13 22:18:10 2003 UTC (20 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.153: +5 -3 lines
Diff to previous 1.153 (colored) to selected 1.30 (colored)

If we detected an old drive on a channel, clear (ATA|ATAPI) for both
drives on the channel.

Revision 1.153 / (download) - annotate - [select for diffs], Fri Nov 7 08:58:33 2003 UTC (20 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.152: +6 -2 lines
Diff to previous 1.152 (colored) to selected 1.30 (colored)

If we already have a channel reset pending, don't try to queue a new one.
Otherwise we would bump queue_freeze several times, but the kernel thread would
decrease it only one time.
Fix PR kern/23377 by Mattias Karlsson, and should also fix similar problem
reported by Mihai CHELARU and Bruce J.A. Nourish on current-users.

Revision 1.152 / (download) - annotate - [select for diffs], Sun Nov 2 11:07:46 2003 UTC (20 years, 5 months ago) by wiz
Branch: MAIN
Changes since 1.151: +5 -5 lines
Diff to previous 1.151 (colored) to selected 1.30 (colored)

Fix some typos. From Tom Cosgrove via jmc@openbsd.

Revision 1.151 / (download) - annotate - [select for diffs], Fri Oct 31 21:25:09 2003 UTC (20 years, 5 months ago) by briggs
Branch: MAIN
Changes since 1.150: +4 -3 lines
Diff to previous 1.150 (colored) to selected 1.30 (colored)

Use aprint_*(9) instead of printf() in attach routines.

Revision 1.150 / (download) - annotate - [select for diffs], Thu Oct 30 01:58:17 2003 UTC (20 years, 5 months ago) by simonb
Branch: MAIN
Changes since 1.149: +3 -4 lines
Diff to previous 1.149 (colored) to selected 1.30 (colored)

Remove some assigned-to but otherwise unused variables.

Revision 1.149 / (download) - annotate - [select for diffs], Wed Oct 29 22:09:41 2003 UTC (20 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.148: +5 -10 lines
Diff to previous 1.148 (colored) to selected 1.30 (colored)

Remove check for the error register value at probe time. There have been report
on -current-users of some drives not returning the proper value here.
This shouldn't affect the probe time for the common cases.

Revision 1.148 / (download) - annotate - [select for diffs], Wed Oct 29 22:05:15 2003 UTC (20 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.147: +15 -15 lines
Diff to previous 1.147 (colored) to selected 1.30 (colored)

freese->freeze, as pointed out by Frederick Bruck.

Revision 1.147 / (download) - annotate - [select for diffs], Wed Oct 29 21:44:41 2003 UTC (20 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.146: +25 -14 lines
Diff to previous 1.146 (colored) to selected 1.30 (colored)

- test if we have some work to do before tsleep() in the kernel thread,
  in case the previous loop scheduled some more work to do (e.g. reset)
- use queue_freese to block the queue when a reset is pending too
- Avoid using WDCF_TH_RUN in some place that can be called from callout.
  If the kernel thread is tsleep()ing somewhere, we may come here with
  WDCF_TH_RUN set while being in the callout context. Fix a panic() in
  tsleep() reported by Chuck Silvers.
- Use AT_WAIT instead of WDCF_TH_RUN wdcwait(), as we may not be in the
  channel's thread context but still be able to tsleep(). Fix queue_freese
  panics for WDC_CAPABILITY_NOIRQ controllers (port-mac68k/23208 by
  Frederick Bruck).

Revision 1.146 / (download) - annotate - [select for diffs], Sat Oct 25 08:37:00 2003 UTC (20 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.145: +5 -5 lines
Diff to previous 1.145 (colored) to selected 1.30 (colored)

more uninitialized variables

Revision 1.145 / (download) - annotate - [select for diffs], Sat Oct 25 08:30:46 2003 UTC (20 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.144: +3 -3 lines
Diff to previous 1.144 (colored) to selected 1.30 (colored)

fix uninitialized variables

Revision 1.144 / (download) - annotate - [select for diffs], Wed Oct 22 23:59:00 2003 UTC (20 years, 6 months ago) by briggs
Branch: MAIN
Changes since 1.143: +17 -8 lines
Diff to previous 1.143 (colored) to selected 1.30 (colored)

Avoid a race condition that could allow a removable controller (such as
a compact flash card) to lock the atabus thread if it gets detached during
the probe process.

Revision 1.143 / (download) - annotate - [select for diffs], Wed Oct 15 20:29:26 2003 UTC (20 years, 6 months ago) by bouyer
Branch: MAIN
Changes since 1.142: +4 -4 lines
Diff to previous 1.142 (colored) to selected 1.30 (colored)

Make sure chp->atabus is initialised, and wakeup the right address when
shutting down the kernel thread.

Revision 1.142 / (download) - annotate - [select for diffs], Wed Oct 15 20:26:33 2003 UTC (20 years, 6 months ago) by bouyer
Branch: MAIN
Changes since 1.141: +4 -6 lines
Diff to previous 1.141 (colored) to selected 1.30 (colored)

- don't ignore last bit when checking for floating bus value on slave
  device; some ATAPI devices as master will report 0x7f in all registers
  for slave before reset
- For the same reason, remove the er1 check.
Makes slave device with a "strange" ATAPI master probe again.
Problem reported and fix tested by Gary Duzan on current-users.

Revision 1.141 / (download) - annotate - [select for diffs], Wed Oct 15 19:54:30 2003 UTC (20 years, 6 months ago) by bouyer
Branch: MAIN
Changes since 1.140: +8 -4 lines
Diff to previous 1.140 (colored) to selected 1.30 (colored)

Clear chp->ch_drive[i].drive_flags if we didn't find a driver for the
drive.

Revision 1.140 / (download) - annotate - [select for diffs], Sun Oct 12 19:28:50 2003 UTC (20 years, 6 months ago) by bouyer
Branch: MAIN
Changes since 1.139: +2 -7 lines
Diff to previous 1.139 (colored) to selected 1.30 (colored)

Remove block that has been pasted twice. Pointed out by Alexander Yurchenko.

Revision 1.139 / (download) - annotate - [select for diffs], Thu Oct 9 18:40:19 2003 UTC (20 years, 6 months ago) by bouyer
Branch: MAIN
Changes since 1.138: +3 -17 lines
Diff to previous 1.138 (colored) to selected 1.30 (colored)

Remove the check for WAIT+POLL+READ case in __wdccommand_start(),
this case is already handled in __wdccommand_intr().
Pointed out by Charles M. Hannum.

Revision 1.138 / (download) - annotate - [select for diffs], Wed Oct 8 20:58:00 2003 UTC (20 years, 6 months ago) by bouyer
Branch: MAIN
Changes since 1.137: +4 -4 lines
Diff to previous 1.137 (colored) to selected 1.30 (colored)

Following Matt Thomas's request, rename ata attribute to ata_hl, and
wdc_base to ata. We can now have
atabus* at ata?
in kernel config files.

Revision 1.137 / (download) - annotate - [select for diffs], Wed Oct 8 10:58:12 2003 UTC (20 years, 6 months ago) by bouyer
Branch: MAIN
Changes since 1.136: +719 -362 lines
Diff to previous 1.136 (colored) to selected 1.30 (colored)

Make the ATA mid-layer appears as atabus, as proposed in
http://mail-index.netbsd.org/tech-kern/2003/09/25/0006.html
This adds a device (atabus) between IDE controllers and wd or atapibus, to
have each ATA channel show up in the device tree. Later there will be atabus
devices in /dev, so that we can do IOCTL on them.
Each atabus has its own kernel thread, to handle operations that needs polling,
e.g. reset and others.

Device probing on each bus it defered to the atabus thread creation.
This allows to do the reset and basic device probes in parallel, which reduce
boot time on systems with several pciide controllers.

Revision 1.136 / (download) - annotate - [select for diffs], Wed Oct 8 08:47:58 2003 UTC (20 years, 6 months ago) by mycroft
Branch: MAIN
Changes since 1.135: +2 -27 lines
Diff to previous 1.135 (colored) to selected 1.30 (colored)

We really don't need to do 2 resets in wdc_channel_attach() -- the one done
by wdcprobe() is enough.

Revision 1.135 / (download) - annotate - [select for diffs], Mon Oct 6 21:51:31 2003 UTC (20 years, 6 months ago) by bouyer
Branch: MAIN
Changes since 1.134: +24 -15 lines
Diff to previous 1.134 (colored) to selected 1.30 (colored)

Revert to polling for ata_get_params() in wdc_channel_attach().
When probing a nonexistent slave, we may timeout waiting for an interrupt.
In __wdccommand_start(), for polled data in commands, abort quickly if
status still read 0 after 400ns (for a nonexistant slave, the
command will either be aborted, or the status register will report 0; for
a real device we should have BSY, DRQ or ERR).
Thanks to Alexander Yurchenko for reporting the problem and testing the
fix.

Revision 1.91.2.5 / (download) - annotate - [select for diffs], Mon Oct 6 09:24:57 2003 UTC (20 years, 6 months ago) by itojun
Branch: netbsd-1-5
Changes since 1.91.2.4: +2 -2 lines
Diff to previous 1.91.2.4 (colored) to branchpoint 1.91 (colored) next main 1.92 (colored) to selected 1.30 (colored)

Fix a typo that prevented pre-ata drives from working since 1999.
[ticket #85, bouyer]

Revision 1.134 / (download) - annotate - [select for diffs], Thu Sep 25 19:29:49 2003 UTC (20 years, 6 months ago) by mycroft
Branch: MAIN
Changes since 1.133: +29 -4 lines
Diff to previous 1.133 (colored) to selected 1.30 (colored)

Hide the use of config_interrupts() in one place.

Revision 1.133 / (download) - annotate - [select for diffs], Thu Sep 25 09:38:09 2003 UTC (20 years, 6 months ago) by bouyer
Branch: MAIN
Changes since 1.132: +5 -4 lines
Diff to previous 1.132 (colored) to selected 1.30 (colored)

Don't print modes we are using if we don't know which modes are really used.

Revision 1.114.4.3 / (download) - annotate - [select for diffs], Wed Sep 24 11:16:43 2003 UTC (20 years, 7 months ago) by tron
Branch: netbsd-1-6
CVS Tags: netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002
Changes since 1.114.4.2: +1 -1 lines
Diff to previous 1.114.4.2 (colored) to branchpoint 1.114 (colored) to selected 1.30 (colored)

Pull up revision 1.132 (requested by bouyer in ticket #1481):
Fix a typo that prevented pre-ata drives from working since 1999.

Revision 1.132 / (download) - annotate - [select for diffs], Tue Sep 23 16:27:10 2003 UTC (20 years, 7 months ago) by bouyer
Branch: MAIN
Changes since 1.131: +3 -3 lines
Diff to previous 1.131 (colored) to selected 1.30 (colored)

Fix a typo that prevented pre-ata drives from working since 1999.

Revision 1.131 / (download) - annotate - [select for diffs], Tue Sep 23 09:19:23 2003 UTC (20 years, 7 months ago) by mycroft
Branch: MAIN
Changes since 1.130: +52 -65 lines
Diff to previous 1.130 (colored) to selected 1.30 (colored)

Fix more probe delay and/or failure problems:
1) Don't wait for DRQ on an IDENTIFY command -- if it's not set when we see
   BSY clear, abort the command and ignore the drive.  (Do this by testing
   for DRQ in the read/write cases in __wdccommand_intr().)
2) Don't wait for DRQ to deassert when we finish an IDENTIFY (or any other
   non-block command that reads data) -- we don't do this for block I/O, and
   empirically it doesn't clear on my CF cards at all, causing a pointless 1s
   delay.
3) Add comments to some of the delay()s, and add missing ones in wdcreset()
   and the WDCC_RECAL in the so-called "pre-ATA" probe.
4) Slightly simplify the reset sequence -- we were doing an extra I/O.
5) Modify the register writability test to make sure that registers are not
   overlapped -- this can happen in some weird cases with a missing device 1.
6) Check the error register value after the reset -- if it's not 01h or 81h,
   as appropriate (see ATA spec), punt.
Tested with a number of ATA-only, ATAPI-only, mixed ATA-ATAPI, CF, and IDE
disk configurations.

Also remove the SINGLE_DRIVE nonsense again.

Revision 1.130 / (download) - annotate - [select for diffs], Sun Sep 21 11:56:40 2003 UTC (20 years, 7 months ago) by enami
Branch: MAIN
Changes since 1.129: +4 -4 lines
Diff to previous 1.129 (colored) to selected 1.30 (colored)

Correctly resurrect the style in previous.  While I'm here, also removed
whitespace at the end of line in comment.

Revision 1.129 / (download) - annotate - [select for diffs], Sun Sep 21 11:14:00 2003 UTC (20 years, 7 months ago) by bouyer
Branch: MAIN
Changes since 1.128: +19 -2 lines
Diff to previous 1.128 (colored) to selected 1.30 (colored)

Since we can't detect ghost drives in the wdc back-end, resurect
WDC_CAPABILITY_SINGLE_DRIVE.

Revision 1.128 / (download) - annotate - [select for diffs], Sat Sep 20 21:42:47 2003 UTC (20 years, 7 months ago) by bouyer
Branch: MAIN
Changes since 1.127: +2 -25 lines
Diff to previous 1.127 (colored) to selected 1.30 (colored)

Remove the "Register ghost test". It won't work, because on ATA register
of both devices are written, and device 0 will respond for device 1 if
device 1 isn't present. Pointed out by Quentin Garnier.
So the only way to know if device 1 is there or not is to send a command, which
is done later.
Detecting the second device here isn't important and won't speed up the probe.
We just need to know if there is at last one device on the bus.

Fix PR kern/22869 from Julio M. Merino Vidal.

Revision 1.127 / (download) - annotate - [select for diffs], Sat Sep 20 07:07:39 2003 UTC (20 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.126: +4 -3 lines
Diff to previous 1.126 (colored) to selected 1.30 (colored)

print the name of the driver that found the ghost

Revision 1.126 / (download) - annotate - [select for diffs], Sat Sep 20 02:19:36 2003 UTC (20 years, 7 months ago) by enami
Branch: MAIN
Changes since 1.125: +10 -9 lines
Diff to previous 1.125 (colored) to selected 1.30 (colored)

Now wdcattach() is called interrupts enabled, config_interrupts() tries to
call ata_raid_check_component() immediately, and panics since DMA setup
isn't done yet.  So, defer the call until attach stage is almost done.
Tested with Promise TX2000.

Revision 1.125 / (download) - annotate - [select for diffs], Fri Sep 19 21:36:02 2003 UTC (20 years, 7 months ago) by mycroft
Branch: MAIN
Changes since 1.124: +118 -43 lines
Diff to previous 1.124 (colored) to selected 1.30 (colored)

1) Use config_interrupts() to attach IDE and ATAPI drives.  This eliminates
   most polling.
2) Clean up some goofiness in pciide -- get rid of the whole "candisable" path
   (it's gratuitous) and simplify the code by calling pciide_map_compat_intr(),
   *_set_modes() and wdc_print_modes() from central locations.
3) Add a register writability and register ghost test to eliminate phantom
   drives more quickly.

Revision 1.124 / (download) - annotate - [select for diffs], Wed Sep 17 11:56:19 2003 UTC (20 years, 7 months ago) by drochner
Branch: MAIN
Changes since 1.123: +3 -3 lines
Diff to previous 1.123 (colored) to selected 1.30 (colored)

typo in comment

Revision 1.123 / (download) - annotate - [select for diffs], Sat May 17 21:52:04 2003 UTC (20 years, 11 months ago) by thorpej
Branch: MAIN
Branch point for: ktrace-lwp
Changes since 1.122: +31 -26 lines
Diff to previous 1.122 (colored) to selected 1.30 (colored)

* Use aprint*().
* Add Ultra/133 to wdc_print_modes().

Revision 1.122 / (download) - annotate - [select for diffs], Mon Jan 27 18:21:25 2003 UTC (21 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.121: +16 -5 lines
Diff to previous 1.121 (colored) to selected 1.30 (colored)

Experimental support for RAID volumes configured by ATA "RAID" controllers.
Such RAID controllers are actually just IDE controllers with a BIOS that
can create RAID volumes and write the configuration info to config blocks
on the disks.  The BIOS can do I/O to these volumes, and the OS must
understand the config blocks and implement RAID in software in order to be
able to use these volumes.

Only SPAN (simple concatenation) and RAID0 are supported at this time,
and writing back config blocks is also not supported at this time.  Currently,
only the Promise configuration scheme is supported, although supporting
the Highpoint scheme should not be too difficult.

In any case, this is sufficient to use the Promise RAID0 volume (thus
preserving the win2k AS installation) on this new Intel server I have.

Thanks to Soren Schmidt for doing the work in FreeBSD; it made this
task much easier.  The config block parsing code is adapted from his
work.

Revision 1.91.2.4 / (download) - annotate - [select for diffs], Thu Jan 23 08:23:14 2003 UTC (21 years, 3 months ago) by msaitoh
Branch: netbsd-1-5
Changes since 1.91.2.3: +33 -1 lines
Diff to previous 1.91.2.3 (colored) to branchpoint 1.91 (colored) to selected 1.30 (colored)

Pull up revision 1.114 (requested by Manuel Bouyer):

 read status after data commands in wdc_exec_command(). Mandatory for data out
 commands (nonw are used for now), and doesn't hurt for data in. Also keep
 track if we did transfer data. Makes the probe more robust and solves
 kern/16159

Revision 1.121 / (download) - annotate - [select for diffs], Mon Jan 20 07:34:37 2003 UTC (21 years, 3 months ago) by simonb
Branch: MAIN
Changes since 1.120: +3 -4 lines
Diff to previous 1.120 (colored) to selected 1.30 (colored)

Remove variable that is only assigned too but not referenced.

Revision 1.94.2.16 / (download) - annotate - [select for diffs], Fri Jan 3 17:07:42 2003 UTC (21 years, 3 months ago) by thorpej
Branch: nathanw_sa
CVS Tags: nathanw_sa_end
Changes since 1.94.2.15: +4 -4 lines
Diff to previous 1.94.2.15 (colored) next main 1.95 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.120 / (download) - annotate - [select for diffs], Wed Jan 1 00:10:19 2003 UTC (21 years, 3 months ago) by thorpej
Branch: MAIN
CVS Tags: nathanw_sa_before_merge, nathanw_sa_base, fvdl_fs64_base
Changes since 1.119: +4 -4 lines
Diff to previous 1.119 (colored) to selected 1.30 (colored)

Use aprint_normal() in cfprint routines.

Revision 1.94.2.15 / (download) - annotate - [select for diffs], Wed Dec 11 06:38:02 2002 UTC (21 years, 4 months ago) by thorpej
Branch: nathanw_sa
Changes since 1.94.2.14: +1 -1 lines
Diff to previous 1.94.2.14 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.119 / (download) - annotate - [select for diffs], Fri Dec 6 14:05:34 2002 UTC (21 years, 4 months ago) by drochner
Branch: MAIN
CVS Tags: gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw
Changes since 1.118: +3 -3 lines
Diff to previous 1.118 (colored) to selected 1.30 (colored)

typo in comment

Revision 1.114.4.2 / (download) - annotate - [select for diffs], Fri Nov 1 16:26:23 2002 UTC (21 years, 5 months ago) by tron
Branch: netbsd-1-6
CVS Tags: netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001
Changes since 1.114.4.1: +2 -0 lines
Diff to previous 1.114.4.1 (colored) to branchpoint 1.114 (colored) to selected 1.30 (colored)

Pull up revision 1.117 (requested by bouyer in ticket #726):
Add support for Ultra/133 (ultra-DMA6) in wdc_probe_caps().

Revision 1.94.2.14 / (download) - annotate - [select for diffs], Fri Oct 18 02:42:02 2002 UTC (21 years, 6 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.94.2.13: +2 -2 lines
Diff to previous 1.94.2.13 (colored) to selected 1.30 (colored)

Catch up to -current.

Revision 1.98.2.6 / (download) - annotate - [select for diffs], Thu Oct 10 18:39:16 2002 UTC (21 years, 6 months ago) by jdolecek
Branch: kqueue
Changes since 1.98.2.5: +4 -4 lines
Diff to previous 1.98.2.5 (colored) to branchpoint 1.98 (colored) next main 1.99 (colored) to selected 1.30 (colored)

sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work

Revision 1.118 / (download) - annotate - [select for diffs], Fri Sep 27 15:37:20 2002 UTC (21 years, 6 months ago) by provos
Branch: MAIN
CVS Tags: kqueue-beforemerge, kqueue-base, kqueue-aftermerge
Changes since 1.117: +4 -4 lines
Diff to previous 1.117 (colored) to selected 1.30 (colored)

remove trailing \n in panic().  approved perry.

Revision 1.98.2.5 / (download) - annotate - [select for diffs], Fri Sep 6 08:44:40 2002 UTC (21 years, 7 months ago) by jdolecek
Branch: kqueue
Changes since 1.98.2.4: +6 -4 lines
Diff to previous 1.98.2.4 (colored) to branchpoint 1.98 (colored) to selected 1.30 (colored)

sync kqueue branch with HEAD

Revision 1.114.2.2 / (download) - annotate - [select for diffs], Thu Aug 29 05:22:33 2002 UTC (21 years, 7 months ago) by gehenna
Branch: gehenna-devsw
Changes since 1.114.2.1: +6 -4 lines
Diff to previous 1.114.2.1 (colored) to branchpoint 1.114 (colored) next main 1.115 (colored) to selected 1.30 (colored)

catch up with -current.

Revision 1.94.2.13 / (download) - annotate - [select for diffs], Tue Aug 27 23:46:44 2002 UTC (21 years, 7 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.94.2.12: +2 -0 lines
Diff to previous 1.94.2.12 (colored) to selected 1.30 (colored)

Catch up to -current.

Revision 1.117 / (download) - annotate - [select for diffs], Sun Aug 25 17:22:38 2002 UTC (21 years, 7 months ago) by bouyer
Branch: MAIN
CVS Tags: gehenna-devsw-base
Changes since 1.116: +4 -2 lines
Diff to previous 1.116 (colored) to selected 1.30 (colored)

Add support for Ultra/133 (ultra-DMA6) in wdc_probe_caps().

Revision 1.94.2.12 / (download) - annotate - [select for diffs], Thu Aug 1 02:44:50 2002 UTC (21 years, 8 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.94.2.11: +4 -4 lines
Diff to previous 1.94.2.11 (colored) to selected 1.30 (colored)

Catch up to -current.

Revision 1.116 / (download) - annotate - [select for diffs], Fri Jul 26 14:10:22 2002 UTC (21 years, 8 months ago) by wiz
Branch: MAIN
Changes since 1.115: +4 -4 lines
Diff to previous 1.115 (colored) to selected 1.30 (colored)

Two typos in comments.

Revision 1.98.2.4 / (download) - annotate - [select for diffs], Sun Jun 23 17:46:56 2002 UTC (21 years, 10 months ago) by jdolecek
Branch: kqueue
Changes since 1.98.2.3: +37 -3 lines
Diff to previous 1.98.2.3 (colored) to branchpoint 1.98 (colored) to selected 1.30 (colored)

catch up with -current on kqueue branch

Revision 1.114.2.1 / (download) - annotate - [select for diffs], Thu Jun 20 16:33:21 2002 UTC (21 years, 10 months ago) by gehenna
Branch: gehenna-devsw
Changes since 1.114: +3 -3 lines
Diff to previous 1.114 (colored) to selected 1.30 (colored)

catch up with -current.

Revision 1.94.2.11 / (download) - annotate - [select for diffs], Thu Jun 20 03:45:06 2002 UTC (21 years, 10 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.94.2.10: +3 -3 lines
Diff to previous 1.94.2.10 (colored) to selected 1.30 (colored)

Catch up to -current.

Revision 1.114.4.1 / (download) - annotate - [select for diffs], Thu Jun 13 02:35:20 2002 UTC (21 years, 10 months ago) by lukem
Branch: netbsd-1-6
CVS Tags: netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1
Changes since 1.114: +3 -3 lines
Diff to previous 1.114 (colored) to selected 1.30 (colored)

Pull up revision 1.115 (requested by bouyer in ticket #256):
Bump delay() between reset and IDENTIFY from 100 to 5000. Some ATAPI devices
wedge when talking to them too soon, and incorrectly react to WDC_RESET.
Close PR kern/17208 by Paul Goyette.

Revision 1.115 / (download) - annotate - [select for diffs], Wed Jun 12 09:55:47 2002 UTC (21 years, 10 months ago) by bouyer
Branch: MAIN
Changes since 1.114: +3 -3 lines
Diff to previous 1.114 (colored) to selected 1.30 (colored)

Bump delay() between reset and IDENTIFY from 100 to 5000. Some ATAPI devices
wedge when talking to them too soon, and incorrectly react to WDC_RESET.
Close PR kern/17208 by Paul Goyette.

Revision 1.94.2.10 / (download) - annotate - [select for diffs], Wed Apr 17 00:05:52 2002 UTC (22 years ago) by nathanw
Branch: nathanw_sa
Changes since 1.94.2.9: +34 -0 lines
Diff to previous 1.94.2.9 (colored) to selected 1.30 (colored)

Catch up to -current.

Revision 1.114 / (download) - annotate - [select for diffs], Tue Apr 9 21:17:54 2002 UTC (22 years ago) by bouyer
Branch: MAIN
CVS Tags: netbsd-1-6-base
Branch point for: netbsd-1-6, gehenna-devsw
Changes since 1.113: +34 -2 lines
Diff to previous 1.113 (colored) to selected 1.30 (colored)

In wdc_exec_command(), for data commands, read the status register after
the data transfer. This is mandatory for data out commands (although none are
used for now), and not forbiddend for data in commands. Also record if we
did transfers any data.
May solve kern/16159 by making the probe more robust in face of fake identify.

Revision 1.94.2.9 / (download) - annotate - [select for diffs], Mon Apr 1 07:45:44 2002 UTC (22 years ago) by nathanw
Branch: nathanw_sa
Changes since 1.94.2.8: +3 -6 lines
Diff to previous 1.94.2.8 (colored) to selected 1.30 (colored)

Catch up to -current.
(CVS: It's not just a program. It's an adventure!)

Revision 1.113 / (download) - annotate - [select for diffs], Thu Mar 28 22:51:58 2002 UTC (22 years ago) by bouyer
Branch: MAIN
Changes since 1.112: +4 -2 lines
Diff to previous 1.112 (colored) to selected 1.30 (colored)

In wdcintr(), it !WDCF_IRQ_WAIT, read the status register anyway to clear a
possible pending interrupt. This should avoid the interrupt loop described
in PR kern/15841.
It is safe to read status here, because if we're not waiting for an interrupt
we have no command pending, so the device should be idle.

Revision 1.98.2.3 / (download) - annotate - [select for diffs], Sat Mar 16 16:01:03 2002 UTC (22 years, 1 month ago) by jdolecek
Branch: kqueue
Changes since 1.98.2.2: +3 -6 lines
Diff to previous 1.98.2.2 (colored) to branchpoint 1.98 (colored) to selected 1.30 (colored)

Catch up with -current.

Revision 1.112 / (download) - annotate - [select for diffs], Fri Mar 8 20:48:38 2002 UTC (22 years, 1 month ago) by thorpej
Branch: MAIN
CVS Tags: newlock-base, newlock, eeh-devprop-base, eeh-devprop
Changes since 1.111: +3 -3 lines
Diff to previous 1.111 (colored) to selected 1.30 (colored)

Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.

Revision 1.111 / (download) - annotate - [select for diffs], Mon Mar 4 02:19:10 2002 UTC (22 years, 1 month ago) by simonb
Branch: MAIN
Changes since 1.110: +2 -5 lines
Diff to previous 1.110 (colored) to selected 1.30 (colored)

Don't "extern int cold;" - this is in <sys/kernel.h>.

Revision 1.94.2.8 / (download) - annotate - [select for diffs], Thu Feb 28 04:13:31 2002 UTC (22 years, 1 month ago) by nathanw
Branch: nathanw_sa
Changes since 1.94.2.7: +2 -2 lines
Diff to previous 1.94.2.7 (colored) to selected 1.30 (colored)

Catch up to -current.

Revision 1.94.2.7 / (download) - annotate - [select for diffs], Sat Feb 23 22:55:58 2002 UTC (22 years, 1 month ago) by gmcgarry
Branch: nathanw_sa
Changes since 1.94.2.6: +49 -6 lines
Diff to previous 1.94.2.6 (colored) to selected 1.30 (colored)

Merge up from -current.

Revision 1.98.2.2 / (download) - annotate - [select for diffs], Mon Feb 11 20:09:48 2002 UTC (22 years, 2 months ago) by jdolecek
Branch: kqueue
Changes since 1.98.2.1: +49 -6 lines
Diff to previous 1.98.2.1 (colored) to branchpoint 1.98 (colored) to selected 1.30 (colored)

Sync w/ -current.

Revision 1.110 / (download) - annotate - [select for diffs], Thu Jan 31 06:37:30 2002 UTC (22 years, 2 months ago) by simonb
Branch: MAIN
CVS Tags: ifpoll-base
Changes since 1.109: +3 -3 lines
Diff to previous 1.109 (colored) to selected 1.30 (colored)

White-space niggle.

Revision 1.91.2.3 / (download) - annotate - [select for diffs], Tue Jan 22 19:41:44 2002 UTC (22 years, 3 months ago) by he
Branch: netbsd-1-5
CVS Tags: netbsd-1-5-PATCH003
Changes since 1.91.2.2: +4 -4 lines
Diff to previous 1.91.2.2 (colored) to branchpoint 1.91 (colored) to selected 1.30 (colored)

Pull up revision 1.109 (via patch, requested by bouyer):
  Don't try to use chp->wdc if it's NULL.  Fixes PR#15307.

Revision 1.91.2.2 / (download) - annotate - [select for diffs], Wed Jan 16 10:15:30 2002 UTC (22 years, 3 months ago) by he
Branch: netbsd-1-5
Changes since 1.91.2.1: +34 -1 lines
Diff to previous 1.91.2.1 (colored) to branchpoint 1.91 (colored) to selected 1.30 (colored)

Pull up revision 1.107 (via patch, requested by dbj):
  Add UDMA support and allow separate DMA timings to be programmed
  for two different devices on the same wdc channel on the macppc.
  The machine-independent driver is updated to optionally use the
  WDC_CAPABILITY_SELECT callback whenever a target is selected on
  a channel.

Revision 1.109 / (download) - annotate - [select for diffs], Mon Jan 14 21:51:35 2002 UTC (22 years, 3 months ago) by bouyer
Branch: MAIN
Changes since 1.108: +5 -5 lines
Diff to previous 1.108 (colored) to selected 1.30 (colored)

Don't use chp->wdc if it's NULL.

Revision 1.108 / (download) - annotate - [select for diffs], Sun Jan 13 17:24:28 2002 UTC (22 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.107: +45 -2 lines
Diff to previous 1.107 (colored) to selected 1.30 (colored)

Add LBA48 support based on patches from Keisuke YOSHIDA. KNF a bit while
I am there.

Revision 1.94.2.6 / (download) - annotate - [select for diffs], Fri Jan 11 23:39:01 2002 UTC (22 years, 3 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.94.2.5: +35 -2 lines
Diff to previous 1.94.2.5 (colored) to selected 1.30 (colored)

More catchup.

Revision 1.98.2.1 / (download) - annotate - [select for diffs], Thu Jan 10 19:55:09 2002 UTC (22 years, 3 months ago) by thorpej
Branch: kqueue
Changes since 1.98: +80 -38 lines
Diff to previous 1.98 (colored) to selected 1.30 (colored)

Sync kqueue branch with -current.

Revision 1.94.2.5 / (download) - annotate - [select for diffs], Tue Jan 8 00:30:11 2002 UTC (22 years, 3 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.94.2.4: +42 -38 lines
Diff to previous 1.94.2.4 (colored) to selected 1.30 (colored)

Catch up to -current.

Revision 1.107 / (download) - annotate - [select for diffs], Mon Jan 7 22:11:17 2002 UTC (22 years, 3 months ago) by dbj
Branch: MAIN
Changes since 1.106: +35 -2 lines
Diff to previous 1.106 (colored) to selected 1.30 (colored)

Changes to the wdc(4) mi driver that add the WDC_CAPABILITY_SELECT
flag and a callback function which gets called whenever a target is
selected on a channel.

The macppc wdc driver needs to reprogram its timing register
differently for each target on a channel each time that target is
selected.  I also changed the ATA4_TIME_TO_TICK to use a divisor of
15, which brings our timing calculations consistent with darwin.

These patches fix problems on my dual usb ibook with combo dvd/cdrw
drive because the hard drive supports udma and the combo drive does
not.  Without turning off the udma timings in the configuration
register, I cannot access the non-udma combo drive.

Revision 1.91.2.1 / (download) - annotate - [select for diffs], Sat Jan 5 18:03:30 2002 UTC (22 years, 3 months ago) by he
Branch: netbsd-1-5
Changes since 1.91: +5 -1 lines
Diff to previous 1.91 (colored) to selected 1.30 (colored)

Pull up revision 1.101 (requested by bouyer):
  Do not allow forcing Ultra-DMA via config flags if the controller
  does not support it.

Revision 1.106 / (download) - annotate - [select for diffs], Wed Dec 5 20:43:00 2001 UTC (22 years, 4 months ago) by bouyer
Branch: MAIN
Changes since 1.105: +18 -3 lines
Diff to previous 1.105 (colored) to selected 1.30 (colored)

Compile with NWD == 0. Fixe kern/14844 by hamajima@nagoya.ydc.co.jp.

Revision 1.105 / (download) - annotate - [select for diffs], Mon Dec 3 11:07:34 2001 UTC (22 years, 4 months ago) by enami
Branch: MAIN
Changes since 1.104: +3 -3 lines
Diff to previous 1.104 (colored) to selected 1.30 (colored)

Use correct format letter for chp->channel.

Revision 1.104 / (download) - annotate - [select for diffs], Mon Dec 3 00:20:23 2001 UTC (22 years, 4 months ago) by bouyer
Branch: MAIN
Changes since 1.103: +3 -3 lines
Diff to previous 1.103 (colored) to selected 1.30 (colored)

Update my copyrigth.

Revision 1.103 / (download) - annotate - [select for diffs], Mon Dec 3 00:11:17 2001 UTC (22 years, 4 months ago) by bouyer
Branch: MAIN
Changes since 1.102: +4 -5 lines
Diff to previous 1.102 (colored) to selected 1.30 (colored)

Allow wd to attach to something else than wdc/pciide (like USB<->ATA bridges):
- move some functions from ata.c to ata_wdc.c or wdc.c.
- add callbacks to struct ata_bustype so that wd.c doesn't call directly
  functions from the lower level driver.

Revision 1.102 / (download) - annotate - [select for diffs], Sun Dec 2 22:44:33 2001 UTC (22 years, 4 months ago) by bouyer
Branch: MAIN
Changes since 1.101: +21 -35 lines
Diff to previous 1.101 (colored) to selected 1.30 (colored)

Clean up attach of wd/atapibus:
kill ata_atapi_attach. Change atapibus to use a struct scsipi_channel instead
of ata_atapi_attach as attach arch. Create a ata_device, compatible with
scsipi_channel, to attach wd.

Revision 1.101 / (download) - annotate - [select for diffs], Wed Nov 14 20:18:11 2001 UTC (22 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.100: +6 -2 lines
Diff to previous 1.100 (colored) to selected 1.30 (colored)

If the controller doesn't support UDMA, don't allow enabling UDMA via
config flags.

Revision 1.94.2.4 / (download) - annotate - [select for diffs], Wed Nov 14 19:14:41 2001 UTC (22 years, 5 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.94.2.3: +4 -1 lines
Diff to previous 1.94.2.3 (colored) to selected 1.30 (colored)

Catch up to -current.

Revision 1.100 / (download) - annotate - [select for diffs], Tue Nov 13 13:14:46 2001 UTC (22 years, 5 months ago) by lukem
Branch: MAIN
Changes since 1.99: +4 -1 lines
Diff to previous 1.99 (colored) to selected 1.30 (colored)

add/cleanup RCSID

Revision 1.98.4.1 / (download) - annotate - [select for diffs], Mon Oct 1 12:45:43 2001 UTC (22 years, 6 months ago) by fvdl
Branch: thorpej-devvp
Changes since 1.98: +4 -2 lines
Diff to previous 1.98 (colored) next main 1.99 (colored) to selected 1.30 (colored)

Catch up with -current.

Revision 1.94.2.3 / (download) - annotate - [select for diffs], Fri Sep 21 22:35:45 2001 UTC (22 years, 7 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.94.2.2: +4 -2 lines
Diff to previous 1.94.2.2 (colored) to selected 1.30 (colored)

Catch up to -current.

Revision 1.99 / (download) - annotate - [select for diffs], Tue Sep 18 05:32:14 2001 UTC (22 years, 7 months ago) by chs
Branch: MAIN
CVS Tags: thorpej-mips-cache-base, thorpej-mips-cache, thorpej-devvp-base3, thorpej-devvp-base2
Changes since 1.98: +4 -2 lines
Diff to previous 1.98 (colored) to selected 1.30 (colored)

in wdc_get_xfer(), avoid crashing if pool_get() fails.

Revision 1.94.2.2 / (download) - annotate - [select for diffs], Thu Jun 21 20:03:28 2001 UTC (22 years, 10 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.94.2.1: +21 -15 lines
Diff to previous 1.94.2.1 (colored) to selected 1.30 (colored)

Catch up to -current.

Revision 1.98 / (download) - annotate - [select for diffs], Wed Jun 13 18:17:38 2001 UTC (22 years, 10 months ago) by bjh21
Branch: MAIN
CVS Tags: thorpej-devvp-base, pre-chs-ubcperf, post-chs-ubcperf
Branch point for: thorpej-devvp, kqueue
Changes since 1.97: +5 -1 lines
Diff to previous 1.97 (colored) to selected 1.30 (colored)

Add explicit support for IDE and SCSI adaptors which don't support interrupts.
On such adaptors, all transfers are done in polling mode.

OK'ed by Manuel on tech-kern.

Revision 1.97 / (download) - annotate - [select for diffs], Mon Jun 11 21:18:36 2001 UTC (22 years, 10 months ago) by bjh21
Branch: MAIN
Changes since 1.96: +6 -4 lines
Diff to previous 1.96 (colored) to selected 1.30 (colored)

Add a short-circuit return from wdcprobe for IDE controllers without pullup
resistors, which return the last value written to the bus on a read.  This
makes detecting empty channels on my HCCS and D.T. Software IDE interfaces
rather faster.

Revision 1.96 / (download) - annotate - [select for diffs], Wed Apr 25 17:53:35 2001 UTC (22 years, 11 months ago) by bouyer
Branch: MAIN
Changes since 1.95: +12 -12 lines
Diff to previous 1.95 (colored) to selected 1.30 (colored)

Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
  ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
  to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
  peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
  recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
  scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
  (no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
  set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
  the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
  will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge

Revision 1.94.2.1 / (download) - annotate - [select for diffs], Mon Apr 9 01:56:33 2001 UTC (23 years ago) by nathanw
Branch: nathanw_sa
Changes since 1.94: +2 -1 lines
Diff to previous 1.94 (colored) to selected 1.30 (colored)

Catch up with -current.

Revision 1.74.2.7 / (download) - annotate - [select for diffs], Tue Mar 27 15:32:01 2001 UTC (23 years ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.74.2.6: +2 -1 lines
Diff to previous 1.74.2.6 (colored) next main 1.75 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.95 / (download) - annotate - [select for diffs], Wed Mar 21 08:44:14 2001 UTC (23 years, 1 month ago) by bouyer
Branch: MAIN
CVS Tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base
Changes since 1.94: +2 -1 lines
Diff to previous 1.94 (colored) to selected 1.30 (colored)

Add a small delay before reset at attach time, required by one old ATAPI
CD. Reported by Onno van der Linden.

Revision 1.74.2.6 / (download) - annotate - [select for diffs], Sun Feb 18 18:27:11 2001 UTC (23 years, 2 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.74.2.5: +13 -1 lines
Diff to previous 1.74.2.5 (colored) to selected 1.30 (colored)

Move atapiprint() to ic/wdc.c so that we can compile a kernel with IDE
controller but without atapibus.

Revision 1.74.2.5 / (download) - annotate - [select for diffs], Thu Jan 18 09:23:21 2001 UTC (23 years, 3 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.74.2.4: +17 -0 lines
Diff to previous 1.74.2.4 (colored) to selected 1.30 (colored)

Sync with head (for UBC+NFS fixes, mostly).

Revision 1.94 / (download) - annotate - [select for diffs], Sat Jan 6 14:55:49 2001 UTC (23 years, 3 months ago) by takemura
Branch: MAIN
Branch point for: nathanw_sa
Changes since 1.93: +18 -1 lines
Diff to previous 1.93 (colored) to selected 1.30 (colored)

Add WDC_CAPABILITY_SINGLE_DRIVE to ignore secound drive. Wdc on pcmcia will
be attached with this flag.
Some CF Card (for ex. IBM MicroDrive and SanDisk) doesn't seem to implement
drive select command. In this case, you can't eliminate ghost drive properly.
So you should use this flag to ignore the ghost by force.

Revision 1.74.2.4 / (download) - annotate - [select for diffs], Wed Nov 22 16:03:34 2000 UTC (23 years, 5 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.74.2.3: +38 -1 lines
Diff to previous 1.74.2.3 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.74.2.3 / (download) - annotate - [select for diffs], Mon Nov 20 11:41:05 2000 UTC (23 years, 5 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.74.2.2: +115 -57 lines
Diff to previous 1.74.2.2 (colored) to selected 1.30 (colored)

Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

Revision 1.93 / (download) - annotate - [select for diffs], Wed Nov 8 17:57:36 2000 UTC (23 years, 5 months ago) by wrstuden
Branch: MAIN
Changes since 1.92: +38 -1 lines
Diff to previous 1.92 (colored) to selected 1.30 (colored)

Move guts of pciide_print_modes() to wdc_print_modes() so that non-pciide
wdc drivers (like macppc's obio IDE interface) can use it. Also add
support to both wd attach line and to wdc_print_modes() to print
Ultra/{33,66,100} for respective UDMA modes (From Manuel Bouyer).

Revision 1.66.2.9 / (download) - annotate - [select for diffs], Fri Jul 7 17:33:48 2000 UTC (23 years, 9 months ago) by he
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-PATCH003
Changes since 1.66.2.8: +94 -41 lines
Diff to previous 1.66.2.8 (colored) to branchpoint 1.66 (colored) next main 1.67 (colored) to selected 1.30 (colored)

Apply patch (requested by bouyer):
  Add support for the following PCIIDE controllers:
   o AMD 756
   o CMD PCI0648 and PCI0649
   o Hightpoint HPT366
   o OPTi 82c621 (and a few of its derivatives)
   o Promise Ultra/33 and Ultra/66
   o Intel 82801 (ICH/ICH0)
  Also fix PR#10437 (detect more ATAPI devices).

Revision 1.92 / (download) - annotate - [select for diffs], Wed Jun 28 17:13:06 2000 UTC (23 years, 9 months ago) by mrg
Branch: MAIN
Changes since 1.91: +1 -3 lines
Diff to previous 1.91 (colored) to selected 1.30 (colored)

remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>

Revision 1.89.2.1 / (download) - annotate - [select for diffs], Thu Jun 22 17:06:58 2000 UTC (23 years, 10 months ago) by minoura
Branch: minoura-xpg4dl
Changes since 1.89: +6 -4 lines
Diff to previous 1.89 (colored) next main 1.90 (colored) to selected 1.30 (colored)

Sync w/ netbsd-1-5-base.

Revision 1.91 / (download) - annotate - [select for diffs], Mon Jun 12 21:10:41 2000 UTC (23 years, 10 months ago) by bouyer
Branch: MAIN
CVS Tags: netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2
Branch point for: netbsd-1-5
Changes since 1.90: +3 -1 lines
Diff to previous 1.90 (colored) to selected 1.30 (colored)

Add a callback (*irqack), for controllers that need special action to ack
the interrupt once it has been ack'd on the drive.

Revision 1.90 / (download) - annotate - [select for diffs], Sun Jun 11 17:09:34 2000 UTC (23 years, 10 months ago) by bouyer
Branch: MAIN
Changes since 1.89: +4 -4 lines
Diff to previous 1.89 (colored) to selected 1.30 (colored)

Relax condition on 'sn' for atapi probe, it can be different from 0x1 with
some controllers/devices. Fixes a problem reported by Markus Illenseer.

Revision 1.89 / (download) - annotate - [select for diffs], Fri May 12 15:00:33 2000 UTC (23 years, 11 months ago) by bouyer
Branch: MAIN
CVS Tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Changes since 1.88: +4 -5 lines
Diff to previous 1.88 (colored) to selected 1.30 (colored)

Accept any 'sc' value when probing atapi drives: with some drives, or
controllers, or combination of both, the value can be different from the
expected one after a reset.

Revision 1.88 / (download) - annotate - [select for diffs], Wed Apr 5 06:27:36 2000 UTC (24 years ago) by mrg
Branch: MAIN
Changes since 1.87: +10 -9 lines
Diff to previous 1.87 (colored) to selected 1.30 (colored)

avoid using uninitalised variables inside WDCDEBUG.

Revision 1.87 / (download) - annotate - [select for diffs], Tue Apr 4 12:43:13 2000 UTC (24 years ago) by bouyer
Branch: MAIN
Changes since 1.86: +10 -4 lines
Diff to previous 1.86 (colored) to selected 1.30 (colored)

Add checks to detect busy-waits, conditionnal on new debug flag
DEBUG_DELAY (0x40). This will print how much time we did loop in wdcwait(),
if we had to read registers more than one time.

Revision 1.86 / (download) - annotate - [select for diffs], Tue Apr 4 09:25:51 2000 UTC (24 years ago) by bouyer
Branch: MAIN
Changes since 1.85: +7 -2 lines
Diff to previous 1.85 (colored) to selected 1.30 (colored)

Better fix to previous: delay(100) before the IDENTIFY, and if it fails
delay(1000000) and retry. The 1s delay is needed for some special case only,
no need to hang the machine for that long everytime (especially for PCMCIA).

Revision 1.85 / (download) - annotate - [select for diffs], Sat Apr 1 14:50:32 2000 UTC (24 years ago) by bouyer
Branch: MAIN
Changes since 1.84: +2 -2 lines
Diff to previous 1.84 (colored) to selected 1.30 (colored)

Bump delay() from 100 to 1000000 before attempting a IDENTIFY just after a
reset - solves a problem reported by cpg@aladdin.de.

Revision 1.84 / (download) - annotate - [select for diffs], Sat Apr 1 14:32:22 2000 UTC (24 years ago) by bouyer
Branch: MAIN
Changes since 1.83: +51 -11 lines
Diff to previous 1.83 (colored) to selected 1.30 (colored)

- DMA code cleanup: pciide_dma_finish() doesn't stop/unload the current DMA op
  if an IRQ was not detected, unless the force flag was given. Use this to
  detect if the IRQ was for us (closer to shared IRQ for controllers which
  don't have their own IRQ handler in pciide.c) and to poll for DMA xfer.
  Also makes the timeout recovery code simpler.
- ATAPI cleanup: don't call controller-specific functions from atapiconf.c
  (wdc_*), so that it's possible to attach an atapibus to something else
  than a wdc/pciide (Hi Lennart :).
  Overload struct scsi_adapter with struct atapi_adapter, defined
  as struct scsi_adapter + atapi-specific callbacks. scsipi_link still points
  to an scsi_adapter, atapi code casts it to atapi_adapter if needed.
  Move atapi_softc to atapiconf.h so that it can be used by the underlying
  controller code (e.g. atapi_wdc.c).
  Add an atapi-specific callback *atapi_probedev(), which probe a drive
  in a controller-specific way, allocate the sc_link and fills in the
  ataparams if needed. It then calls atapi_probedev() (from atapiconf.c)
  to do the generic initialisations and attach the device.
- While I'm there merge and centralise the state definitions in atavar.h.
  It should now be possible to use a common ata/atapi routine to set the
  drive's modes (will do later).

Revision 1.83 / (download) - annotate - [select for diffs], Wed Mar 29 03:56:53 2000 UTC (24 years ago) by simonb
Branch: MAIN
Changes since 1.82: +1 -2 lines
Diff to previous 1.82 (colored) to selected 1.30 (colored)

Remove reduncdant decl of wdc_kill_pending - it's in <dev/ic/wdcvar.h>.

Revision 1.82 / (download) - annotate - [select for diffs], Thu Mar 23 15:04:49 2000 UTC (24 years, 1 month ago) by soren
Branch: MAIN
Changes since 1.81: +2 -2 lines
Diff to previous 1.81 (colored) to selected 1.30 (colored)

s/32-bits/32-bit/ (Hi Al!)

Revision 1.81 / (download) - annotate - [select for diffs], Thu Mar 23 07:01:33 2000 UTC (24 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.80: +7 -5 lines
Diff to previous 1.80 (colored) to selected 1.30 (colored)

New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
  resource allocation.
- Insertion and removal of callouts is constant time, important as
  this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.

Revision 1.80 / (download) - annotate - [select for diffs], Mon Mar 20 22:53:36 2000 UTC (24 years, 1 month ago) by enami
Branch: MAIN
Changes since 1.79: +9 -6 lines
Diff to previous 1.79 (colored) to selected 1.30 (colored)

- Test the generic device active flag instead of home grown one.
- Test also it in wdcintr.

Revision 1.79 / (download) - annotate - [select for diffs], Mon Feb 14 12:37:35 2000 UTC (24 years, 2 months ago) by bouyer
Branch: MAIN
Changes since 1.78: +7 -4 lines
Diff to previous 1.78 (colored) to selected 1.30 (colored)

- Be more strict in status check before sending a command (make sure
  DRQ is not asserted). Closes kern/9346.
- Change the "fake identify before the real one" by a delay(). The real cause
  of the problem is that the drive is unresponsive just after a reset.
  The real problem (and the solution) showed up after the first change.

Revision 1.66.2.8 / (download) - annotate - [select for diffs], Tue Feb 1 23:30:28 2000 UTC (24 years, 2 months ago) by he
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-PATCH002
Changes since 1.66.2.7: +7 -3 lines
Diff to previous 1.66.2.7 (colored) to branchpoint 1.66 (colored) to selected 1.30 (colored)

Pull up revision 1.71 (via patch, requested by bouyer):
  Correct a minor bug in Ultra-DMA mode printing.

Revision 1.66.2.7 / (download) - annotate - [select for diffs], Sun Jan 23 12:30:20 2000 UTC (24 years, 3 months ago) by he
Branch: netbsd-1-4
Changes since 1.66.2.6: +2 -1 lines
Diff to previous 1.66.2.6 (colored) to branchpoint 1.66 (colored) to selected 1.30 (colored)

Pull up revision 1.78 (2nd part, via patch, requested by bouyer):
  Issue a blank IDENTIFY before the real one, for drives which
  reject the first IDENTIFY after a reset.

Revision 1.66.2.6 / (download) - annotate - [select for diffs], Sun Jan 23 12:27:44 2000 UTC (24 years, 3 months ago) by he
Branch: netbsd-1-4
Changes since 1.66.2.5: +20 -3 lines
Diff to previous 1.66.2.5 (colored) to branchpoint 1.66 (colored) to selected 1.30 (colored)

Pull up revision 1.78 (partially, via patch, requested by bouyer):
  Improve the downgrade logic to work better in some cases (especially
  for Acer Labs M5229 controllers with Ultra-DMA/66 disks).

Revision 1.78 / (download) - annotate - [select for diffs], Mon Jan 17 00:01:01 2000 UTC (24 years, 3 months ago) by bouyer
Branch: MAIN
CVS Tags: chs-ubc2-newbase
Changes since 1.77: +13 -5 lines
Diff to previous 1.77 (colored) to selected 1.30 (colored)

Improve the downgrade logic:
- If UDMA 2 is failing try UDMA 1 first, it helps in some cases
- downgrade if we get an error in the first 4000 xfers, or if we get
  4 errors in 4000 xfers if the first 4000 went without troubles.

While I'm there commit a local change I have since some time to get my CD
probed: issue a "blanck" IDENTIFY before the one used to detect slave ghosts,
with my drive the first IDENTIFY following a controller reset fails with an
aborted command ...

Revision 1.74.6.1 / (download) - annotate - [select for diffs], Mon Dec 27 18:34:53 1999 UTC (24 years, 3 months ago) by wrstuden
Branch: wrstuden-devbsize
Changes since 1.74: +39 -11 lines
Diff to previous 1.74 (colored) next main 1.75 (colored) to selected 1.30 (colored)

Pull up to last week's -current.

Revision 1.66.2.1.4.1 / (download) - annotate - [select for diffs], Tue Nov 30 13:33:50 1999 UTC (24 years, 4 months ago) by itojun
Branch: kame
CVS Tags: kame_141_19991130
Changes since 1.66.2.1: +23 -2 lines
Diff to previous 1.66.2.1 (colored) next main 1.66.2.2 (colored) to selected 1.30 (colored)

bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

The branch does not compile at all (due to the lack of ALTQ and some other
source code).  Please do not try to modify the branch, this is just for
referenre purposes.

synchronization to latest KAME will take place on HEAD branch soon.

Revision 1.77 / (download) - annotate - [select for diffs], Sun Nov 28 20:04:22 1999 UTC (24 years, 4 months ago) by bouyer
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221
Changes since 1.76: +8 -8 lines
Diff to previous 1.76 (colored) to selected 1.30 (colored)

Improve a few debug messages.

Revision 1.74.4.1 / (download) - annotate - [select for diffs], Mon Nov 15 00:40:38 1999 UTC (24 years, 5 months ago) by fvdl
Branch: fvdl-softdep
Changes since 1.74: +32 -4 lines
Diff to previous 1.74 (colored) next main 1.75 (colored) to selected 1.30 (colored)

Sync with -current

Revision 1.66.2.5 / (download) - annotate - [select for diffs], Fri Oct 22 09:27:19 1999 UTC (24 years, 6 months ago) by he
Branch: netbsd-1-4
Changes since 1.66.2.4: +6 -2 lines
Diff to previous 1.66.2.4 (colored) to branchpoint 1.66 (colored) to selected 1.30 (colored)

Pull up revision 1.76 (requested by bouyer):
  The WDCF_IRQ_WAIT flag was erroneously cleared when an earlier
  interrupt not for this IDE channel controller was received.
  Fixes the "missing untimeout" problems reported in PR#8639.

Revision 1.76 / (download) - annotate - [select for diffs], Thu Oct 21 14:37:58 1999 UTC (24 years, 6 months ago) by bouyer
Branch: MAIN
CVS Tags: fvdl-softdep-base, comdex-fall-1999-base, comdex-fall-1999
Changes since 1.75: +6 -2 lines
Diff to previous 1.75 (colored) to selected 1.30 (colored)

If IRQ was not for us, add back WDCF_IRQ_WAIT to the flags, so that
the next IRQ (real or timeout) will be handled.
Fixes the 'missing untimeout' problem reported by a few peoples, and
kern/8639.

Revision 1.74.2.2 / (download) - annotate - [select for diffs], Wed Oct 20 22:33:28 1999 UTC (24 years, 6 months ago) by thorpej
Branch: thorpej_scsipi
Changes since 1.74.2.1: +27 -3 lines
Diff to previous 1.74.2.1 (colored) to selected 1.30 (colored)

Sync w/ trunk.

Revision 1.75 / (download) - annotate - [select for diffs], Wed Oct 20 15:22:26 1999 UTC (24 years, 6 months ago) by enami
Branch: MAIN
Changes since 1.74: +27 -3 lines
Diff to previous 1.74 (colored) to selected 1.30 (colored)

Cancel active transfers on aic/wdc detach.
Also makes LS-120 drive works for me again.

Revision 1.74.2.1 / (download) - annotate - [select for diffs], Tue Oct 19 17:47:43 1999 UTC (24 years, 6 months ago) by thorpej
Branch: thorpej_scsipi
Changes since 1.74: +10 -10 lines
Diff to previous 1.74 (colored) to selected 1.30 (colored)

Adapt to scsipi API changes.

Revision 1.74 / (download) - annotate - [select for diffs], Thu Sep 23 11:04:32 1999 UTC (24 years, 7 months ago) by enami
Branch: MAIN
Branch point for: wrstuden-devbsize, thorpej_scsipi, fvdl-softdep
Changes since 1.73: +124 -8 lines
Diff to previous 1.73 (colored) to selected 1.30 (colored)

Allow to detach wdc, atapibus, wd and cd.

Revision 1.73 / (download) - annotate - [select for diffs], Mon Aug 30 12:58:58 1999 UTC (24 years, 7 months ago) by bouyer
Branch: MAIN
Changes since 1.72: +12 -2 lines
Diff to previous 1.72 (colored) to selected 1.30 (colored)

If we are using UDMA mode > 2 and get a DMA error, downgrade to UDMA mode 2
first: maybe we incorrectly guessed the cable type.

Revision 1.66.2.4 / (download) - annotate - [select for diffs], Sat Aug 28 21:54:29 1999 UTC (24 years, 7 months ago) by he
Branch: netbsd-1-4
Changes since 1.66.2.3: +4 -2 lines
Diff to previous 1.66.2.3 (colored) to branchpoint 1.66 (colored) to selected 1.30 (colored)

Pull up revision 1.69:
  A mostly-stylistic change guarding tsleep() with a while() loop.  (bouyer)

Revision 1.72 / (download) - annotate - [select for diffs], Wed Aug 25 17:08:20 1999 UTC (24 years, 8 months ago) by bouyer
Branch: MAIN
Changes since 1.71: +5 -2 lines
Diff to previous 1.71 (colored) to selected 1.30 (colored)

Guard pool_get()/pool_put() with splbio()/splx(). Fix kern/8245.

Revision 1.66.2.3 / (download) - annotate - [select for diffs], Wed Aug 25 11:18:38 1999 UTC (24 years, 8 months ago) by he
Branch: netbsd-1-4
Changes since 1.66.2.2: +33 -2 lines
Diff to previous 1.66.2.2 (colored) to branchpoint 1.66 (colored) to selected 1.30 (colored)

Pull up 1.69->1.70:
  Add some debug printfs, change timeout handling to be more efficient
  and less error-prone, and fix the "lockup after lost interrupt"
  problem some users have been reporting.  (bouyer)

Revision 1.71 / (download) - annotate - [select for diffs], Mon Aug 9 09:55:18 1999 UTC (24 years, 8 months ago) by bouyer
Branch: MAIN
Changes since 1.70: +21 -44 lines
Diff to previous 1.70 (colored) to selected 1.30 (colored)

- use pool(9) for wdc_xfer, instead of managing a free list.
- fix printing of Ultra-DMA modes (shows up when the drive supports highther
  modes than the controller).
- Don't use C_NEEDDONE anymore. We were setting this flag in a possibly
  freed wdc_xfer (this didn't create problems, as it was free'd in the POLL
  case only, while IRQs are blocked, but it's not good practice anyway
  and pool(9) complains about it ;)

Revision 1.70 / (download) - annotate - [select for diffs], Fri Aug 6 12:00:25 1999 UTC (24 years, 8 months ago) by bouyer
Branch: MAIN
Changes since 1.69: +33 -2 lines
Diff to previous 1.69 (colored) to selected 1.30 (colored)

- Add some debug printf (WDCPROBE) in _wdcreset_wait(), I've needed these
  2 times in the past
- Set up timeout per xfer instead of per interrupt. This helps with
  PIO transfer (we would call timeout()/untimout() several times for a
  transfer).
- If we missed an interrupt for a PIO transfer, reset and restart it
  immedialy, don't try to recover and continue. If we missed an interrupt we
  may have lost a read/write cycle on the IDE bus. If this happens 1) we
  corrupt data and 2) we enter an interrupt loop at the end of the xfer, as
  the drive has some more data to read/write, but the host thinks the xfer is
  done.
This last change fix the (or at last some of the) 'lookup after lost interrupt'
some peoples have been experiencing.

Revision 1.66.2.1.2.3 / (download) - annotate - [select for diffs], Mon Aug 2 21:59:06 1999 UTC (24 years, 8 months ago) by thorpej
Branch: chs-ubc2
Changes since 1.66.2.1.2.2: +4 -2 lines
Diff to previous 1.66.2.1.2.2 (colored) to branchpoint 1.66.2.1 (colored) next main 1.66.2.2 (colored) to selected 1.30 (colored)

Update from trunk.

Revision 1.69 / (download) - annotate - [select for diffs], Fri Jul 30 14:59:10 1999 UTC (24 years, 8 months ago) by bouyer
Branch: MAIN
CVS Tags: chs-ubc2-base
Changes since 1.68: +4 -2 lines
Diff to previous 1.68 (colored) to selected 1.30 (colored)

Guard tsleep() with a while (!(wdc_c->flags & AT_DONE)) {}, as suggested by
Constantine Sapuntzakis confirmed by Bill Sommerfeld. Although nothing is
supposed to call wakeup on this without setting AT_DONE, it's good practice to
do it this way (the process may be waken up by a setrunnable() call).

Revision 1.66.2.1.2.2 / (download) - annotate - [select for diffs], Thu Jul 1 23:32:31 1999 UTC (24 years, 9 months ago) by thorpej
Branch: chs-ubc2
Changes since 1.66.2.1.2.1: +23 -2 lines
Diff to previous 1.66.2.1.2.1 (colored) to branchpoint 1.66.2.1 (colored) to selected 1.30 (colored)

Sync w/ -current.

Revision 1.66.2.2 / (download) - annotate - [select for diffs], Thu Jun 24 00:06:01 1999 UTC (24 years, 10 months ago) by perry
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-PATCH001
Changes since 1.66.2.1: +23 -2 lines
Diff to previous 1.66.2.1 (colored) to branchpoint 1.66 (colored) to selected 1.30 (colored)

pullup 1.67->1.68 (bouyer)

Revision 1.68 / (download) - annotate - [select for diffs], Wed Jun 23 19:00:17 1999 UTC (24 years, 10 months ago) by bouyer
Branch: MAIN
Changes since 1.67: +23 -2 lines
Diff to previous 1.67 (colored) to selected 1.30 (colored)

Resurect the old register read/write test for non-ATA/ATAPI drives, to avoid
false matches on controllers which properly respond to a WDCC_RECAL command.
Should close PR port-i386/7702 (the author tested this patch, and said it
solves his problem).

Revision 1.66.2.1.2.1 / (download) - annotate - [select for diffs], Mon Jun 21 01:17:57 1999 UTC (24 years, 10 months ago) by thorpej
Branch: chs-ubc2
Changes since 1.66.2.1: +0 -0 lines
Diff to previous 1.66.2.1 (colored) to selected 1.30 (colored)

Sync w/ -current.

Revision 1.66.2.1 / (download) - annotate - [select for diffs], Mon Apr 12 09:14:30 1999 UTC (25 years ago) by bouyer
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-RELEASE, kame_14_19990705, kame_14_19990628
Branch point for: kame, chs-ubc2
Changes since 1.66: +47 -58 lines
Diff to previous 1.66 (colored) to selected 1.30 (colored)

Sync with ic/wdc.c 1.67, ic/wdcvar.h 1.17, isa/wdc_isa.c 1.14:
Revert to a more conservative probe: it controller responded and we don't find
ATAPI signature, assume it and ATA or OLD drive (OLD is only set if the
wdc front end passed WDC_CAPABILITIES_OLD, only used for ISA front-end).
At attach time, issue an IDENTIFY to detect drives and eliminates ghosts.
If IDENTIFY failed and OLD is set, issue a RECAL to check for the presence
of old drives.
Should fix the 'disk dissapeared' problems reported by some users, including
port-arm32/7324.

Revision 1.67 / (download) - annotate - [select for diffs], Sun Apr 11 20:50:28 1999 UTC (25 years ago) by bouyer
Branch: MAIN
Changes since 1.66: +47 -58 lines
Diff to previous 1.66 (colored) to selected 1.30 (colored)

Fix probe code for IDE devices:
- Don't rely on ATA signature: some ide controllers seems to not transmit it
  properly (SIMIDE on arm32 machines). Instead, when we guess a drive is here
  after reset, just mark it as ATA and OLD is it's not ATAPI.
- at attach time, use IDENTIFY to eliminate ghost from the probe. If the
  drive had the old flag and IDENTIFY failed, issue a WDCC_RECAL command
  to detect a pre-ATA disk. If IDENTIFY succeded, remove the OLD flag,
  it's obviously not a pre-ATA disk.
- add a new controller flag, WDC_CAPABILITY_PREATA, used to shorcut parts
  of the probe (not necessary, but makes the probe/attach faster). This is
  only set by the ISA front-end, all other controllers supported can't have
  pre-ATA drives attached.
The mechanism used are more or less the same as before, they have just been
reordered. Should solve port-arm32/7324 (waiting for feedback).

Revision 1.66 / (download) - annotate - [select for diffs], Thu Apr 1 21:46:29 1999 UTC (25 years ago) by bouyer
Branch: MAIN
CVS Tags: netbsd-1-4-base
Branch point for: netbsd-1-4
Changes since 1.65: +9 -37 lines
Diff to previous 1.65 (colored) to selected 1.30 (colored)

- change the interrupt routines to take a 3rd arguments, set to 1 if we
  are called from the interrupt or timeout handler, 0 otherwise.
- use this to know if we can busy-wait for wait_for_unbusy or wait_for_ready
This fixes a bug where CDs withot the DRQ_INTR capability would not busy-wait
for the CMDOUT phase.
While I'm there change 2 delay() to DELAY() for consistency, and
garbage-collect some old code from wdcintr() which has been ifdef'd out
for some time now.

Revision 1.65 / (download) - annotate - [select for diffs], Wed Mar 31 11:18:31 1999 UTC (25 years ago) by bouyer
Branch: MAIN
Changes since 1.64: +17 -12 lines
Diff to previous 1.64 (colored) to selected 1.30 (colored)

Increase some DELAY(), this seems required on some hardware (I'm not sure if
the hardware is at fault, or if DELAY(1) waits for less than 1us).
Improve debuging messages for wdcreset_wait().

Revision 1.64 / (download) - annotate - [select for diffs], Mon Mar 29 08:32:02 1999 UTC (25 years ago) by bouyer
Branch: MAIN
Changes since 1.63: +3 -13 lines
Diff to previous 1.63 (colored) to selected 1.30 (colored)

Remove the hack to attach devices responding with ATA signatures as atapi if
IDENTIFY said so: it doesn't help for the drive this was supposed helping,
and seems to break another device.
In interrupt routine, don't return 0 if we are polling: this should fix the
"panic: wdc_exec_command: polled command not done" some people reported
(kern/7269).

Revision 1.63 / (download) - annotate - [select for diffs], Thu Mar 25 16:17:36 1999 UTC (25 years, 1 month ago) by bouyer
Branch: MAIN
Changes since 1.62: +6 -7 lines
Diff to previous 1.62 (colored) to selected 1.30 (colored)

Avoid busy-waiting when possible if we are not polling (real IRQ or timeout
callback). Shared PCI IRQ should now work (but still untested).

Revision 1.62 / (download) - annotate - [select for diffs], Wed Mar 10 13:11:43 1999 UTC (25 years, 1 month ago) by bouyer
Branch: MAIN
Changes since 1.61: +50 -18 lines
Diff to previous 1.61 (colored) to selected 1.30 (colored)

Add a new disk flag: DRIVE_OLD for pre-ATA disks. probe routine will now set
DRIVE_OLD, DRIVE_ATA or DRIVE_ATAPI based on register signatures.
The attach routine will issue a IDENTIFY command for ATA/ATAPI disk,
to detect flase matches by the probe routine.
probe/attach should now be fully compliant with ata-4/ata-5. As a side
effect, ATAPI drives which improperly use ATA register signatures should now
be attached as ATAPI.

Revision 1.61 / (download) - annotate - [select for diffs], Sun Mar 7 14:02:54 1999 UTC (25 years, 1 month ago) by bouyer
Branch: MAIN
Changes since 1.60: +12 -4 lines
Diff to previous 1.60 (colored) to selected 1.30 (colored)

Keep track of CRC errors in Ultra-DMA mode. If we noticed a CRC error and we
need to downgrade, downgrade to PIO, as it has been shown if we got CRC errors
in Ultra-DMA mode, we will have silent data corruption in multiword DMA mode
(isn't IDE wonderfull ? :).
Set timeout to 1s for "normal" ata I/O, to minimise the effects of missed
interrupts.

Revision 1.60 / (download) - annotate - [select for diffs], Sun Feb 21 02:07:52 1999 UTC (25 years, 2 months ago) by abs
Branch: MAIN
Changes since 1.59: +4 -3 lines
Diff to previous 1.59 (colored) to selected 1.30 (colored)

wdcwait is called initially without any device on my thinkpad.
This breaks the first WDCDEBUG_PRINT. Handle this case.

Revision 1.59 / (download) - annotate - [select for diffs], Sat Feb 20 23:47:52 1999 UTC (25 years, 2 months ago) by hubertf
Branch: MAIN
Changes since 1.58: +3 -1 lines
Diff to previous 1.58 (colored) to selected 1.30 (colored)

Only #define WDCDEBUG if it isn't already defined (e.g. by some options
in the kernel config file).

Revision 1.58 / (download) - annotate - [select for diffs], Thu Feb 18 14:45:31 1999 UTC (25 years, 2 months ago) by bouyer
Branch: MAIN
Changes since 1.57: +3 -2 lines
Diff to previous 1.57 (colored) to selected 1.30 (colored)

Don't print an extra newline if the controller doesn't support 32 bits access.
Pointed out by Dave Huang.

Revision 1.57 / (download) - annotate - [select for diffs], Mon Feb 15 18:47:59 1999 UTC (25 years, 2 months ago) by bouyer
Branch: MAIN
Changes since 1.56: +7 -2 lines
Diff to previous 1.56 (colored) to selected 1.30 (colored)

Be less strict on ATAPI signature, at last one CD puts 0x00 in sc instead
of 0x01.

Revision 1.56 / (download) - annotate - [select for diffs], Mon Feb 8 15:22:28 1999 UTC (25 years, 2 months ago) by bouyer
Branch: MAIN
CVS Tags: bouyer-ide-last-dist
Changes since 1.55: +4 -4 lines
Diff to previous 1.55 (colored) to selected 1.30 (colored)

There's no ATA draft where it is required for the drive to set DRDY | DSC when
the disk is ready to transfer data, and in ATA-5 the DSC has been obsoleted.
So only wait for DRQ to transfer data. This can be made conditional on the
ATA version if it's proven to break with some drives (worked with all the
drives I have access to).
While I'm there correct a few typos.

Revision 1.55 / (download) - annotate - [select for diffs], Mon Jan 18 20:06:25 1999 UTC (25 years, 3 months ago) by bouyer
Branch: MAIN
Changes since 1.54: +27 -2 lines
Diff to previous 1.54 (colored) to selected 1.30 (colored)

move wd.c:print_wderror() to ata.c:ata_perror().
In wdc_probe_caps() add code to guess the ATA revision supported (if
ATA4 if Ultra-DMA, ATA2 if PIO mode > 2). We can't rely on param.atap_ata_major
here, at last one Ultra-DMA drive claims to support only ATA-3.
Use the ATA version in ata_perror(), and to try a flush cache command
in a shutdown hook for IDE drives.

Revision 1.54 / (download) - annotate - [select for diffs], Wed Dec 16 13:02:03 1998 UTC (25 years, 4 months ago) by bouyer
Branch: MAIN
Changes since 1.53: +44 -1 lines
Diff to previous 1.53 (colored) to selected 1.30 (colored)

Keep track of DMA errors, and downgrade the transert mode (UDMA ->DMA,
DMA->PIO) in case of 2 consecutive errors. Don't downgrade if the
PIO/DMA/UDMA modes were forced by a config flag.

Revision 1.53 / (download) - annotate - [select for diffs], Tue Dec 8 13:29:31 1998 UTC (25 years, 4 months ago) by bouyer
Branch: MAIN
CVS Tags: kenh-if-detach-base, kenh-if-detach
Changes since 1.52: +2 -1 lines
Diff to previous 1.52 (colored) to selected 1.30 (colored)

Add a missing 'return' in an error path; noticed by Matthias Drochner.

Revision 1.52 / (download) - annotate - [select for diffs], Thu Dec 3 18:24:30 1998 UTC (25 years, 4 months ago) by bouyer
Branch: MAIN
Changes since 1.51: +4 -4 lines
Diff to previous 1.51 (colored) to selected 1.30 (colored)

Rename pio_mode, etc ...  to PIO_cap, etc ... for consistency with the
ata_drive_datas struct. Suggested by Soren S. Jorvan.

Revision 1.51 / (download) - annotate - [select for diffs], Thu Dec 3 17:30:32 1998 UTC (25 years, 4 months ago) by bouyer
Branch: MAIN
Changes since 1.50: +2 -2 lines
Diff to previous 1.50 (colored) to selected 1.30 (colored)

UDMA->Ultra-DMA in a printf

Revision 1.50 / (download) - annotate - [select for diffs], Thu Dec 3 15:38:59 1998 UTC (25 years, 4 months ago) by bouyer
Branch: MAIN
Changes since 1.49: +4 -6 lines
Diff to previous 1.49 (colored) to selected 1.30 (colored)

add a udma_mode field to wdc_softc, and use it the same way dma_mode is used
(higthest ultra-dma mode supported). There may be a higther ultra-dma mode
defined ...

Revision 1.49 / (download) - annotate - [select for diffs], Wed Dec 2 15:53:34 1998 UTC (25 years, 4 months ago) by bouyer
Branch: MAIN
Changes since 1.48: +6 -7 lines
Diff to previous 1.48 (colored) to selected 1.30 (colored)

In struct wdc_xfer, change 'channel' to a pointer to a channel_softc, to avoid
a double-pointer dereference at run-time. Suggested by Matthias Drochner.

Revision 1.48 / (download) - annotate - [select for diffs], Wed Dec 2 10:52:25 1998 UTC (25 years, 4 months ago) by bouyer
Branch: MAIN
Changes since 1.47: +35 -1 lines
Diff to previous 1.47 (colored) to selected 1.30 (colored)

- change drive_flags from u_int8_t to u_int16_t
- keep the modes supported by the drive in struct ata_drive_datas (will be
  later used for downgrading the DMA/PIO mode on error)
- use config flags to force/disable PIO/DMA/UDMA modes
- For the CMD PCI0643/6 setup DMA mode to DMA Read multiple.

Revision 1.47 / (download) - annotate - [select for diffs], Sun Nov 29 17:34:49 1998 UTC (25 years, 4 months ago) by bouyer
Branch: MAIN
Changes since 1.46: +6 -1 lines
Diff to previous 1.46 (colored) to selected 1.30 (colored)

wdcstart(): Re-add support of shared xfer queue across multiple channels
(was lost between 1.44 and 1.45).

Revision 1.46 / (download) - annotate - [select for diffs], Mon Nov 23 23:02:11 1998 UTC (25 years, 5 months ago) by kenh
Branch: MAIN
Changes since 1.45: +18 -1 lines
Diff to previous 1.45 (colored) to selected 1.30 (colored)

Implement the AT_READREG flag.  This is needed for the CHECK POWER MODE
ATA command (among others).

Revision 1.45 / (download) - annotate - [select for diffs], Sat Nov 21 15:41:41 1998 UTC (25 years, 5 months ago) by drochner
Branch: MAIN
Changes since 1.44: +9 -12 lines
Diff to previous 1.44 (colored) to selected 1.30 (colored)

in wdc_softc: access the per-channel data via a pointer array instead of
an array of fixed-sized channel_softc elements. This way IDE controllers
which more than 1 channel (pciide) can extend the channel data easily
for private needs.
To avoid the double dereference at runtime, change the argument of
wdcstart() to the channel data pointer instead of the array index.

Revision 1.44 / (download) - annotate - [select for diffs], Fri Nov 20 01:22:37 1998 UTC (25 years, 5 months ago) by thorpej
Branch: MAIN
Changes since 1.43: +48 -4 lines
Diff to previous 1.43 (colored) to selected 1.30 (colored)

Implement reference counting for ATA adapters.

Revision 1.43 / (download) - annotate - [select for diffs], Thu Nov 19 22:50:21 1998 UTC (25 years, 5 months ago) by kenh
Branch: MAIN
Changes since 1.42: +23 -20 lines
Diff to previous 1.42 (colored) to selected 1.30 (colored)

Sigh, my bad.  Check for chp->wdc being NULL before trying to deference it.
(I didn't realize the ISA wdc front-end doesn't fill in chp->wdc).

Revision 1.42 / (download) - annotate - [select for diffs], Thu Nov 19 19:52:42 1998 UTC (25 years, 5 months ago) by thorpej
Branch: MAIN
Changes since 1.41: +21 -22 lines
Diff to previous 1.41 (colored) to selected 1.30 (colored)

Back out revision 1.40.  That change couldn't have POSSIBLY worked, since
when wdcprobe() is called, the wdc_softc pointer in the channel_softc
hasn't even been intialized!

Revision 1.41 / (download) - annotate - [select for diffs], Thu Nov 19 04:07:54 1998 UTC (25 years, 5 months ago) by kenh
Branch: MAIN
Changes since 1.40: +2 -1 lines
Diff to previous 1.40 (colored) to selected 1.30 (colored)

__wdccommand_done() needs to call wdcstart(), otherwise you can run
into deadlocks when using wdc_exec_command().

Revision 1.40 / (download) - annotate - [select for diffs], Wed Nov 18 19:12:08 1998 UTC (25 years, 5 months ago) by kenh
Branch: MAIN
Changes since 1.39: +22 -21 lines
Diff to previous 1.39 (colored) to selected 1.30 (colored)

Quirk out the first test in the beginning of wdcprobe(); the Vaio
CD-ROM drive doesn't like it for some reason.

Revision 1.39 / (download) - annotate - [select for diffs], Wed Nov 11 19:38:27 1998 UTC (25 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.38: +10 -8 lines
Diff to previous 1.38 (colored) to selected 1.30 (colored)

- clearify the boot messages (features supported vs features used). Thanks to
  Havard Eidnes for his complains about this :)
- fix some typo in comments
- hoppefully better detection of drives reporting bogus PIO modes.

Revision 1.38 / (download) - annotate - [select for diffs], Wed Oct 21 09:12:46 1998 UTC (25 years, 6 months ago) by bouyer
Branch: MAIN
CVS Tags: chs-ubc-base, chs-ubc
Changes since 1.37: +14 -1 lines
Diff to previous 1.37 (colored) to selected 1.30 (colored)

If WDC_DIAGNOSTIC is defined, check in wdcstart() that we are called at
splbio.

Revision 1.37 / (download) - annotate - [select for diffs], Tue Oct 20 17:00:26 1998 UTC (25 years, 6 months ago) by bouyer
Branch: MAIN
Changes since 1.36: +5 -1 lines
Diff to previous 1.36 (colored) to selected 1.30 (colored)

Donc reset the disk state to 0 in wd.c, set a flag which will cause it
to be reset to 0 at wdcstart(). This fixes a race condition between
normal I/O and wdioclt().

Revision 1.36 / (download) - annotate - [select for diffs], Thu Oct 15 11:38:04 1998 UTC (25 years, 6 months ago) by bouyer
Branch: MAIN
Changes since 1.35: +1 -2 lines
Diff to previous 1.35 (colored) to selected 1.30 (colored)

Kill an extra printf("\n").

Revision 1.35 / (download) - annotate - [select for diffs], Tue Oct 13 15:18:47 1998 UTC (25 years, 6 months ago) by bouyer
Branch: MAIN
Changes since 1.34: +2 -1 lines
Diff to previous 1.34 (colored) to selected 1.30 (colored)

Add a new drive flag, DRIVE_MODE, set when the drive properly reported its
PIO/DMA modes. Don't try a SET_FEATURE if it didn't report its mode.

Revision 1.34 / (download) - annotate - [select for diffs], Tue Oct 13 15:02:42 1998 UTC (25 years, 6 months ago) by bouyer
Branch: MAIN
Changes since 1.33: +17 -9 lines
Diff to previous 1.33 (colored) to selected 1.30 (colored)

In debug message, always print controller:channel:drive

Revision 1.33 / (download) - annotate - [select for diffs], Tue Oct 13 09:34:01 1998 UTC (25 years, 6 months ago) by bouyer
Branch: MAIN
Changes since 1.32: +6 -3 lines
Diff to previous 1.32 (colored) to selected 1.30 (colored)

Properly separate DEBUF_XFERS and DEBUG_FUNCS: DEBUF_XFERS is for data
transfers (may be called often), where DEBUG_FUNCS is for setup functions
(not used for normal contitions).

Revision 1.32 / (download) - annotate - [select for diffs], Tue Oct 13 08:59:45 1998 UTC (25 years, 6 months ago) by bouyer
Branch: MAIN
Changes since 1.31: +13 -2 lines
Diff to previous 1.31 (colored) to selected 1.30 (colored)

pciide.c: don't define WDCDEBUG, so it compiles on alpha. Correct a bogon
in the printing of DMA mode (piix3/4 only)
others: set the debug_mask to 0, so that debug messages are turned off by
default but can be easily turned on.
Reset drive_flags to 0 for unconfigured devices, so that they are ignored
later. For configured devices, reset state to 0 after probe/attach.

Revision 1.31 / (download) - annotate - [select for diffs], Mon Oct 12 16:09:18 1998 UTC (25 years, 6 months ago) by bouyer
Branch: MAIN
Changes since 1.30: +861 -1712 lines
Diff to previous 1.30 (colored)

Merge bouyer-ide

Revision 1.24.2.19 / (download) - annotate - [select for diffs], Mon Oct 12 14:33:37 1998 UTC (25 years, 6 months ago) by bouyer
Branch: bouyer-ide
CVS Tags: bouyer-ide-merge
Changes since 1.24.2.18: +3 -2 lines
Diff to previous 1.24.2.18 (colored) next main 1.25 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.30 / (download) - annotate - [selected], Sat Oct 10 00:28:34 1998 UTC (25 years, 6 months ago) by thorpej
Branch: MAIN
CVS Tags: bouyer-ide-base
Changes since 1.29: +2 -3 lines
Diff to previous 1.29 (colored)

Garbage-collect the open_target_lu and close_target_lu entry points from
struct scsipi_adapter; they were not used.

Add a scsipi_ioctl entry point to struct scsipi_adapter.  This will be
used to issue ioctl commands to the host adapters.

Inspired by PR #6090, from Matt Jacob.

Revision 1.24.2.18 / (download) - annotate - [select for diffs], Mon Oct 5 08:17:34 1998 UTC (25 years, 6 months ago) by bouyer
Branch: bouyer-ide
Changes since 1.24.2.17: +11 -8 lines
Diff to previous 1.24.2.17 (colored) to selected 1.30 (colored)

Rename WDC_CAPABILITY_PIO to WDC_CAPABILITY_MODE, as it's used to tell wether
the controller's driver can tell which timing mode it uses. Check this
before setting DMA modes too.
This allow the generic DMA code to work again.

Revision 1.24.2.17 / (download) - annotate - [select for diffs], Sun Oct 4 15:01:55 1998 UTC (25 years, 6 months ago) by bouyer
Branch: bouyer-ide
Changes since 1.24.2.16: +21 -11 lines
Diff to previous 1.24.2.16 (colored) to selected 1.30 (colored)

atavar.h: drv_softc is a struct device * instead of void*, as it's mostly
          used for dv_xname
wd.c: convert for drv_softc type change, printf cleanup
wdc.c: always call ata_get_params() (params was used initialised with
       non-32bit controllers, leaving to bogus PIO/DMA mode report).
       Cleaup of the PIO/DMA mode message.
pciide_piix_reg.h: Fix definition of PIIX_IDETIM_CLEAR (unused before)
pciide.c: add a method do disable a channel on know device. If a channel
       doesn't have any drive, we disable it and free its resources if disable
       was successfull. This should help with laptops where the second channel
       of the PIIX4 is unused but not disabled by BIOS. On such laptops,
       irq15 can be used for PCMCIA but it was claimed by pciide.
       Misc printf cleanup.
wdc_isa.c: printf cleanup.

Revision 1.24.2.16 / (download) - annotate - [select for diffs], Fri Oct 2 19:37:20 1998 UTC (25 years, 6 months ago) by bouyer
Branch: bouyer-ide
Changes since 1.24.2.15: +20 -40 lines
Diff to previous 1.24.2.15 (colored) to selected 1.30 (colored)

Cleanup a few error message, remove some dead code. Re-add a reset at end of
attach, unless we have WDC_NO_EXTRA_RESETS.
Add support for data32iot/data32ioh from -current: each controller pass
WDC_CAPABILITY_DATA32 if they can do 32bit, and WDC_CAPABILITY_DATA16 if they
can do 16bit. For controller that support both, the usual autodetect
mechanism is still used.

Revision 1.29 / (download) - annotate - [select for diffs], Tue Sep 22 00:27:51 1998 UTC (25 years, 7 months ago) by mark
Branch: MAIN
Changes since 1.28: +72 -25 lines
Diff to previous 1.28 (colored) to selected 1.30 (colored)

Use the data32iot and data32ioh members of the wdc_attachment_data
structure for 32 bit transfers.
Test for 32 bit capability on data transfers currently restricted to 16 bit
only.

Revision 1.24.2.15 / (download) - annotate - [select for diffs], Mon Sep 21 17:30:17 1998 UTC (25 years, 7 months ago) by bouyer
Branch: bouyer-ide
Changes since 1.24.2.14: +12 -4 lines
Diff to previous 1.24.2.14 (colored) to selected 1.30 (colored)

Check ATAPI signature for all drives on a channel, before atempting the
register write test. The test on the first ATA drive will clobber the register
of the slave ATAPI.

Revision 1.24.2.14 / (download) - annotate - [select for diffs], Sun Sep 20 19:00:15 1998 UTC (25 years, 7 months ago) by bouyer
Branch: bouyer-ide
Changes since 1.24.2.13: +15 -24 lines
Diff to previous 1.24.2.13 (colored) to selected 1.30 (colored)

Kill the 'old drive' flag. The probe for IDE controllers now looks
like this :
- if status = 0xff for both master and slave, no drive at all -> exit.
- issue a reset (timeout = 31s).
- test signatures: if ATAPI signature, flag a (possible) ATAPI devices here
  else test register writability, then wait for the drive to become
  ready, issue a diagnostic command and wait for the drive to become ready
  if ok, flag a real ATA device.
This looks more like the old probe.
For ATA devices, if IDENTIFY fails, then it's an old drive and use
a fake disklabel/geometry.

Revision 1.24.2.13 / (download) - annotate - [select for diffs], Sun Sep 20 13:16:16 1998 UTC (25 years, 7 months ago) by bouyer
Branch: bouyer-ide
Changes since 1.24.2.12: +171 -174 lines
Diff to previous 1.24.2.12 (colored) to selected 1.30 (colored)

- always call config_found() from wdcattach(), instead of printing our own
  the "not configured" message ourselve. When no atapibus is configured,
  use a fake ata_atapi_attach, else call wdc_atapibus_attach(). This way we
  don't have to include the whole atapi support in an ata-only config.
- the dma_* function pointers take a 'int flags' as last argument, instead
  of an 'int read'. The 2 valid flags are: WDC_DMA_READ (to select read/write)
  and WDC_DMA_POLL, to signal interrupt-less mode (for core dumps).
- Reworked wdcprobe() so look more like the old one. A status of 0xff is
  interpreted as "no drive" (freebsd does this); this this speed up
  the probe for non-IDE machines (a reset timeout has been bumped to 31s,
  to match the specs). The probe set ups the drive flags to either ATA or
  ATAPI (depend on register signature) or OLD (if register signature don't
  match, but a working drive appears to be there). Later the ATA code
  will look at the OLD flag to decide wether there is no drive, or an old
  (ST506) one if WDC_IDENTIFY fails.
- For known PCI chips, don't use the wdcprobe() heuristic to find wether
  a channel is enabled/disabled; use the chip's specific registers for this.
- Clear the command queue when we have a polled command. This allows dumps to
  work even if a command was being handled by the controller at panic time.
- Increase the number of available DMA segments by one, as user requests may
  not be aligned on a page boundary.

Revision 1.24.2.12 / (download) - annotate - [select for diffs], Fri Sep 11 16:23:12 1998 UTC (25 years, 7 months ago) by bouyer
Branch: bouyer-ide
Changes since 1.24.2.11: +15 -12 lines
Diff to previous 1.24.2.11 (colored) to selected 1.30 (colored)

Sync with HEAD.

Revision 1.28 / (download) - annotate - [select for diffs], Thu Sep 10 19:24:45 1998 UTC (25 years, 7 months ago) by kenh
Branch: MAIN
Changes since 1.27: +5 -3 lines
Diff to previous 1.27 (colored) to selected 1.30 (colored)

Add support for passing device quirks from the attachment routine,
and add support for a NO_EXTRA_RESETS quirk (required by the TEAC
IDE Card/II, which the Vaio uses).

Revision 1.24.2.11 / (download) - annotate - [select for diffs], Fri Aug 21 16:34:46 1998 UTC (25 years, 8 months ago) by bouyer
Branch: bouyer-ide
Changes since 1.24.2.10: +22 -20 lines
Diff to previous 1.24.2.10 (colored) to selected 1.30 (colored)

Sync with -current

Revision 1.27 / (download) - annotate - [select for diffs], Sat Aug 15 10:10:50 1998 UTC (25 years, 8 months ago) by mycroft
Branch: MAIN
Changes since 1.26: +22 -22 lines
Diff to previous 1.26 (colored) to selected 1.30 (colored)

Assign my copyrights to TNF.

Revision 1.26 / (download) - annotate - [select for diffs], Fri Aug 14 20:39:04 1998 UTC (25 years, 8 months ago) by drochner
Branch: MAIN
Changes since 1.25: +3 -1 lines
Diff to previous 1.25 (colored) to selected 1.30 (colored)

explicitely select the master before trying to access its registers

Revision 1.24.2.10 / (download) - annotate - [select for diffs], Thu Aug 13 14:27:50 1998 UTC (25 years, 8 months ago) by bouyer
Branch: bouyer-ide
Changes since 1.24.2.9: +79 -35 lines
Diff to previous 1.24.2.9 (colored) to selected 1.30 (colored)

 - sync with HEAD
 - better error detection and report for wd drives
 - better wddump() support
 - wdcwait() now takes a timout argument, so that we can honnor the
   timeout argument of scsipi cmds.

Revision 1.25 / (download) - annotate - [select for diffs], Tue Jun 30 00:08:32 1998 UTC (25 years, 9 months ago) by hpeyerl
Branch: MAIN
CVS Tags: eeh-paddr_t-base, eeh-paddr_t
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored) to selected 1.30 (colored)

Fix spalling misteak: indentify -> identify

Revision 1.24.2.9 / (download) - annotate - [select for diffs], Fri Jun 19 21:57:44 1998 UTC (25 years, 10 months ago) by leo
Branch: bouyer-ide
Changes since 1.24.2.8: +4 -5 lines
Diff to previous 1.24.2.8 (colored) to selected 1.30 (colored)

Fix hw-locking.

Revision 1.24.2.8 / (download) - annotate - [select for diffs], Wed Jun 10 11:19:19 1998 UTC (25 years, 10 months ago) by bouyer
Branch: bouyer-ide
Changes since 1.24.2.7: +4 -4 lines
Diff to previous 1.24.2.7 (colored) to selected 1.30 (colored)

Fix probe/attach for ATAPI or ATA-only kernels.
(XXX still 'brocken' in one way, will be worked out soon).

Revision 1.24.2.7 / (download) - annotate - [select for diffs], Tue Jun 9 13:58:17 1998 UTC (25 years, 10 months ago) by bouyer
Branch: bouyer-ide
Changes since 1.24.2.6: +4 -4 lines
Diff to previous 1.24.2.6 (colored) to selected 1.30 (colored)

Fix typos (from Soren S. Jorvan).

Revision 1.24.2.6 / (download) - annotate - [select for diffs], Tue Jun 9 13:01:27 1998 UTC (25 years, 10 months ago) by bouyer
Branch: bouyer-ide
Changes since 1.24.2.5: +21 -13 lines
Diff to previous 1.24.2.5 (colored) to selected 1.30 (colored)

- sync with trunck
- add a missing '~' when resetting the 32BIT flag to 0.
- don't try to set the PIO or DMA mode if we don't know how to set them
  on the controller. This seems to confuse some 'intelligent' isa controllers.

Revision 1.24.2.5 / (download) - annotate - [select for diffs], Fri Jun 5 16:15:27 1998 UTC (25 years, 10 months ago) by bouyer
Branch: bouyer-ide
Changes since 1.24.2.4: +2 -2 lines
Diff to previous 1.24.2.4 (colored) to selected 1.30 (colored)

Add a missing LIST_INIT().

Revision 1.24.2.4 / (download) - annotate - [select for diffs], Fri Jun 5 10:09:14 1998 UTC (25 years, 10 months ago) by bouyer
Branch: bouyer-ide
Changes since 1.24.2.3: +17 -6 lines
Diff to previous 1.24.2.3 (colored) to selected 1.30 (colored)

A few bux fixes (untested):
 - If the PIO mode of the controller is unknown, put the drive in the
   hightest mode it supports. A drive in a faster mode than the controller
   should work.
 - Create DMA maps even for unknown controllers in pciide.

Revision 1.24.2.3 / (download) - annotate - [select for diffs], Fri Jun 5 08:38:57 1998 UTC (25 years, 10 months ago) by bouyer
Branch: bouyer-ide
Changes since 1.24.2.2: +561 -531 lines
Diff to previous 1.24.2.2 (colored) to selected 1.30 (colored)

Patches from Leo Weppelman for IDE on atari, with minor fixes by me
(needed the addition of a void wdcrestart __P((void*)) function).
Quoting his words:
These diffs are preliminary because it looks like the free_hw() function
does not get called. This is only a problem on the atari falcon. I have not
yet been able to track this down.
Also, KNF wdc.c.

Revision 1.24.2.2 / (download) - annotate - [select for diffs], Thu Jun 4 16:52:47 1998 UTC (25 years, 10 months ago) by bouyer
Branch: bouyer-ide
Changes since 1.24.2.1: +1039 -0 lines
Diff to previous 1.24.2.1 (colored) to selected 1.30 (colored)

Commit changes to the IDE system in a branch. This allows a better separation
between higth-level and low-level (i.e. registers read/write) and generalize
the queue for all commands. This also add supports for IDE DMA.

Revision 1.24.2.1, Thu Jun 4 02:27:33 1998 UTC (25 years, 10 months ago) by bouyer
Branch: bouyer-ide
Changes since 1.24: +0 -1927 lines
FILE REMOVED

file wdc.c was added on branch bouyer-ide on 1998-06-04 16:52:47 +0000

Revision 1.24 / (download) - annotate - [select for diffs], Thu Jun 4 02:27:33 1998 UTC (25 years, 10 months ago) by enami
Branch: MAIN
Branch point for: bouyer-ide
Changes since 1.23: +5 -3 lines
Diff to previous 1.23 (colored) to selected 1.30 (colored)

Make this compile with WDDEBUG

Revision 1.23 / (download) - annotate - [select for diffs], Tue Apr 28 18:36:07 1998 UTC (25 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.22: +7 -1 lines
Diff to previous 1.22 (colored) to selected 1.30 (colored)

In wdcintr(), add a catch-all case so that this will compile if no
children are configured.

Revision 1.22 / (download) - annotate - [select for diffs], Sun Apr 26 06:03:24 1998 UTC (26 years ago) by mycroft
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored) to selected 1.30 (colored)

Update copyright.

Revision 1.21 / (download) - annotate - [select for diffs], Sun Apr 26 05:28:24 1998 UTC (26 years ago) by mycroft
Branch: MAIN
Changes since 1.20: +7 -6 lines
Diff to previous 1.20 (colored) to selected 1.30 (colored)

In LBA mode, always use the `total capacity' count, rather than calculating
the capacity based on the c/h/s numbers.  In fact, don't use the c/h/s
numbers for much of anything.
For ATA-4 drives or later, always use LBA mode, since it's now required.

Collectively, this allows >8GB disks (like the 12GB Bigfoot) to work.

Revision 1.20 / (download) - annotate - [select for diffs], Thu Apr 23 13:30:40 1998 UTC (26 years ago) by bouyer
Branch: MAIN
Changes since 1.19: +1 -6 lines
Diff to previous 1.19 (colored) to selected 1.30 (colored)

From Robert V. Baron:
Compute the disk block addr at command queing time rather than exec time.
This fix a bug which could lead to data corruption on disk: when a command
was reexecuted after an error condition (from wdcunwedge), the partition
offset was re-added to the block addr, leading to a transfert at the wrong
disk block.
This should fix the problem reported by some laptop's users, where the
first disk read after a suspend/resume returned garbage.

Revision 1.19 / (download) - annotate - [select for diffs], Tue Apr 7 19:51:57 1998 UTC (26 years ago) by leo
Branch: MAIN
Changes since 1.18: +17 -0 lines
Diff to previous 1.18 (colored) to selected 1.30 (colored)

Add hooks to make exclusive hardware locking possible. This is necessary
to make the driver suitable for the atari falcon.

Revision 1.18 / (download) - annotate - [select for diffs], Fri Mar 27 19:32:15 1998 UTC (26 years ago) by cgd
Branch: MAIN
Changes since 1.17: +4 -1 lines
Diff to previous 1.17 (colored) to selected 1.30 (colored)

add a short delay (5ms) after ATAPI software reset is done, suggested by
Soren S. Jorvang <soren@t.dk>.  Apparently some devices Really Want this.

Revision 1.17 / (download) - annotate - [select for diffs], Wed Feb 4 14:13:42 1998 UTC (26 years, 2 months ago) by sakamoto
Branch: MAIN
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored) to selected 1.30 (colored)

Change "__BUS_SPACE_NEED_STREAM_METHODS" to "__BUS_SPACE_HAS_STREAM_METHODS".

Revision 1.16 / (download) - annotate - [select for diffs], Tue Feb 3 04:26:46 1998 UTC (26 years, 2 months ago) by sakamoto
Branch: MAIN
Changes since 1.15: +12 -5 lines
Diff to previous 1.15 (colored) to selected 1.30 (colored)

Change the data access busification functions to
the "stream" busification functions.
In the architecture as the BeBox(CPU is big endian, have ISA bus),
These methods would be used where "raw" data needs to {read,write,set}
unchanged.

Add #ifndef __BUS_SPACE_NEED_STREAM_METHODS (define that on NetBSD/bebox),
if not define __BUS_SPACE_NEED_STREAM_METHODS,
define "stream" busification functions to normal busification functions.

Revision 1.15 / (download) - annotate - [select for diffs], Fri Jan 23 01:06:45 1998 UTC (26 years, 3 months ago) by mycroft
Branch: MAIN
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored) to selected 1.30 (colored)

Assume a newline has already been printed in wdcattach().

Revision 1.14 / (download) - annotate - [select for diffs], Thu Jan 15 02:23:43 1998 UTC (26 years, 3 months ago) by cgd
Branch: MAIN
Changes since 1.13: +1 -3 lines
Diff to previous 1.13 (colored) to selected 1.30 (colored)

#include a just-added scsipi header.

Revision 1.13 / (download) - annotate - [select for diffs], Thu Jan 15 01:26:16 1998 UTC (26 years, 3 months ago) by cgd
Branch: MAIN
Changes since 1.12: +1 -9 lines
Diff to previous 1.12 (colored) to selected 1.30 (colored)

kill a couple of unnecessary #ifs

Revision 1.12 / (download) - annotate - [select for diffs], Wed Jan 14 23:42:02 1998 UTC (26 years, 3 months ago) by cgd
Branch: MAIN
Changes since 1.11: +243 -185 lines
Diff to previous 1.11 (colored) to selected 1.30 (colored)

Various cleanups and bug fixes to the wdc/wd code:
* Fix bug in wdc that would overflow ATAPI transfer length.
* Improve wdc probe code so that 'wdc' is probed in if present
  even if there are no drives attached, and so that it works
  properly even if the only device is an ATAPI slave.
* bus_space-ify.
* split the ISA attachment from the wdc driver, and remove
  ISA dependencies from non-ISA files.
* claim that wd and wdc are now machine-independent (probably not
  completely true, but mostly so; they at least work on arm32 and
  i386).
* Various other minor fixups and cleanups, some of which were pointed
  out by Kazuki Sakamoto.

Revision 1.11 / (download) - annotate - [select for diffs], Mon Jan 12 09:43:50 1998 UTC (26 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.10: +1 -5 lines
Diff to previous 1.10 (colored) to selected 1.30 (colored)

Update for config changes.

Revision 1.10 / (download) - annotate - [select for diffs], Wed Jan 7 08:47:54 1998 UTC (26 years, 3 months ago) by mikel
Branch: MAIN
Changes since 1.9: +8 -8 lines
Diff to previous 1.9 (colored) to selected 1.30 (colored)

fix some typos in error messages & comments

Revision 1.6.2.3 / (download) - annotate - [select for diffs], Wed Dec 24 06:03:24 1997 UTC (26 years, 4 months ago) by perry
Changes since 1.6.2.2: +2 -1 lines
Diff to previous 1.6.2.2 (colored) next main 1.7 (colored) to selected 1.30 (colored)

pull up emergency patch from trunk (fvdl)

Revision 1.9 / (download) - annotate - [select for diffs], Wed Dec 24 02:01:00 1997 UTC (26 years, 4 months ago) by fvdl
Branch: MAIN
Changes since 1.8: +2 -1 lines
Diff to previous 1.8 (colored) to selected 1.30 (colored)

Add extra delay after wdcreset() call in wdcprobe. Needed by at least
one controller, where registers otherwise will still be inaccesible
(even though the busy bit has been reset), making the probe fail.

Revision 1.6.2.2 / (download) - annotate - [select for diffs], Thu Nov 6 22:18:32 1997 UTC (26 years, 5 months ago) by mellon
Changes since 1.6.2.1: +32 -30 lines
Diff to previous 1.6.2.1 (colored) to selected 1.30 (colored)

Pull rev 1.8 up from trunk (bouyer)

Revision 1.8 / (download) - annotate - [select for diffs], Wed Nov 5 22:19:07 1997 UTC (26 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.7: +32 -30 lines
Diff to previous 1.7 (colored) to selected 1.30 (colored)

Various bug fixes for atapi part:
- clean up debug code
- Don't check ATAPI signature when probing ATA drives, ATAPI devices were
  detected before
- Reset controller after disks probes. The probe, with some combinations of
  ATA/ATAPI device keep it in a mostly working, but strange state (with busy
  led on)
- The WDCF_IRQ_WAIT flag is now cleared by wdc_ata_intr and wdc_atapi_intr
  when appropriate (helps recover from failure conditions)
- In wdcunwedge, send ATAPI_SOFT_RESET to non-ata drives
  (helps recover from failure conditions)
- in wdctimeout be a bit more verbose when we missed an interrupt
- Always Increment xfer->c_skip where it should be
- Set the ITSDONE flag when a polled command completed.

Revision 1.6.2.1 / (download) - annotate - [select for diffs], Mon Oct 27 20:02:03 1997 UTC (26 years, 5 months ago) by mellon
Changes since 1.6: +31 -28 lines
Diff to previous 1.6 (colored) to selected 1.30 (colored)

Pull rev 1.7 up from trunk (bouyer)

Revision 1.7 / (download) - annotate - [select for diffs], Mon Oct 27 14:09:23 1997 UTC (26 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.6: +31 -28 lines
Diff to previous 1.6 (colored) to selected 1.30 (colored)

Changes to the probe and attach routine:
- at end of attach, explicitely select an existing drive. This fixes hangs
  some users reported (such as the one reported in port-i386/4247).
- Some atapi cdrom drives (e.g. Nec 24x) don't enables their registers before
  a controller reset is issued. The controller probe routine is changed as
  follow: issue a controller reset. If fail, test atapi signature on slave.
  If fail, wait 5s and retry a reset. If the second reset fail, return(0).
  If the first reset succeed, test presence of a master drive:
  atapi signature, and if this fail RO/RW registers test. If no master, test
  atapi signature on slave. If no slave, return 0.

Revision 1.6 / (download) - annotate - [select for diffs], Thu Oct 16 15:16:34 1997 UTC (26 years, 6 months ago) by matt
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored) to selected 1.30 (colored)

Fix a misspelling of slave in a comment.

Revision 1.2.2.4 / (download) - annotate - [select for diffs], Mon Sep 29 07:20:50 1997 UTC (26 years, 6 months ago) by thorpej
Changes since 1.2.2.3: +11 -12 lines
Diff to previous 1.2.2.3 (colored) next main 1.3 (colored) to selected 1.30 (colored)

Update marc-pcmcia branch from trunk.

Revision 1.5 / (download) - annotate - [select for diffs], Wed Sep 24 17:00:55 1997 UTC (26 years, 7 months ago) by bouyer
Branch: MAIN
Changes since 1.4: +11 -12 lines
Diff to previous 1.4 (colored) to selected 1.30 (colored)

Return the rigth value in the interrupt handler. This change the semantic
of wdc_atapi_intr, so we check for ITSDONE rather than the return value for
a pooled command.

Revision 1.2.2.3 / (download) - annotate - [select for diffs], Thu Sep 4 01:05:46 1997 UTC (26 years, 7 months ago) by thorpej
Changes since 1.2.2.2: +10 -3 lines
Diff to previous 1.2.2.2 (colored) to selected 1.30 (colored)

Update marc-pcmcia branch from trunk.

Revision 1.4 / (download) - annotate - [select for diffs], Wed Sep 3 07:57:51 1997 UTC (26 years, 7 months ago) by bouyer
Branch: MAIN
Changes since 1.3: +10 -3 lines
Diff to previous 1.3 (colored) to selected 1.30 (colored)

Add a map to wdc_softc to track the already known devices to prevent them to
be probed several times. This fixes the "ATAPI CD probed as wd drive" problem.
Thanks to Geoff Wing <mason@primenet.com.au> for testing this on his hardware.

Revision 1.2.2.2 / (download) - annotate - [select for diffs], Mon Sep 1 20:26:49 1997 UTC (26 years, 7 months ago) by thorpej
Changes since 1.2.2.1: +2 -2 lines
Diff to previous 1.2.2.1 (colored) to selected 1.30 (colored)

Update marc-pcmcia branch from trunk.

Revision 1.3 / (download) - annotate - [select for diffs], Thu Aug 28 11:05:01 1997 UTC (26 years, 7 months ago) by bouyer
Branch: MAIN
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored) to selected 1.30 (colored)

Change an ATAPI_DEBUG2->ATAPI_DEBUG. This debug message is needed when
looking what's the autoconfig do on strange harware, and ATAPI_DEBUG2 is
for debuging data transfers (and is really verbose once the machine has booted
from an IDE disk).

Revision 1.2.2.1 / (download) - annotate - [select for diffs], Wed Aug 27 23:32:12 1997 UTC (26 years, 7 months ago) by thorpej
Changes since 1.2: +1 -1 lines
Diff to previous 1.2 (colored) to selected 1.30 (colored)

Update marc-pcmcia branch from trunk.

Revision 1.2 / (download) - annotate - [select for diffs], Wed Aug 27 11:25:16 1997 UTC (26 years, 7 months ago) by bouyer
Branch: MAIN
Changes since 1.1: +1840 -0 lines
Diff to previous 1.1 (colored) to selected 1.30 (colored)

Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.

Revision 1.1.2.2 / (download) - annotate - [select for diffs], Fri Jul 18 11:05:55 1997 UTC (26 years, 9 months ago) by bouyer
Changes since 1.1.2.1: +12 -13 lines
Diff to previous 1.1.2.1 (colored) next main 1.2 (colored) to selected 1.30 (colored)

Update from trunck:
fvdl: "Work around possible race condition with 2 drives on one controller
in wd_get_parms. PR 3773, from Onno van der Linden (onno@simplex.nl)"

Revision 1.1.2.1 / (download) - annotate - [select for diffs], Tue Jul 1 17:47:08 1997 UTC (26 years, 9 months ago) by bouyer
Changes since 1.1: +1841 -0 lines
Diff to previous 1.1 (colored) to selected 1.30 (colored)

Add the ide atapi driver from my original atapi driver, ported
to scsipi.

Revision 1.1, Tue Jul 1 17:47:07 1997 UTC (26 years, 9 months ago) by bouyer
Branch: MAIN
FILE REMOVED

file wdc.c was initially added on branch bouyer-scsipi.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>