The NetBSD Project

CVS log for src/sys/dev/scsipi/atapi_wdc.c

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

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.133.4.1: download - view: text, markup, annotated - select for diffs
Fri Dec 30 14:39:10 2022 UTC (23 months ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-4-RELEASE
Diff to: previous 1.133: preferred, colored; next MAIN 1.134: preferred, colored
Changes since revision 1.133: +11 -11 lines
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.141: download - view: text, markup, annotated - select for diffs
Tue Oct 5 08:01:05 2021 UTC (3 years, 1 month ago) by rin
Branches: MAIN
CVS tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs, 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
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +7 -5 lines
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.140: download - view: text, markup, annotated - select for diffs
Sat Aug 7 16:19:16 2021 UTC (3 years, 3 months ago) by thorpej
Branches: MAIN
CVS tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +3 -4 lines
Merge thorpej-cfargs2.

Revision 1.139.8.1: download - view: text, markup, annotated - select for diffs
Wed Aug 4 23:14:04 2021 UTC (3 years, 3 months ago) by thorpej
Branches: thorpej-cfargs2
Diff to: previous 1.139: preferred, colored; next MAIN 1.140: preferred, colored
Changes since revision 1.139: +3 -4 lines
Adapt to CFARGS().

Revision 1.139: download - view: text, markup, annotated - select for diffs
Sat Apr 24 23:36:58 2021 UTC (3 years, 7 months ago) by thorpej
Branches: MAIN
CVS tags: thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Branch point for: thorpej-cfargs2
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +5 -4 lines
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
  actually needed.
- Don't be explicit about what interface attribute is attaching if
  the device only has one.  (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
  situations, making is visibly easier to see when indirect config is
  in play, and allowing for future change in semantics.  (As of now,
  this is just a wrapper around config_match(), but that is an
  implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance.  This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).

Revision 1.138.4.1: download - view: text, markup, annotated - select for diffs
Fri Apr 2 22:17:45 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-cfargs
Diff to: previous 1.138: preferred, colored; next MAIN 1.139: preferred, colored
Changes since revision 1.138: +5 -4 lines
config_found_ia() -> config_found() w/ CFARG_IATTR.

Revision 1.129.4.4: download - view: text, markup, annotated - select for diffs
Tue Apr 21 18:42:38 2020 UTC (4 years, 7 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.129.4.3: preferred, colored; branchpoint 1.129: preferred, colored; next MAIN 1.130: preferred, colored
Changes since revision 1.129.4.3: +4 -6 lines
Sync with HEAD

Revision 1.137.2.1: download - view: text, markup, annotated - select for diffs
Mon Apr 20 11:29:07 2020 UTC (4 years, 7 months ago) by bouyer
Branches: bouyer-xenpvh
Diff to: previous 1.137: preferred, colored; next MAIN 1.138: preferred, colored
Changes since revision 1.137: +6 -8 lines
Sync with HEAD

Revision 1.138: download - view: text, markup, annotated - select for diffs
Mon Apr 13 10:49:34 2020 UTC (4 years, 7 months ago) by jdolecek
Branches: MAIN
CVS tags: thorpej-futex-base, thorpej-futex, thorpej-cfargs-base, phil-wifi-20200421, bouyer-xenpvh-base2, bouyer-xenpvh-base1
Branch point for: thorpej-cfargs
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +6 -8 lines
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.129.4.3: download - view: text, markup, annotated - select for diffs
Mon Apr 13 08:04:48 2020 UTC (4 years, 7 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.129.4.2: preferred, colored; branchpoint 1.129: preferred, colored
Changes since revision 1.129.4.2: +1 -7 lines
Mostly merge changes from HEAD upto 20200411

Revision 1.129.4.2: download - view: text, markup, annotated - select for diffs
Wed Apr 8 14:08:12 2020 UTC (4 years, 7 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.129.4.1: preferred, colored; branchpoint 1.129: preferred, colored
Changes since revision 1.129.4.1: +11 -12 lines
Merge changes from current as of 20200406

Revision 1.137: download - view: text, markup, annotated - select for diffs
Sat Apr 4 21:36:15 2020 UTC (4 years, 7 months ago) by jdolecek
Branches: MAIN
CVS tags: phil-wifi-20200411, phil-wifi-20200406, bouyer-xenpvh-base
Branch point for: bouyer-xenpvh
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +4 -5 lines
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.134.2.1: download - view: text, markup, annotated - select for diffs
Sat Feb 29 20:19:16 2020 UTC (4 years, 9 months ago) by ad
Branches: ad-namecache
Diff to: previous 1.134: preferred, colored; next MAIN 1.135: preferred, colored
Changes since revision 1.134: +9 -9 lines
Sync with head.

Revision 1.136: download - view: text, markup, annotated - select for diffs
Wed Feb 19 16:04:39 2020 UTC (4 years, 9 months ago) by riastradh
Branches: MAIN
CVS tags: is-mlppp-base, is-mlppp, ad-namecache-base3
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +8 -8 lines
C99 initializers for scsipi_bustype.  No functional change intended.

Revision 1.135: download - view: text, markup, annotated - select for diffs
Wed Feb 12 00:19:07 2020 UTC (4 years, 9 months ago) by chs
Branches: MAIN
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +3 -3 lines
the number of possible ATAPI devices on an ATA bus is not always 2,
it is however many devices the underlying ATA bus can have (eg. 1 for SATA),
so initialize the scsipi chan_ntargets from the ATA ch_ndrives.
this fixes a memory read overrun detected by KASAN.
discussed with mlelstv@ and jdolecek@

Revision 1.134: download - view: text, markup, annotated - select for diffs
Sun Nov 10 21:16:37 2019 UTC (5 years ago) by chs
Branches: MAIN
CVS tags: phil-wifi-20191119, ad-namecache-base2, ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +3 -9 lines
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.

Revision 1.129.4.1: download - view: text, markup, annotated - select for diffs
Mon Jun 10 22:07:32 2019 UTC (5 years, 5 months ago) by christos
Branches: phil-wifi
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +46 -38 lines
Sync with HEAD

Revision 1.129.2.2: download - view: text, markup, annotated - select for diffs
Mon Nov 26 01:52:47 2018 UTC (6 years ago) by pgoyette
Branches: pgoyette-compat
CVS tags: pgoyette-compat-merge-20190127
Diff to: previous 1.129.2.1: preferred, colored; branchpoint 1.129: preferred, colored; next MAIN 1.130: preferred, colored
Changes since revision 1.129.2.1: +42 -37 lines
Sync with HEAD, resolve a couple of conflicts

Revision 1.133: download - view: text, markup, annotated - select for diffs
Mon Nov 12 20:54:03 2018 UTC (6 years ago) by jdolecek
Branches: MAIN
CVS tags: phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, isaki-audio2-base, isaki-audio2
Branch point for: netbsd-9
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +6 -7 lines
pass correct status + error to *_atapi_phase_complete(), so that
the function is actually able to recognize when there was an error;
tested via reading a cd0 device in QEMU with ejected cdrom

bug was introduced with jdolecek-ncq branch

fixes PR kern/53724 by Andreas Gustafsson

Revision 1.132: download - view: text, markup, annotated - select for diffs
Mon Nov 12 18:51:01 2018 UTC (6 years ago) by jdolecek
Branches: MAIN
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +8 -8 lines
hold channel lock during whole ata_dmaerr()/ata_downgrade_mode() -
according to code inspection this is safe, none of the set_modes
hooks execute anything which would be taking the lock

adresses PR kern/53714 by Andreas Gustafsson

Revision 1.131: download - view: text, markup, annotated - select for diffs
Mon Oct 22 20:13:47 2018 UTC (6 years, 1 month ago) by jdolecek
Branches: MAIN
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +32 -26 lines
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.129.6.4: download - view: text, markup, annotated - select for diffs
Sat Sep 22 09:22:59 2018 UTC (6 years, 2 months ago) by jdolecek
Branches: jdolecek-ncqfixes
Diff to: previous 1.129.6.3: preferred, colored; branchpoint 1.129: preferred, colored; next MAIN 1.130: preferred, colored
Changes since revision 1.129.6.3: +4 -4 lines
separate ata_xfer slot allocation and the memory allocation, so that
there can be more queued xfers than number of supported slots by controller,
and use a pool instead of custom pre-allocation

primarily to help PR kern/52614

remove no longer needed custom wd(4) logic for flush cache

switch also wd(4) trim/suspend/setcache/wdioctlstrategy to sleep waiting
for the memory, they are all called from process context and this
avoids spurious failures

Revision 1.129.6.3: download - view: text, markup, annotated - select for diffs
Mon Sep 17 19:30:26 2018 UTC (6 years, 2 months ago) by jdolecek
Branches: jdolecek-ncqfixes
Diff to: previous 1.129.6.2: preferred, colored; branchpoint 1.129: preferred, colored
Changes since revision 1.129.6.2: +13 -13 lines
move ATAPI-only members of ata_xfer to an union struct to further save space

Revision 1.129.6.2: download - view: text, markup, annotated - select for diffs
Mon Sep 17 18:36:14 2018 UTC (6 years, 2 months ago) by jdolecek
Branches: jdolecek-ncqfixes
Diff to: previous 1.129.6.1: preferred, colored; branchpoint 1.129: preferred, colored
Changes since revision 1.129.6.1: +11 -7 lines
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.129.2.1: download - view: text, markup, annotated - select for diffs
Thu Sep 6 06:56:04 2018 UTC (6 years, 2 months ago) by pgoyette
Branches: pgoyette-compat
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +6 -3 lines
Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

Revision 1.130: download - view: text, markup, annotated - select for diffs
Sat Sep 1 07:19:19 2018 UTC (6 years, 3 months ago) by mlelstv
Branches: MAIN
CVS tags: pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +6 -3 lines
Make wdcdebug_atapi_mask configurable like the other debug variables.

Revision 1.129.6.1: download - view: text, markup, annotated - select for diffs
Fri Aug 31 19:08:03 2018 UTC (6 years, 3 months ago) by jdolecek
Branches: jdolecek-ncqfixes
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +10 -8 lines
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.119.2.1: download - view: text, markup, annotated - select for diffs
Sun Dec 3 11:37:32 2017 UTC (7 years ago) by jdolecek
Branches: tls-maxphys
Diff to: previous 1.119: preferred, colored; next MAIN 1.120: preferred, colored
Changes since revision 1.119: +188 -111 lines
update from HEAD

Revision 1.129: download - view: text, markup, annotated - select for diffs
Tue Oct 17 18:52:51 2017 UTC (7 years, 1 month ago) by jdolecek
Branches: MAIN
CVS tags: tls-maxphys-base-20171202, phil-wifi-base, pgoyette-compat-base, 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
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +20 -6 lines
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.128: download - view: text, markup, annotated - select for diffs
Tue Oct 10 21:37:49 2017 UTC (7 years, 1 month ago) by jdolecek
Branches: MAIN
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +5 -6 lines
revert the logic in wdc_atapi_intr() for wdc_wait_for_unbusy() to what it
was before NCQ merge; it got broken during the efford to remove ch_status
and ch_error on the branch

fixes atapi timeouts in vbox and with real harware reported separately
by Abhinav Upadhyay, Pault Goyette, Chavdar Ivanov, and Rares
Aioanei; with a bit of luck it could also fix PR kern/52605 and/or PR
kern/52606 by Martin Husemann

Revision 1.127: download - view: text, markup, annotated - select for diffs
Sun Oct 8 21:33:38 2017 UTC (7 years, 1 month ago) by christos
Branches: MAIN
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +4 -4 lines
don't initialize tfd twice.

Revision 1.126: download - view: text, markup, annotated - select for diffs
Sun Oct 8 21:29:34 2017 UTC (7 years, 1 month ago) by christos
Branches: MAIN
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +4 -3 lines
initialize tfd

Revision 1.125: download - view: text, markup, annotated - select for diffs
Sun Oct 8 21:18:14 2017 UTC (7 years, 1 month ago) by joerg
Branches: MAIN
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +3 -3 lines
Initialize tfd even when not waiting for DSC.

Revision 1.124: download - view: text, markup, annotated - select for diffs
Sat Oct 7 16:05:33 2017 UTC (7 years, 1 month ago) by jdolecek
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +179 -119 lines
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.123.4.14: download - view: text, markup, annotated - select for diffs
Sat Sep 30 21:32:32 2017 UTC (7 years, 2 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.123.4.13: preferred, colored; branchpoint 1.123: preferred, colored; next MAIN 1.124: preferred, colored
Changes since revision 1.123.4.13: +8 -8 lines
must drop channel lock before calling ata_dmaerr() to avoid 'locking against
myself' in case of consecutive errors from ata_reset_channel() called via
ata_downgrade_mode()

Revision 1.123.4.13: download - view: text, markup, annotated - select for diffs
Sun Sep 10 19:31:15 2017 UTC (7 years, 2 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.123.4.12: preferred, colored; branchpoint 1.123: preferred, colored
Changes since revision 1.123.4.12: +86 -38 lines
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.123.4.12: download - view: text, markup, annotated - select for diffs
Sat Aug 12 14:41:54 2017 UTC (7 years, 3 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.123.4.11: preferred, colored; branchpoint 1.123: preferred, colored
Changes since revision 1.123.4.11: +3 -4 lines
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.123.4.11: download - view: text, markup, annotated - select for diffs
Sat Aug 12 09:52:28 2017 UTC (7 years, 3 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.123.4.10: preferred, colored; branchpoint 1.123: preferred, colored
Changes since revision 1.123.4.10: +39 -45 lines
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.123.4.10: download - view: text, markup, annotated - select for diffs
Sat Jul 29 09:04:39 2017 UTC (7 years, 4 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.123.4.9: preferred, colored; branchpoint 1.123: preferred, colored
Changes since revision 1.123.4.9: +5 -5 lines
do not use freed xfer in error message in wdc_atapi_get_params()

Revision 1.123.4.9: download - view: text, markup, annotated - select for diffs
Tue Jun 27 18:36:03 2017 UTC (7 years, 5 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.123.4.8: preferred, colored; branchpoint 1.123: preferred, colored
Changes since revision 1.123.4.8: +13 -8 lines
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.123.4.8: download - view: text, markup, annotated - select for diffs
Wed Jun 21 22:34:46 2017 UTC (7 years, 5 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.123.4.7: preferred, colored; branchpoint 1.123: preferred, colored
Changes since revision 1.123.4.7: +8 -4 lines
two last forgotten on-stack xfers replaced with using the queue xfer -
ata_get_params() and ata_set_mode()

fix wdc_atapi_get_params() to free the xfer used for soft reset before
calling ata_get_params() - it's now necessary, as ata_get_params() doesn't
invent a private xfer own any more

Revision 1.123.4.7: download - view: text, markup, annotated - select for diffs
Tue Jun 20 20:58:23 2017 UTC (7 years, 5 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.123.4.6: preferred, colored; branchpoint 1.123: preferred, colored
Changes since revision 1.123.4.6: +5 -5 lines
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.123.4.6: download - view: text, markup, annotated - select for diffs
Mon Jun 19 21:00:00 2017 UTC (7 years, 5 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.123.4.5: preferred, colored; branchpoint 1.123: preferred, colored
Changes since revision 1.123.4.5: +19 -15 lines
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.123.4.5: download - view: text, markup, annotated - select for diffs
Fri Jun 16 20:40:49 2017 UTC (7 years, 5 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.123.4.4: preferred, colored; branchpoint 1.123: preferred, colored
Changes since revision 1.123.4.4: +4 -2 lines
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.123.4.4: download - view: text, markup, annotated - select for diffs
Wed Apr 19 20:49:17 2017 UTC (7 years, 7 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.123.4.3: preferred, colored; branchpoint 1.123: preferred, colored
Changes since revision 1.123.4.3: +17 -9 lines
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.123.4.3: download - view: text, markup, annotated - select for diffs
Sat Apr 15 17:14:11 2017 UTC (7 years, 7 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.123.4.2: preferred, colored; branchpoint 1.123: preferred, colored
Changes since revision 1.123.4.2: +20 -20 lines
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.123.4.2: download - view: text, markup, annotated - select for diffs
Sat Apr 15 12:01:24 2017 UTC (7 years, 7 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.123.4.1: preferred, colored; branchpoint 1.123: preferred, colored
Changes since revision 1.123.4.1: +3 -3 lines
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.123.4.1: download - view: text, markup, annotated - select for diffs
Mon Apr 10 22:57:03 2017 UTC (7 years, 7 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +5 -9 lines
ATA infrastructure improvements to eventually support more outstanding
commands

patch by Matt Thomas

Revision 1.122.2.1: download - view: text, markup, annotated - select for diffs
Sat Jan 7 08:56:41 2017 UTC (7 years, 10 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.122: preferred, colored; next MAIN 1.123: preferred, colored
Changes since revision 1.122: +3 -3 lines
Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.119.16.3: download - view: text, markup, annotated - select for diffs
Mon Dec 5 10:55:17 2016 UTC (7 years, 11 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.119.16.2: preferred, colored; branchpoint 1.119: preferred, colored; next MAIN 1.120: preferred, colored
Changes since revision 1.119.16.2: +3 -3 lines
Sync with HEAD

Revision 1.123: download - view: text, markup, annotated - select for diffs
Sun Nov 20 15:37:19 2016 UTC (8 years ago) by mlelstv
Branches: MAIN
CVS tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, nick-nhusb-base-20170204, nick-nhusb-base-20161204, netbsd-8-base, netbsd-8-3-RELEASE, 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, bouyer-socketcan-base, bouyer-socketcan
Branch point for: jdolecek-ncq
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +3 -3 lines
Make scsipi framework MPSAFE.

Data structures are now protected by a per-adapter mutex at IPL_BIO
that is created by the scsibus or atapibus instance when the adapter
is configured.
The enable reference counter and the channel freeze counter which are
currently used by HBA code before the adapter is configured, are made
atomic.
The target drivers are now all tagged as D_MPSAFE.

Almost all HBA drivers still require the kernel lock to present,
so all callbacks into HBA code are still protected by kernel lock
unless the driver is tagged as SCSIPI_ADAPT_MPSAFE.

TODO: refactor sd and cd to use dksubr.

Revision 1.119.16.2: download - view: text, markup, annotated - select for diffs
Sun May 29 08:44:31 2016 UTC (8 years, 6 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.119.16.1: preferred, colored; branchpoint 1.119: preferred, colored
Changes since revision 1.119.16.1: +10 -7 lines
Sync with HEAD

Revision 1.122: download - view: text, markup, annotated - select for diffs
Mon May 2 19:18:29 2016 UTC (8 years, 7 months ago) by christos
Branches: MAIN
CVS tags: pgoyette-localcount-base, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20161004, nick-nhusb-base-20160907, nick-nhusb-base-20160529, localcount-20160914
Branch point for: pgoyette-localcount
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +10 -7 lines
move scsipi_strvis -> libkern:strnvisx()
change the prototype to match userland
fix sizes of strings passed to it

Revision 1.119.16.1: download - view: text, markup, annotated - select for diffs
Fri Apr 22 15:44:13 2016 UTC (8 years, 7 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +5 -5 lines
Sync with HEAD

Revision 1.121: download - view: text, markup, annotated - select for diffs
Sun Mar 20 10:29:12 2016 UTC (8 years, 8 months ago) by tsutsui
Branches: MAIN
CVS tags: nick-nhusb-base-20160422
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +3 -3 lines
Pass a correct residual size to wdcbit_bucket() that drains extra bytes.

Seems broken (but almost harmless?) since rev 1.101 committed ~10 years ago:
 http://mail-index.netbsd.org/source-changes/2006/09/07/0043.html

Revision 1.120: download - view: text, markup, annotated - select for diffs
Sun Mar 20 09:47:58 2016 UTC (8 years, 8 months ago) by tsutsui
Branches: MAIN
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +4 -4 lines
Remove extra spaces.

Revision 1.112.4.2: download - view: text, markup, annotated - select for diffs
Tue Oct 30 17:22:01 2012 UTC (12 years, 1 month ago) by yamt
Branches: yamt-pagecache
CVS tags: yamt-pagecache-tag8
Diff to: previous 1.112.4.1: preferred, colored; branchpoint 1.112: preferred, colored; next MAIN 1.113: preferred, colored
Changes since revision 1.112.4.1: +20 -20 lines
sync with head

Revision 1.119: download - view: text, markup, annotated - select for diffs
Tue Jul 31 15:59:57 2012 UTC (12 years, 4 months ago) by bouyer
Branches: MAIN
CVS tags: yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, rmind-smpnet-nbase, rmind-smpnet-base, rmind-smpnet, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, nick-nhusb-base-20160319, 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, khorben-n900, agc-symver-base, agc-symver
Branch point for: tls-maxphys, nick-nhusb
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +9 -9 lines
Move a check for the drive type to the right place. This bug would cause
ATA drives to not be detected when the PATA (or emulated PATA) bus is shared
with an ATAPI device.
Should fix the problem reported by various peoples.
Thanks to Onno van der Linden and vanoven@free.fr for pointing out the
code in error.

Revision 1.118: download - view: text, markup, annotated - select for diffs
Tue Jul 31 15:50:37 2012 UTC (12 years, 4 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +14 -14 lines
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.117: download - view: text, markup, annotated - select for diffs
Thu Jul 26 20:49:51 2012 UTC (12 years, 4 months ago) by jakllsch
Branches: MAIN
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +7 -7 lines
Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@

Revision 1.116: download - view: text, markup, annotated - select for diffs
Tue Jul 24 14:04:32 2012 UTC (12 years, 4 months ago) by jakllsch
Branches: MAIN
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +12 -12 lines
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.115: download - view: text, markup, annotated - select for diffs
Sun Jul 15 10:55:33 2012 UTC (12 years, 4 months ago) by dsl
Branches: MAIN
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +14 -14 lines
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.114: download - view: text, markup, annotated - select for diffs
Mon Jul 2 18:15:48 2012 UTC (12 years, 5 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +7 -7 lines
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.112.4.1: download - view: text, markup, annotated - select for diffs
Wed May 23 10:08:05 2012 UTC (12 years, 6 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +3 -2 lines
sync with head.

Revision 1.112.8.1: download - view: text, markup, annotated - select for diffs
Sun Apr 29 23:04:59 2012 UTC (12 years, 7 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.112: preferred, colored; next MAIN 1.113: preferred, colored
Changes since revision 1.112: +3 -2 lines
sync to latest -current.

Revision 1.113: download - view: text, markup, annotated - select for diffs
Fri Apr 20 20:23:21 2012 UTC (12 years, 7 months ago) by bouyer
Branches: MAIN
CVS tags: yamt-pagecache-base5, jmcneill-usbmp-base9, jmcneill-usbmp-base10
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +3 -2 lines
Add a bustype_async_event_xfer_mode() callback to scsipi_bustype (which can
be NULL), so that transport-specific details of transfer mode setting/printing
can be handled more easily.
Move scsipi_async_event_xfer_mode() and scsipi_print_xfer_mode() to
scsi_base.c and split in parallel scsi and FC/SAS parts.
size of struct scsipi_bustype has changed, welcome to 6.99.5

Revision 1.111.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 6 09:08:36 2011 UTC (13 years, 5 months ago) by jruoho
Branches: jruoho-x86intr
Diff to: previous 1.111: preferred, colored; next MAIN 1.112: preferred, colored
Changes since revision 1.111: +3 -3 lines
Sync with HEAD.

Revision 1.110.4.2: download - view: text, markup, annotated - select for diffs
Tue May 31 03:04:55 2011 UTC (13 years, 6 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.110.4.1: preferred, colored; branchpoint 1.110: preferred, colored; next MAIN 1.111: preferred, colored
Changes since revision 1.110.4.1: +3 -3 lines
sync with head

Revision 1.112: download - view: text, markup, annotated - select for diffs
Tue May 24 16:35:26 2011 UTC (13 years, 6 months ago) by joerg
Branches: MAIN
CVS tags: yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, rmind-uvmplock-nbase, rmind-uvmplock-base, 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-pre-base2, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3, cherry-xenmp-base, cherry-xenmp
Branch point for: yamt-pagecache, jmcneill-usbmp
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +3 -3 lines
Fix obvious condition snafu

Revision 1.107.4.2: download - view: text, markup, annotated - select for diffs
Wed Aug 11 22:54:10 2010 UTC (14 years, 3 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.107.4.1: preferred, colored; branchpoint 1.107: preferred, colored; next MAIN 1.108: preferred, colored
Changes since revision 1.107.4.1: +3 -3 lines
sync with head.

Revision 1.110.4.1: download - view: text, markup, annotated - select for diffs
Sun May 30 05:17:42 2010 UTC (14 years, 6 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +3 -3 lines
sync with head

Revision 1.110.2.1: download - view: text, markup, annotated - select for diffs
Fri Apr 30 14:43:48 2010 UTC (14 years, 7 months ago) by uebayasi
Branches: uebayasi-xip
Diff to: previous 1.110: preferred, colored; next MAIN 1.111: preferred, colored
Changes since revision 1.110: +3 -3 lines
Sync with HEAD.

Revision 1.111: download - view: text, markup, annotated - select for diffs
Sun Mar 28 20:46:18 2010 UTC (14 years, 8 months ago) by snj
Branches: MAIN
CVS tags: yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, uebayasi-xip-base1, matt-mips64-premerge-20101231, jruoho-x86intr-base, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: jruoho-x86intr
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +3 -3 lines
Spell "enough" properly.

Revision 1.107.4.1: download - view: text, markup, annotated - select for diffs
Thu Mar 11 15:04:02 2010 UTC (14 years, 8 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +2 -7 lines
sync with head

Revision 1.110: download - view: text, markup, annotated - select for diffs
Mon Oct 19 18:41:16 2009 UTC (15 years, 1 month ago) by bouyer
Branches: MAIN
CVS tags: yamt-nfs-mp-base9, uebayasi-xip-base, matt-premerge-20091211, jym-xensuspend-nbase
Branch point for: uebayasi-xip, rmind-uvmplock
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +2 -7 lines
Remove closes 3 & 4 from my licence. Lots of thanks to Soren Jacobsen
for the booring work !

Revision 1.108.2.1: download - view: text, markup, annotated - select for diffs
Mon Jan 19 13:19:03 2009 UTC (15 years, 10 months ago) by skrll
Branches: nick-hppapmap
Diff to: previous 1.108: preferred, colored; next MAIN 1.109: preferred, colored
Changes since revision 1.108: +4 -4 lines
Sync with HEAD.

Revision 1.105.16.3: download - view: text, markup, annotated - select for diffs
Sat Jan 17 13:29:08 2009 UTC (15 years, 10 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.105.16.2: preferred, colored; branchpoint 1.105: preferred, colored; next MAIN 1.106: preferred, colored
Changes since revision 1.105.16.2: +2 -2 lines
Sync with HEAD.

Revision 1.107.10.2: download - view: text, markup, annotated - select for diffs
Sat Dec 13 01:14:48 2008 UTC (15 years, 11 months ago) by haad
Branches: haad-dm
Diff to: previous 1.107.10.1: preferred, colored; branchpoint 1.107: preferred, colored; next MAIN 1.108: preferred, colored
Changes since revision 1.107.10.1: +4 -4 lines
Update haad-dm branch to haad-dm-base2.

Revision 1.108.4.1: download - view: text, markup, annotated - select for diffs
Thu Nov 20 02:45:36 2008 UTC (16 years ago) by snj
Branches: 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, 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-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b
Diff to: previous 1.108: preferred, colored; next MAIN 1.109: preferred, colored
Changes since revision 1.108: +4 -4 lines
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.109: download - view: text, markup, annotated - select for diffs
Sun Nov 16 19:31:21 2008 UTC (16 years ago) by bouyer
Branches: 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, ad-audiomp2-base, ad-audiomp2
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +2 -2 lines
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.107.10.1: download - view: text, markup, annotated - select for diffs
Sun Oct 19 22:17:04 2008 UTC (16 years, 1 month ago) by haad
Branches: haad-dm
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +4 -4 lines
Sync with HEAD.

Revision 1.107.6.1: download - view: text, markup, annotated - select for diffs
Fri Oct 10 22:33:10 2008 UTC (16 years, 1 month ago) by skrll
Branches: wrstuden-revivesa
Diff to: previous 1.107: preferred, colored; next MAIN 1.108: preferred, colored
Changes since revision 1.107: +4 -4 lines
Sync with HEAD.

Revision 1.105.16.2: download - view: text, markup, annotated - select for diffs
Sun Oct 5 20:11:31 2008 UTC (16 years, 2 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.105.16.1: preferred, colored; branchpoint 1.105: preferred, colored
Changes since revision 1.105.16.1: +2 -2 lines
Sync with HEAD.

Revision 1.108: download - view: text, markup, annotated - select for diffs
Thu Oct 2 21:05:17 2008 UTC (16 years, 2 months ago) by bouyer
Branches: MAIN
CVS tags: wrstuden-revivesa-base-4, netbsd-5-base, matt-mips64-base2, haad-dm-base1
Branch point for: nick-hppapmap, netbsd-5
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +4 -4 lines
Kill ATACH_TH_RUN and use cpu_intr_p() instead.

Revision 1.105.16.1: download - view: text, markup, annotated - select for diffs
Thu Apr 3 12:42:55 2008 UTC (16 years, 8 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +33 -30 lines
Sync with HEAD.

Revision 1.107: download - view: text, markup, annotated - select for diffs
Mon Mar 24 14:44:26 2008 UTC (16 years, 8 months ago) by cube
Branches: MAIN
CVS tags: yamt-pf42-baseX, yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-pf42, yamt-nfs-mp-base2, yamt-nfs-mp-base, 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, ad-socklock-base1
Branch point for: yamt-nfs-mp, wrstuden-revivesa, haad-dm
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +6 -5 lines
Split device_t and softc for atapibus(4).

Revision 1.95.2.5: download - view: text, markup, annotated - select for diffs
Mon Mar 24 09:39:00 2008 UTC (16 years, 8 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.95.2.4: preferred, colored; next MAIN 1.96: preferred, colored
Changes since revision 1.95.2.4: +30 -28 lines
sync with head.

Revision 1.105.12.1: download - view: text, markup, annotated - select for diffs
Mon Mar 24 07:16:08 2008 UTC (16 years, 8 months ago) by keiichi
Branches: keiichi-mipv6
Diff to: previous 1.105: preferred, colored; next MAIN 1.106: preferred, colored
Changes since revision 1.105: +30 -28 lines
sync with head.

Revision 1.104.20.2: download - view: text, markup, annotated - select for diffs
Sun Mar 23 02:04:52 2008 UTC (16 years, 8 months ago) by matt
Branches: matt-armv6
Diff to: previous 1.104.20.1: preferred, colored; branchpoint 1.104: preferred, colored; next MAIN 1.105: preferred, colored
Changes since revision 1.104.20.1: +30 -28 lines
sync with HEAD

Revision 1.106: download - view: text, markup, annotated - select for diffs
Tue Mar 18 20:46:37 2008 UTC (16 years, 8 months ago) by cube
Branches: MAIN
CVS tags: yamt-lazymbuf-base15, yamt-lazymbuf-base14, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +30 -28 lines
Split device_t and softc for ATA devices, as well as wd(4).  Other
cosmetic changes where appropriate.

Revision 1.104.20.1: download - view: text, markup, annotated - select for diffs
Tue Nov 6 23:30:14 2007 UTC (17 years ago) by matt
Branches: matt-armv6
CVS tags: matt-armv6-prevmlocking
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +4 -4 lines
sync with HEAD

Revision 1.95.2.4: download - view: text, markup, annotated - select for diffs
Sat Oct 27 11:34:15 2007 UTC (17 years, 1 month ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.95.2.3: preferred, colored
Changes since revision 1.95.2.3: +4 -4 lines
sync with head.

Revision 1.104.18.1: download - view: text, markup, annotated - select for diffs
Fri Oct 26 15:47:35 2007 UTC (17 years, 1 month ago) by joerg
Branches: jmcneill-pm
Diff to: previous 1.104: preferred, colored; next MAIN 1.105: preferred, colored
Changes since revision 1.104: +4 -4 lines
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.104.24.1: download - view: text, markup, annotated - select for diffs
Thu Oct 25 22:39:43 2007 UTC (17 years, 1 month ago) by bouyer
Branches: bouyer-xenamd64
Diff to: previous 1.104: preferred, colored; next MAIN 1.105: preferred, colored
Changes since revision 1.104: +4 -4 lines
Sync with HEAD.

Revision 1.104.6.1: download - view: text, markup, annotated - select for diffs
Tue Oct 23 20:09:44 2007 UTC (17 years, 1 month ago) by ad
Branches: vmlocking
Diff to: previous 1.104: preferred, colored; next MAIN 1.105: preferred, colored
Changes since revision 1.104: +4 -4 lines
Sync with head.

Revision 1.105: download - view: text, markup, annotated - select for diffs
Fri Oct 19 12:01:18 2007 UTC (17 years, 1 month ago) by ad
Branches: 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, nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, mjf-devfs, matt-armv6-base, jmcneill-pm-base, jmcneill-base, hpcarm-cleanup-base, cube-autoconf-base, cube-autoconf, bouyer-xeni386-nbase, bouyer-xeni386-merge1, bouyer-xeni386-base, bouyer-xeni386, bouyer-xenamd64-base2, bouyer-xenamd64-base
Branch point for: mjf-devfs2, keiichi-mipv6
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +4 -4 lines
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h

Revision 1.95.2.3: download - view: text, markup, annotated - select for diffs
Mon Feb 26 09:10:40 2007 UTC (17 years, 9 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.95.2.2: preferred, colored
Changes since revision 1.95.2.2: +24 -12 lines
sync with head.

Revision 1.101.2.2: download - view: text, markup, annotated - select for diffs
Thu Feb 1 08:48:27 2007 UTC (17 years, 10 months ago) by ad
Branches: newlock2
Diff to: previous 1.101.2.1: preferred, colored; branchpoint 1.101: preferred, colored; next MAIN 1.102: preferred, colored
Changes since revision 1.101.2.1: +24 -12 lines
Sync with head.

Revision 1.103.2.1: download - view: text, markup, annotated - select for diffs
Mon Jan 29 22:29:09 2007 UTC (17 years, 10 months ago) by bouyer
Branches: 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
Diff to: previous 1.103: preferred, colored; next MAIN 1.104: preferred, colored
Changes since revision 1.103: +24 -12 lines
Pull up following revision(s) (requested by reinoud in ticket #388):
	sys/dev/scsipi/atapi_wdc.c: revision 1.104
Fix for atapi devices that have 32 bit databusses selected. The devices
won't error out but will return garbage data. Implemented by generalising
the odd-check for PIO selection to check for 4 byte alignment in offset and
size.
Note that this check could be relaxed by checking if the ATAPI/ide bus
width is 16 for the device but its unknown to me if that information is
available here.

Revision 1.104: download - view: text, markup, annotated - select for diffs
Tue Jan 23 20:10:06 2007 UTC (17 years, 10 months ago) by reinoud
Branches: MAIN
CVS tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, yamt-idlelwp-base8, yamt-idlelwp, vmlocking-base, thorpej-atomic-base, thorpej-atomic, reinoud-bufcleanup, post-newlock2-merge, nick-csl-alignment-base5, nick-csl-alignment-base, nick-csl-alignment, newlock2-nbase, newlock2-base, mjf-ufs-trans-base, mjf-ufs-trans, matt-mips64-base, matt-mips64, hpcarm-cleanup, ad-audiomp-base, ad-audiomp
Branch point for: vmlocking, matt-armv6, jmcneill-pm, bouyer-xenamd64
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +24 -12 lines
Fix for atapi devices that have 32 bit databusses selected. The devices
won't error out but will return garbage data. Implemented by generalising
the odd-check for PIO selection to check for 4 byte alignment in offset and
size.

Note that this check could be relaxed by checking if the ATAPI/ide bus
width is 16 for the device but its unknown to me if that information is
available here.

Revision 1.95.2.2: download - view: text, markup, annotated - select for diffs
Sat Dec 30 20:49:33 2006 UTC (17 years, 11 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.95.2.1: preferred, colored
Changes since revision 1.95.2.1: +178 -36 lines
sync with head.

Revision 1.101.2.1: download - view: text, markup, annotated - select for diffs
Sat Nov 18 21:34:48 2006 UTC (18 years ago) by ad
Branches: newlock2
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +66 -9 lines
Sync with head.

Revision 1.101.4.1: download - view: text, markup, annotated - select for diffs
Sun Oct 22 06:06:47 2006 UTC (18 years, 1 month ago) by yamt
Branches: yamt-splraiseipl
Diff to: previous 1.101: preferred, colored; next MAIN 1.102: preferred, colored
Changes since revision 1.101: +66 -9 lines
sync with head

Revision 1.103: download - view: text, markup, annotated - select for diffs
Sun Oct 1 20:10:31 2006 UTC (18 years, 2 months ago) by reinoud
Branches: MAIN
CVS tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, yamt-splraiseipl-base2, netbsd-4-base
Branch point for: netbsd-4
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +7 -3 lines
In gcc4 structures are differently aligned compared to gcc3. Lots of
structures can thus be misaligned for DMA when declared on stack.

The current atapi code accepts the misaligned dma's only screw's them up.
This small patch disables DMA for the rare transactions that are
misaligned. Note that all bulk-transfers are aligned due to page sizes.

See PR kern/34689

Revision 1.102: download - view: text, markup, annotated - select for diffs
Sat Sep 30 15:56:18 2006 UTC (18 years, 2 months ago) by itohy
Branches: MAIN
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +61 -8 lines
A little effort against kernel bloat....
Exclude ATA DMA support if no ATA DMA capable drivers are compiled in.

Revision 1.98.2.3: download - view: text, markup, annotated - select for diffs
Thu Sep 14 12:31:40 2006 UTC (18 years, 2 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.98.2.2: preferred, colored; branchpoint 1.98: preferred, colored; next MAIN 1.99: preferred, colored
Changes since revision 1.98.2.2: +110 -27 lines
sync with head.

Revision 1.97.4.1: download - view: text, markup, annotated - select for diffs
Sat Sep 9 02:54:25 2006 UTC (18 years, 2 months ago) by rpaulo
Branches: rpaulo-netinet-merge-pcb
Diff to: previous 1.97: preferred, colored; next MAIN 1.98: preferred, colored
Changes since revision 1.97: +117 -32 lines
sync with head

Revision 1.101: download - view: text, markup, annotated - select for diffs
Thu Sep 7 12:34:42 2006 UTC (18 years, 2 months ago) by itohy
Branches: MAIN
CVS tags: yamt-splraiseipl-base, yamt-pdpolicy-base9, rpaulo-netinet-merge-pcb-base
Branch point for: yamt-splraiseipl, newlock2
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +110 -27 lines
Add PIOBM (busmastering transfer using ATA PIO mode) support.
The PIOBM is used by only one driver (will be added later,
stay tuned) and intruduce an attribute "ata_piobm" so that
it will be conditionally compiled in.
The "ata_dma" (busmastering transfer using ATA DMA mode) and
"ata_udma" (busmastering transfer using ATA Ultra DMA mode)
attributes are also added for consistency, but unused for now.

Revision 1.98.2.2: download - view: text, markup, annotated - select for diffs
Fri Aug 11 15:45:08 2006 UTC (18 years, 3 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.98.2.1: preferred, colored; branchpoint 1.98: preferred, colored
Changes since revision 1.98.2.1: +7 -5 lines
sync with head

Revision 1.99.2.1: download - view: text, markup, annotated - select for diffs
Thu Jul 13 17:49:43 2006 UTC (18 years, 4 months ago) by gdamore
Branches: gdamore-uart
Diff to: previous 1.99: preferred, colored; next MAIN 1.100: preferred, colored
Changes since revision 1.99: +7 -5 lines
Merge from HEAD.

Revision 1.100: download - view: text, markup, annotated - select for diffs
Tue Jun 27 10:39:51 2006 UTC (18 years, 5 months ago) by tron
Branches: MAIN
CVS tags: yamt-pdpolicy-base8, yamt-pdpolicy-base7, abandoned-netbsd-4-base, abandoned-netbsd-4
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +7 -5 lines
Make this build with GCC 4.x.

Revision 1.95.2.1: download - view: text, markup, annotated - select for diffs
Wed Jun 21 15:06:47 2006 UTC (18 years, 5 months ago) by yamt
Branches: yamt-lazymbuf
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +6 -5 lines
sync with head.

Revision 1.98.8.1: download - view: text, markup, annotated - select for diffs
Mon Jun 19 04:05:48 2006 UTC (18 years, 5 months ago) by chap
Branches: chap-midi
Diff to: previous 1.98: preferred, colored; next MAIN 1.99: preferred, colored
Changes since revision 1.98: +3 -3 lines
Sync with head.

Revision 1.97.6.2: download - view: text, markup, annotated - select for diffs
Thu Jun 1 22:37:34 2006 UTC (18 years, 6 months ago) by kardel
Branches: simonb-timecounters
CVS tags: simonb-timcounters-final
Diff to: previous 1.97.6.1: preferred, colored; next MAIN 1.98: preferred, colored
Changes since revision 1.97.6.1: +3 -3 lines
Sync with head.

Revision 1.98.6.1: download - view: text, markup, annotated - select for diffs
Wed May 24 15:50:29 2006 UTC (18 years, 6 months ago) by tron
Branches: peter-altq
Diff to: previous 1.98: preferred, colored; next MAIN 1.99: preferred, colored
Changes since revision 1.98: +3 -3 lines
Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.

Revision 1.98.2.1: download - view: text, markup, annotated - select for diffs
Wed May 24 10:58:24 2006 UTC (18 years, 6 months ago) by yamt
Branches: yamt-pdpolicy
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +3 -3 lines
sync with head.

Revision 1.99: download - view: text, markup, annotated - select for diffs
Sun May 21 23:56:09 2006 UTC (18 years, 6 months ago) by christos
Branches: MAIN
CVS tags: yamt-pdpolicy-base6, yamt-pdpolicy-base5, simonb-timecounters-base, gdamore-uart-base, chap-midi-nbase, chap-midi-base
Branch point for: gdamore-uart
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +3 -3 lines
void casts to functions whose return values are ignored.

Revision 1.97.6.1: download - view: text, markup, annotated - select for diffs
Sat Apr 22 11:39:28 2006 UTC (18 years, 7 months ago) by simonb
Branches: simonb-timecounters
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +3 -3 lines
Sync with head.

Revision 1.97.2.1: download - view: text, markup, annotated - select for diffs
Wed Mar 1 09:28:28 2006 UTC (18 years, 9 months ago) by yamt
Branches: yamt-uio_vmspace
Diff to: previous 1.97: preferred, colored; next MAIN 1.98: preferred, colored
Changes since revision 1.97: +3 -3 lines
sync with head.

Revision 1.98: download - view: text, markup, annotated - select for diffs
Mon Feb 20 16:50:37 2006 UTC (18 years, 9 months ago) by thorpej
Branches: MAIN
CVS tags: yamt-uio_vmspace-base5, yamt-pdpolicy-base4, yamt-pdpolicy-base3, yamt-pdpolicy-base2, yamt-pdpolicy-base, peter-altq-base, elad-kernelauth-base, elad-kernelauth
Branch point for: yamt-pdpolicy, peter-altq, chap-midi
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +3 -3 lines
Use device_is_active() rather than testing dv_flags for DVF_ACTIVE
directly.

Revision 1.97: download - view: text, markup, annotated - select for diffs
Sun Dec 11 12:23:50 2005 UTC (18 years, 11 months ago) by christos
Branches: MAIN
Branch point for: yamt-uio_vmspace, simonb-timecounters, rpaulo-netinet-merge-pcb
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +2 -2 lines
merge ktrace-lwp.

Revision 1.55.6.7: download - view: text, markup, annotated - select for diffs
Thu Nov 10 14:07:47 2005 UTC (19 years ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.55.6.6: preferred, colored; branchpoint 1.55: preferred, colored; next MAIN 1.56: preferred, colored
Changes since revision 1.55.6.6: +22 -10 lines
Sync with HEAD. Here we go again...

Revision 1.69.2.2.2.1: download - view: text, markup, annotated - select for diffs
Mon Jul 18 03:57:34 2005 UTC (19 years, 4 months ago) by riz
Branches: 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
Diff to: previous 1.69.2.2: preferred, colored; next MAIN 1.70: preferred, colored
Changes since revision 1.69.2.2: +18 -7 lines
Pull up revision 1.95 (requested by thorpej in ticket #2072):
- When starting an ATA or ATAPI transfer, handle the case where
(*dma_init)()
returns EINVAL, indicating that DMA cannot be done for this
transfer.
Fall back to PIO in this case.
- Add a geodeide_dma_init() routine that checks to make sure that
transfers
start on a 16 byte boundary, returning EINVAL if not.  Works
around a chip
bug that causes a hard system hang.
Problem reported and patch tested by Erik Fair.

Revision 1.96: download - view: text, markup, annotated - select for diffs
Thu Jul 7 17:51:32 2005 UTC (19 years, 4 months ago) by drochner
Branches: MAIN
CVS tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, thorpej-vnode-attr-base, thorpej-vnode-attr, ktrace-lwp-base
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +4 -3 lines
tighten the autoconf constraints by passing the atapi/ata/ata_hl attribute
to config_found()
(after some cleanup we might be able to kill SCSIPI_BUSTYPE_*)

Revision 1.92.2.1: download - view: text, markup, annotated - select for diffs
Wed Jul 6 22:02:54 2005 UTC (19 years, 5 months ago) by tron
Branches: 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, 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, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0
Diff to: previous 1.92: preferred, colored; next MAIN 1.93: preferred, colored
Changes since revision 1.92: +18 -7 lines
Pull up revision 1.95 (requested by thorpej in ticket #553):
- When starting an ATA or ATAPI transfer, handle the case where (*dma_init)()
  returns EINVAL, indicating that DMA cannot be done for this transfer.
  Fall back to PIO in this case.
- Add a geodeide_dma_init() routine that checks to make sure that transfers
  start on a 16 byte boundary, returning EINVAL if not.  Works around a chip
  bug that causes a hard system hang.
Problem reported and patch tested by Erik Fair.

Revision 1.95: download - view: text, markup, annotated - select for diffs
Wed Jul 6 01:46:52 2005 UTC (19 years, 5 months ago) by thorpej
Branches: MAIN
Branch point for: yamt-lazymbuf
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +18 -7 lines
- When starting an ATA or ATAPI transfer, handle the case where (*dma_init)()
  returns EINVAL, indicating that DMA cannot be done for this transfer.
  Fall back to PIO in this case.
- Add a geodeide_dma_init() routine that checks to make sure that transfers
  start on a 16 byte boundary, returning EINVAL if not.  Works around a chip
  bug that causes a hard system hang.

Problem reported and patch tested by Erik Fair.

Revision 1.94: download - view: text, markup, annotated - select for diffs
Tue Jun 7 13:45:11 2005 UTC (19 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +3 -3 lines
Fix typos.

Revision 1.93: download - view: text, markup, annotated - select for diffs
Sun May 29 22:00:50 2005 UTC (19 years, 6 months ago) by christos
Branches: MAIN
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +3 -3 lines
- Sprinkle const
- Avoid variable shadowing.
- Eliminate some caddr_t abuse.

Revision 1.89.4.1: download - view: text, markup, annotated - select for diffs
Fri Apr 29 11:29:16 2005 UTC (19 years, 7 months ago) by kent
Branches: kent-audio2
Diff to: previous 1.89: preferred, colored; next MAIN 1.90: preferred, colored
Changes since revision 1.89: +15 -15 lines
sync with -current

Revision 1.89.6.1: download - view: text, markup, annotated - select for diffs
Sat Mar 19 08:35:47 2005 UTC (19 years, 8 months ago) by yamt
Branches: yamt-km
Diff to: previous 1.89: preferred, colored; next MAIN 1.90: preferred, colored
Changes since revision 1.89: +15 -15 lines
sync with head.  xen and whitespace.  xen part is not finished.

Revision 1.55.6.6: download - view: text, markup, annotated - select for diffs
Fri Mar 4 16:50:32 2005 UTC (19 years, 9 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.55.6.5: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.6.5: +15 -15 lines
Sync with HEAD.

Hi Perry!

Revision 1.92: download - view: text, markup, annotated - select for diffs
Sun Feb 27 00:27:48 2005 UTC (19 years, 9 months ago) by perry
Branches: MAIN
CVS tags: yamt-km-base4, yamt-km-base3, netbsd-3-base, kent-audio2-base
Branch point for: netbsd-3
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +15 -15 lines
nuke trailing whitespace

Revision 1.91: download - view: text, markup, annotated - select for diffs
Tue Feb 1 00:19:34 2005 UTC (19 years, 10 months ago) by reinoud
Branches: MAIN
CVS tags: yamt-km-base2
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +1 -1 lines
Backing out changes to clean up scsipi. I was pointed out there were
problems i hadn't seen. To prevent lossage i'd decided to back off all
changes and let them be reviewed on tech-kern.

Revision 1.90: download - view: text, markup, annotated - select for diffs
Mon Jan 31 23:06:41 2005 UTC (19 years, 10 months ago) by reinoud
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +3 -3 lines
Part of the cleanup of sys/scsipi's use of types; rename all u_int* to
uint* and change the u_long's to uint32_t's where possible. Note that the
iocl definitions/hooks have to be ulong (or u_long) or they'll bomb out.

Revision 1.55.6.5: download - view: text, markup, annotated - select for diffs
Tue Sep 21 13:33:21 2004 UTC (20 years, 2 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.55.6.4: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.6.4: +2 -2 lines
Fix the sync with head I botched.

Revision 1.55.6.4: download - view: text, markup, annotated - select for diffs
Sat Sep 18 14:51:24 2004 UTC (20 years, 2 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.55.6.3: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.6.3: +2 -2 lines
Sync with HEAD.

Revision 1.55.6.3: download - view: text, markup, annotated - select for diffs
Wed Aug 25 06:58:43 2004 UTC (20 years, 3 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.55.6.2: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.6.2: +129 -111 lines
Sync with HEAD.

Revision 1.89: download - view: text, markup, annotated - select for diffs
Sat Aug 21 00:28:34 2004 UTC (20 years, 3 months ago) by thorpej
Branches: MAIN
CVS tags: yamt-km-base, kent-audio1-beforemerge, kent-audio1-base, kent-audio1
Branch point for: yamt-km, kent-audio2
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +13 -4 lines
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.88: download - view: text, markup, annotated - select for diffs
Fri Aug 20 06:39:39 2004 UTC (20 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +43 -37 lines
Move most of wdc_softc into a new atac_softc structure that contains
info common to all types of ATA controllers.

Revision 1.87: download - view: text, markup, annotated - select for diffs
Sat Aug 14 15:08:06 2004 UTC (20 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +45 -42 lines
- 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.86: download - view: text, markup, annotated - select for diffs
Fri Aug 13 04:10:49 2004 UTC (20 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +26 -26 lines
WDCDEBUG -> ATADEBUG.

Revision 1.85: download - view: text, markup, annotated - select for diffs
Fri Aug 13 03:12:59 2004 UTC (20 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +7 -7 lines
Don't bother with bits that tell of the presence of optional callbacks;
just check the function pointers for NULL.

Revision 1.84: download - view: text, markup, annotated - select for diffs
Fri Aug 13 02:16:40 2004 UTC (20 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +4 -4 lines
Move wdcstart() to ata.c and rename it to atastart().

Revision 1.83: download - view: text, markup, annotated - select for diffs
Fri Aug 13 02:10:43 2004 UTC (20 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +3 -3 lines
Move wdc_exec_xfer() to ata.c and rename it ata_exec_xfer().

Revision 1.82: download - view: text, markup, annotated - select for diffs
Thu Aug 12 22:39:41 2004 UTC (20 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +3 -3 lines
Move wdc_addref() and wdc_delref() to ata.c and rename them to
ata_*.

Revision 1.81: download - view: text, markup, annotated - select for diffs
Thu Aug 12 21:34:52 2004 UTC (20 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +5 -5 lines
- 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.80: download - view: text, markup, annotated - select for diffs
Thu Aug 12 21:10:18 2004 UTC (20 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +3 -3 lines
Move wdc_probe_caps() to ata.c and rename it ata_probe_caps().

Revision 1.55.6.2: download - view: text, markup, annotated - select for diffs
Thu Aug 12 11:42:05 2004 UTC (20 years, 3 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.55.6.1: preferred, colored; branchpoint 1.55: preferred, colored
Changes since revision 1.55.6.1: +77 -151 lines
Sync with HEAD.

Revision 1.79: download - view: text, markup, annotated - select for diffs
Thu Aug 12 05:02:50 2004 UTC (20 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +3 -3 lines
Rename some constants:
WDC_COMPLETE -> ATACMD_COMPLETE
WDC_QUEUED -> ATACMD_QUEUED
WDC_TRY_AGAIN -> ATACMD_TRY_AGAIN

Revision 1.78: download - view: text, markup, annotated - select for diffs
Thu Aug 12 04:57:19 2004 UTC (20 years, 3 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +13 -13 lines
Rename "struct wdc_command" to "struct ata_command".

Revision 1.69.2.2: download - view: text, markup, annotated - select for diffs
Wed Aug 11 19:43:52 2004 UTC (20 years, 3 months ago) by jmc
Branches: 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
Diff to: previous 1.69.2.1: preferred, colored; branchpoint 1.69: preferred, colored; next MAIN 1.70: preferred, colored
Changes since revision 1.69.2.1: +19 -6 lines
Pullup rev 1.71 (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.77: download - view: text, markup, annotated - select for diffs
Wed Aug 11 18:41:46 2004 UTC (20 years, 3 months ago) by mycroft
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +7 -7 lines
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.76: download - view: text, markup, annotated - select for diffs
Wed Aug 11 17:51:24 2004 UTC (20 years, 3 months ago) by mycroft
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +33 -17 lines
Change the behavior when a transfer mode setting is rejected.  For PIO, fall
back to mode 3.  For DMA, fall back to mode 0.  These are the minimums for
ATAPI.  For UDMA, fail.

Revision 1.75: download - view: text, markup, annotated - select for diffs
Wed Aug 11 17:49:27 2004 UTC (20 years, 3 months ago) by mycroft
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +19 -115 lines
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.74: download - view: text, markup, annotated - select for diffs
Wed Aug 4 22:44:04 2004 UTC (20 years, 4 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +10 -3 lines
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.73: download - view: text, markup, annotated - select for diffs
Wed Aug 4 18:24:11 2004 UTC (20 years, 4 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +11 -12 lines
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.55.6.1: download - view: text, markup, annotated - select for diffs
Tue Aug 3 10:51:12 2004 UTC (20 years, 4 months ago) by skrll
Branches: ktrace-lwp
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +317 -352 lines
Sync with HEAD

Revision 1.72: download - view: text, markup, annotated - select for diffs
Sun Aug 1 21:40:41 2004 UTC (20 years, 4 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +3 -3 lines
Implement an atabus control device, and define some ATA bus control
IOCTLS. Implement ATABUSIORESET, which will reset the given ATA bus.

Revision 1.71: download - view: text, markup, annotated - select for diffs
Sat Jul 31 21:26:43 2004 UTC (20 years, 4 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +19 -6 lines
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.69.2.1: download - view: text, markup, annotated - select for diffs
Sat May 29 14:05:46 2004 UTC (20 years, 6 months ago) by tron
Branches: netbsd-2-0
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +5 -2 lines
Pull up revision 1.70 (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.70: download - view: text, markup, annotated - select for diffs
Sat May 8 15:03:32 2004 UTC (20 years, 6 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +5 -2 lines
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.69: download - view: text, markup, annotated - select for diffs
Tue Feb 3 20:55:02 2004 UTC (20 years, 10 months ago) by bouyer
Branches: MAIN
CVS tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +4 -2 lines
Clear drive_flags when wdc_atapi_get_params() fails. Avoid a panic later
when probing a slave-only bus in some cases.

Revision 1.68: download - view: text, markup, annotated - select for diffs
Sat Jan 3 23:59:58 2004 UTC (20 years, 11 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +3 -3 lines
More structure member namespace cleanup: thread -> ch_thread

Revision 1.67: download - view: text, markup, annotated - select for diffs
Sat Jan 3 22:56:53 2004 UTC (20 years, 11 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +49 -42 lines
More wdc_channel structure member namespace cleanup:
- channel -> ch_channel
- wdc -> ch_wdc

Revision 1.66: download - view: text, markup, annotated - select for diffs
Sat Jan 3 01:50:53 2004 UTC (20 years, 11 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +17 -17 lines
Rename "struct channel_softc" to "struct wdc_channel".

Revision 1.65: download - view: text, markup, annotated - select for diffs
Thu Jan 1 21:57:42 2004 UTC (20 years, 11 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +49 -70 lines
Tidy this file up.

Revision 1.64: download - view: text, markup, annotated - select for diffs
Thu Jan 1 20:25:22 2004 UTC (20 years, 11 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +9 -9 lines
Prepend "wdc_" to wait_for_drq, wait_for_unbusy, and wait_for_ready.

Revision 1.63: download - view: text, markup, annotated - select for diffs
Thu Jan 1 17:18:54 2004 UTC (20 years, 11 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +61 -61 lines
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.62: download - view: text, markup, annotated - select for diffs
Thu Nov 27 23:02:41 2003 UTC (21 years ago) by fvdl
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +23 -23 lines
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.61: download - view: text, markup, annotated - select for diffs
Wed Oct 29 22:05:15 2003 UTC (21 years, 1 month ago) by bouyer
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +3 -3 lines
freese->freeze, as pointed out by Frederick Bruck.

Revision 1.60: download - view: text, markup, annotated - select for diffs
Wed Oct 15 19:54:32 2003 UTC (21 years, 1 month ago) by bouyer
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +4 -2 lines
Clear chp->ch_drive[i].drive_flags if we didn't find a driver for the
drive.

Revision 1.59: download - view: text, markup, annotated - select for diffs
Wed Oct 8 10:58:13 2003 UTC (21 years, 1 month ago) by bouyer
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +157 -168 lines
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.58: download - view: text, markup, annotated - select for diffs
Sun Oct 5 17:48:49 2003 UTC (21 years, 2 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +4 -5 lines
Remove references to University of California from my copyright notices.

Revision 1.57: download - view: text, markup, annotated - select for diffs
Fri Sep 19 21:36:09 2003 UTC (21 years, 2 months ago) by mycroft
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +32 -62 lines
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.56: download - view: text, markup, annotated - select for diffs
Sun Sep 7 22:11:22 2003 UTC (21 years, 2 months ago) by mycroft
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +3 -2 lines
Set PQUIRK_ONLYBIG in the wdc-atapi frontend, obviating the need to ever test
the "bus type" for this.

Merge all the code in the SCSI and ATAPI backends for "cd" devices.  All of
the mode page handling and whatnot is general to SCSI MMC devices, and should
never have been separated to begin with.  This fixes a variety of problems,
and adds load/unload support for SCSI-attached devices.

Revision 1.52.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 1 16:40:31 2002 UTC (22 years, 1 month ago) by tron
Branches: 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, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001
Diff to: previous 1.52: preferred, colored; next MAIN 1.53: preferred, colored
Changes since revision 1.52: +5 -3 lines
Pull up revision 1.53 (requested by bouyer in ticket #733):
Do PIO transfers for len < 4 bytes. From Matthias Drochner in private mail.

Revision 1.39.2.9: download - view: text, markup, annotated - select for diffs
Fri Oct 18 02:44:12 2002 UTC (22 years, 1 month ago) by nathanw
Branches: nathanw_sa
CVS tags: nathanw_sa_end
Diff to: previous 1.39.2.8: preferred, colored; branchpoint 1.39: preferred, colored; next MAIN 1.40: preferred, colored
Changes since revision 1.39.2.8: +1 -1 lines
Catch up to -current.

Revision 1.43.2.5: download - view: text, markup, annotated - select for diffs
Thu Oct 10 18:42:10 2002 UTC (22 years, 1 month ago) by jdolecek
Branches: kqueue
Diff to: previous 1.43.2.4: preferred, colored; branchpoint 1.43: preferred, colored; next MAIN 1.44: preferred, colored
Changes since revision 1.43.2.4: +3 -3 lines
sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work

Revision 1.55: download - view: text, markup, annotated - select for diffs
Fri Sep 27 15:37:33 2002 UTC (22 years, 2 months ago) by provos
Branches: MAIN
CVS tags: nathanw_sa_before_merge, nathanw_sa_base, kqueue-beforemerge, kqueue-base, kqueue-aftermerge, gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, fvdl_fs64_base
Branch point for: ktrace-lwp
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +3 -3 lines
remove trailing \n in panic().  approved perry.

Revision 1.43.2.4: download - view: text, markup, annotated - select for diffs
Fri Sep 6 08:46:19 2002 UTC (22 years, 3 months ago) by jdolecek
Branches: kqueue
Diff to: previous 1.43.2.3: preferred, colored; branchpoint 1.43: preferred, colored
Changes since revision 1.43.2.3: +6 -4 lines
sync kqueue branch with HEAD

Revision 1.51.2.2: download - view: text, markup, annotated - select for diffs
Thu Aug 29 05:22:52 2002 UTC (22 years, 3 months ago) by gehenna
Branches: gehenna-devsw
Diff to: previous 1.51.2.1: preferred, colored; next MAIN 1.52: preferred, colored
Changes since revision 1.51.2.1: +6 -4 lines
catch up with -current.

Revision 1.39.2.8: download - view: text, markup, annotated - select for diffs
Thu Aug 1 02:45:41 2002 UTC (22 years, 4 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.39.2.7: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.2.7: +6 -4 lines
Catch up to -current.

Revision 1.54: download - view: text, markup, annotated - select for diffs
Fri Jul 26 01:00:44 2002 UTC (22 years, 4 months ago) by wiz
Branches: MAIN
CVS tags: gehenna-devsw-base
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +3 -3 lines
enouth -> enough.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Mon Jul 22 20:31:56 2002 UTC (22 years, 4 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +5 -3 lines
Do PIO transfers for len < 4 bytes. From Matthias Drochner in private mail.

Revision 1.43.2.3: download - view: text, markup, annotated - select for diffs
Sun Jun 23 17:48:42 2002 UTC (22 years, 5 months ago) by jdolecek
Branches: kqueue
Diff to: previous 1.43.2.2: preferred, colored; branchpoint 1.43: preferred, colored
Changes since revision 1.43.2.2: +14 -7 lines
catch up with -current on kqueue branch

Revision 1.39.2.7: download - view: text, markup, annotated - select for diffs
Thu Jun 20 03:46:32 2002 UTC (22 years, 5 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.39.2.6: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.2.6: +12 -4 lines
Catch up to -current.

Revision 1.51.2.1: download - view: text, markup, annotated - select for diffs
Thu May 30 14:47:12 2002 UTC (22 years, 6 months ago) by gehenna
Branches: gehenna-devsw
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +11 -2 lines
Catch up with -current.

Revision 1.52: download - view: text, markup, annotated - select for diffs
Sat May 18 14:49:55 2002 UTC (22 years, 6 months ago) by bouyer
Branches: MAIN
CVS tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1
Branch point for: netbsd-1-6
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +11 -2 lines
If the data len if not a multiple of 2 bytes, force PIO mode. DMA can't
deal with such xfers, and can wedge the system with some controllers.
It's a bug to request such xfers for ATAPI, but as the request may come
from userland we have to protect against it.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Tue Apr 23 20:41:19 2002 UTC (22 years, 7 months ago) by bouyer
Branches: MAIN
Branch point for: gehenna-devsw
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +3 -4 lines
More copyright fixes, pointed out by Thomas. Thanks !

Revision 1.39.2.6: download - view: text, markup, annotated - select for diffs
Wed Apr 17 00:06:11 2002 UTC (22 years, 7 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.39.2.5: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.2.5: +4 -5 lines
Catch up to -current.

Revision 1.50: download - view: text, markup, annotated - select for diffs
Fri Apr 5 18:27:56 2002 UTC (22 years, 8 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +4 -4 lines
Implement mstohz() as discussed on tech-kern, and use it in SCSI drivers
to convert xs->timeout to callout() parameter.

Revision 1.49: download - view: text, markup, annotated - select for diffs
Sun Mar 31 14:36:59 2002 UTC (22 years, 8 months ago) by martin
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +2 -3 lines
Don't clear the adapt structure of the attaching channel - this nukes
all function pointers passed in from the adapter driver.

This partly fixes PR 13480, i.e. the FREECOM CD driver works now in pcmcia
adapters.

The remaining issue (timing problems with slow cards and cardbus bridges)
is probably the cause of several other PRs too.

Revision 1.39.2.5: download - view: text, markup, annotated - select for diffs
Thu Feb 28 04:14:21 2002 UTC (22 years, 9 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.39.2.4: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.2.4: +9 -3 lines
Catch up to -current.

Revision 1.43.2.2: download - view: text, markup, annotated - select for diffs
Mon Feb 11 20:10:12 2002 UTC (22 years, 9 months ago) by jdolecek
Branches: kqueue
Diff to: previous 1.43.2.1: preferred, colored; branchpoint 1.43: preferred, colored
Changes since revision 1.43.2.1: +9 -3 lines
Sync w/ -current.

Revision 1.36.2.3: download - view: text, markup, annotated - select for diffs
Sat Feb 9 17:39:10 2002 UTC (22 years, 9 months ago) by he
Branches: netbsd-1-5
CVS tags: netbsd-1-5-PATCH003
Diff to: previous 1.36.2.2: preferred, colored; branchpoint 1.36: preferred, colored; next MAIN 1.37: preferred, colored
Changes since revision 1.36.2.2: +8 -2 lines
Pull up revision 1.48 (requested by bouyer):
  If we change the ATA modes, also reset the device, so that we
  can retry the command with the new mode.  Fixes PR#15331.

Revision 1.48: download - view: text, markup, annotated - select for diffs
Sun Jan 27 22:00:40 2002 UTC (22 years, 10 months ago) by bouyer
Branches: MAIN
CVS tags: newlock-base, newlock, ifpoll-base, eeh-devprop-base, eeh-devprop
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +9 -3 lines
IF we change the ATA modes, also reset the device, so that we can retry
the command with the new mode.

Revision 1.43.2.1: download - view: text, markup, annotated - select for diffs
Thu Jan 10 19:58:15 2002 UTC (22 years, 10 months ago) by thorpej
Branches: kqueue
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +107 -48 lines
Sync kqueue branch with -current.

Revision 1.39.2.4: download - view: text, markup, annotated - select for diffs
Tue Jan 8 00:31:45 2002 UTC (22 years, 10 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.39.2.3: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.2.3: +105 -49 lines
Catch up to -current.

Revision 1.36.2.2: download - view: text, markup, annotated - select for diffs
Thu Dec 27 12:29:40 2001 UTC (22 years, 11 months ago) by he
Branches: netbsd-1-5
Diff to: previous 1.36.2.1: preferred, colored; branchpoint 1.36: preferred, colored
Changes since revision 1.36.2.1: +12 -2 lines
Pull up revision 1.39 (requested by mycroft):
  Make DVD commands work on drives configured for DMA.

Revision 1.47: download - view: text, markup, annotated - select for diffs
Mon Dec 3 00:20:24 2001 UTC (23 years ago) by bouyer
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +3 -3 lines
Update my copyrigth.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Sun Dec 2 22:44:33 2001 UTC (23 years ago) by bouyer
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +6 -11 lines
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.45: download - view: text, markup, annotated - select for diffs
Sat Dec 1 00:00:29 2001 UTC (23 years ago) by bouyer
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +100 -39 lines
For ATAPI tape drives, poll for DSC (using a callout), to get the real
status of the command, and make sure the drive is ready for the next one.

Revision 1.39.2.3: download - view: text, markup, annotated - select for diffs
Wed Nov 14 19:16:00 2001 UTC (23 years ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.39.2.2: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.2.2: +4 -1 lines
Catch up to -current.

Revision 1.44: download - view: text, markup, annotated - select for diffs
Tue Nov 13 06:56:38 2001 UTC (23 years ago) by lukem
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +4 -1 lines
add RCSIDs

Revision 1.39.2.2: download - view: text, markup, annotated - select for diffs
Fri Aug 24 00:10:41 2001 UTC (23 years, 3 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.39.2.1: preferred, colored; branchpoint 1.39: preferred, colored
Changes since revision 1.39.2.1: +10 -2 lines
Catch up with -current.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Wed Jun 27 13:22:36 2001 UTC (23 years, 5 months ago) by bouyer
Branches: MAIN
CVS tags: thorpej-mips-cache-base, thorpej-mips-cache, thorpej-devvp-base3, thorpej-devvp-base2, thorpej-devvp-base, thorpej-devvp, pre-chs-ubcperf, post-chs-ubcperf
Branch point for: kqueue
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +10 -2 lines
Some ATAPI CD occasionally reports "ATA illegal indication length" for
a request sense command, but the sense is properly transfered anyway.
Ignore the error for this case.

Revision 1.39.2.1: download - view: text, markup, annotated - select for diffs
Thu Jun 21 20:05:40 2001 UTC (23 years, 5 months ago) by nathanw
Branches: nathanw_sa
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +203 -215 lines
Catch up to -current.

Revision 1.42: download - view: text, markup, annotated - select for diffs
Wed Jun 13 18:17:41 2001 UTC (23 years, 5 months ago) by bjh21
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +3 -1 lines
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.41: download - view: text, markup, annotated - select for diffs
Tue May 15 13:53:20 2001 UTC (23 years, 6 months ago) by lukem
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +2 -1 lines
delint: can't have an empty case item at the end of a switch; need a ; at least

Revision 1.40: download - view: text, markup, annotated - select for diffs
Wed Apr 25 17:53:38 2001 UTC (23 years, 7 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +200 -215 lines
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.27.2.7: download - view: text, markup, annotated - select for diffs
Sun Feb 11 19:16:18 2001 UTC (23 years, 9 months ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.27.2.6: preferred, colored; next MAIN 1.28: preferred, colored
Changes since revision 1.27.2.6: +12 -2 lines
Sync with HEAD.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Mon Jan 22 07:00:39 2001 UTC (23 years, 10 months ago) by mycroft
Branches: MAIN
CVS tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base
Branch point for: nathanw_sa
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +12 -2 lines
Force certain commands (i.e. DVD authentication) to PIO mode.  They are
explicitly not supported in DMA mode, and generally return an `illegal field
in CDB' error.
This should have been done ages ago.

Revision 1.27.2.6: download - view: text, markup, annotated - select for diffs
Mon Jan 15 09:24:43 2001 UTC (23 years, 10 months ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.27.2.5: preferred, colored
Changes since revision 1.27.2.5: +20 -80 lines
Let the mid-layer issue the request sense command.

Revision 1.27.2.5: download - view: text, markup, annotated - select for diffs
Mon Nov 20 09:59:23 2000 UTC (24 years ago) by bouyer
Branches: thorpej_scsipi
Diff to: previous 1.27.2.4: preferred, colored
Changes since revision 1.27.2.4: +174 -71 lines
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.

Main changes to the scsipi code itself:
- add a scsipi_channel->type to allow umass to attach to both atapibus and
  scsibus. Will die when IDE is converted from ata_atapi_attach to
  scsipi_channel/scsipi_adapter
- Add a chan_defquirks to scsipi_channel so that adapters can pass a default
  set of quirks to be set for each device attached
- add adapt_getgeom and adapt_accesschk callbacks

Revision 1.20.2.7: download - view: text, markup, annotated - select for diffs
Mon Aug 14 14:11:36 2000 UTC (24 years, 3 months ago) by he
Branches: netbsd-1-4
CVS tags: netbsd-1-4-PATCH003
Diff to: previous 1.20.2.6: preferred, colored; branchpoint 1.20: preferred, colored; next MAIN 1.21: preferred, colored
Changes since revision 1.20.2.6: +18 -8 lines
Pull up revision 1.38 (requested by bouyer):
  If SET_FEATURE for piomode is rejected, fall back to mode 0
  instead of giving up.  Works around "piomode error (0x4)" problem
  with some ATAPI ZIP drives.

Revision 1.36.2.1: download - view: text, markup, annotated - select for diffs
Fri Aug 4 09:43:53 2000 UTC (24 years, 4 months ago) by bouyer
Branches: netbsd-1-5
CVS tags: netbsd-1-5-RELEASE, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +18 -8 lines
pull up 1.37->1.38 (approved by thorpej):
If the SET_FEATURE for piomode is rejected, fallback to mode 0 instead of
reporting an error. This fixes the "piomode error (0x4)" problem with some
ATAPI ZIP drives reported on port-i386.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Thu Aug 3 23:14:31 2000 UTC (24 years, 4 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +18 -8 lines
If the SET_FEATURE for piomode is rejected, fallback to mode 0 instead of
reporting an error.
This fixes the "piomode error (0x4)" problem with some ATAPI ZIP drives
reported on port-i386.

Revision 1.20.2.6: download - view: text, markup, annotated - select for diffs
Fri Jul 7 17:33:51 2000 UTC (24 years, 5 months ago) by he
Branches: netbsd-1-4
Diff to: previous 1.20.2.5: preferred, colored; branchpoint 1.20: preferred, colored
Changes since revision 1.20.2.5: +24 -18 lines
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.37: download - view: text, markup, annotated - select for diffs
Wed Jun 28 16:39:28 2000 UTC (24 years, 5 months ago) by mrg
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +1 -3 lines
remove include of <vm/vm.h>

Revision 1.35.2.1: download - view: text, markup, annotated - select for diffs
Thu Jun 22 17:08:08 2000 UTC (24 years, 5 months ago) by minoura
Branches: minoura-xpg4dl
Diff to: previous 1.35: preferred, colored; next MAIN 1.36: preferred, colored
Changes since revision 1.35: +8 -1 lines
Sync w/ netbsd-1-5-base.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Mon Jun 12 21:10:40 2000 UTC (24 years, 5 months ago) by bouyer
Branches: MAIN
CVS tags: netbsd-1-5-base
Branch point for: netbsd-1-5
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +8 -1 lines
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.35: download - view: text, markup, annotated - select for diffs
Mon May 15 08:48:25 2000 UTC (24 years, 6 months ago) by bouyer
Branches: MAIN
CVS tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +11 -12 lines
Sync copyrigth notice

Revision 1.34: download - view: text, markup, annotated - select for diffs
Sun Apr 2 23:38:20 2000 UTC (24 years, 8 months ago) by augustss
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +2 -1 lines
Let the device thet gets an atapibus attached specify how to kill pending
transfers by giving a function pointer.
The old method always called wdc specific code.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Sat Apr 1 14:32:25 2000 UTC (24 years, 8 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +90 -25 lines
- 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.32: download - view: text, markup, annotated - select for diffs
Thu Mar 23 07:01:43 2000 UTC (24 years, 8 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +7 -6 lines
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.31: download - view: text, markup, annotated - select for diffs
Mon Mar 20 22:57:00 2000 UTC (24 years, 8 months ago) by enami
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +11 -1 lines
Cancel requested command if controller isn't active.

Revision 1.20.2.5: download - view: text, markup, annotated - select for diffs
Sun Jan 23 12:27:03 2000 UTC (24 years, 10 months ago) by he
Branches: netbsd-1-4
CVS tags: netbsd-1-4-PATCH002
Diff to: previous 1.20.2.4: preferred, colored; branchpoint 1.20: preferred, colored
Changes since revision 1.20.2.4: +15 -17 lines
Pull up revision 1.30 (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.30: download - view: text, markup, annotated - select for diffs
Mon Jan 17 00:01:01 2000 UTC (24 years, 10 months ago) by bouyer
Branches: MAIN
CVS tags: chs-ubc2-newbase
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +15 -17 lines
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.27.6.1: download - view: text, markup, annotated - select for diffs
Mon Dec 27 18:35:33 1999 UTC (24 years, 11 months ago) by wrstuden
Branches: wrstuden-devbsize
Diff to: previous 1.27: preferred, colored; next MAIN 1.28: preferred, colored
Changes since revision 1.27: +35 -2 lines
Pull up to last week's -current.

Revision 1.27.4.1: download - view: text, markup, annotated - select for diffs
Mon Nov 15 00:41:22 1999 UTC (25 years ago) by fvdl
Branches: fvdl-softdep
Diff to: previous 1.27: preferred, colored; next MAIN 1.28: preferred, colored
Changes since revision 1.27: +35 -2 lines
Sync with -current

Revision 1.29: download - view: text, markup, annotated - select for diffs
Thu Nov 4 21:16:53 1999 UTC (25 years, 1 month ago) by bouyer
Branches: MAIN
CVS tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, fvdl-softdep-base, comdex-fall-1999-base, comdex-fall-1999
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +2 -2 lines
Pass xfer->c_bcount instead of sc_xfer->datalen to the device, so that
it gets the rigth len for a request sense (from OpenBSD).

Revision 1.27.2.4: download - view: text, markup, annotated - select for diffs
Wed Oct 20 22:42:04 1999 UTC (25 years, 1 month ago) by thorpej
Branches: thorpej_scsipi
Diff to: previous 1.27.2.3: preferred, colored
Changes since revision 1.27.2.3: +7 -7 lines
Fix merge botch.

Revision 1.27.2.3: download - view: text, markup, annotated - select for diffs
Wed Oct 20 22:39:42 1999 UTC (25 years, 1 month ago) by thorpej
Branches: thorpej_scsipi
Diff to: previous 1.27.2.2: preferred, colored
Changes since revision 1.27.2.2: +34 -1 lines
Sync w/ trunk.

Revision 1.27.2.2: download - view: text, markup, annotated - select for diffs
Wed Oct 20 20:39:05 1999 UTC (25 years, 1 month ago) by thorpej
Branches: thorpej_scsipi
Diff to: previous 1.27.2.1: preferred, colored
Changes since revision 1.27.2.1: +2 -3 lines
Eliminate sleeping in adapter routines.  It is not legal as the queue may
be run from interrupt context.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Wed Oct 20 15:22:27 1999 UTC (25 years, 1 month ago) by enami
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +34 -1 lines
Cancel active transfers on aic/wdc detach.
Also makes LS-120 drive works for me again.

Revision 1.27.2.1: download - view: text, markup, annotated - select for diffs
Tue Oct 19 17:39:26 1999 UTC (25 years, 1 month ago) by thorpej
Branches: thorpej_scsipi
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +96 -64 lines
Completely rewritten scsipi_xfer execution engine:
- 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).

There is a lot more work to do, but this correctly functions for the most
part on several file servers I run.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Thu Sep 30 22:57:52 1999 UTC (25 years, 2 months ago) by thorpej
Branches: MAIN
Branch point for: wrstuden-devbsize, thorpej_scsipi, fvdl-softdep
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +24 -21 lines
Cleanup the scsipi_xfer flags:
- `flags' is now gone, replaced with `xs_control' and `xs_status'.
- Massive cleanup of the control flags.  Now we explicitly say that
  a job is to complete asynchronously, rather than relying on side-effects,
  and use a new flag to now that device discovery is being performed.
- Do SCSI device discovery interrupt-driven.

Revision 1.26: download - view: text, markup, annotated - select for diffs
Thu Sep 23 11:04:33 1999 UTC (25 years, 2 months ago) by enami
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +3 -2 lines
Allow to detach wdc, atapibus, wd and cd.

Revision 1.20.2.4: download - view: text, markup, annotated - select for diffs
Sat Aug 28 22:02:01 1999 UTC (25 years, 3 months ago) by he
Branches: netbsd-1-4
Diff to: previous 1.20.2.3: preferred, colored; branchpoint 1.20: preferred, colored
Changes since revision 1.20.2.3: +10 -3 lines
Pull up revision 1.22:
  Retry PIO mode 3 if PIO mode < 3 fails.

Revision 1.20.2.3: download - view: text, markup, annotated - select for diffs
Wed Aug 25 11:20:01 1999 UTC (25 years, 3 months ago) by he
Branches: netbsd-1-4
Diff to: previous 1.20.2.2: preferred, colored; branchpoint 1.20: preferred, colored
Changes since revision 1.20.2.2: +17 -6 lines
Apply patch, pulling up 1.23->1.24 + "return" part of 1.24->1.25:
  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.25: download - view: text, markup, annotated - select for diffs
Mon Aug 9 09:49:48 1999 UTC (25 years, 3 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +4 -6 lines
Add a missing 'return' in previous commit.
Don't use C_NEEDDONE anymore (it's safe to always call scsipi_done()).

Revision 1.24: download - view: text, markup, annotated - select for diffs
Fri Aug 6 12:00:26 1999 UTC (25 years, 4 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +16 -6 lines
- 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.20.2.2.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 21 01:19:08 1999 UTC (25 years, 5 months ago) by thorpej
Branches: chs-ubc2
Diff to: previous 1.20.2.2: preferred, colored; next MAIN 1.20.2.3: preferred, colored
Changes since revision 1.20.2.2: +9 -2 lines
Sync w/ -current.

Revision 1.20.2.2: download - view: text, markup, annotated - select for diffs
Wed May 5 22:39:04 1999 UTC (25 years, 7 months ago) by perry
Branches: netbsd-1-4
CVS tags: netbsd-1-4-RELEASE, netbsd-1-4-PATCH001, kame_14_19990705, kame_14_19990628, kame_141_19991130, kame
Branch point for: chs-ubc2
Diff to: previous 1.20.2.1: preferred, colored; branchpoint 1.20: preferred, colored
Changes since revision 1.20.2.1: +3 -3 lines
pullup 1.22->1.23 (fvdl)

Revision 1.23: download - view: text, markup, annotated - select for diffs
Wed May 5 21:35:15 1999 UTC (25 years, 7 months ago) by perry
Branches: MAIN
CVS tags: chs-ubc2-base
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +3 -3 lines
Add patch from Manuel Bouyer -- his mail message said:

By code inspection I found 2 bugs in the ATAPI code, one may be the cause
of your problem: A counter is not reset when issuing the request_sense
command. This is c_skip, the counter used to track the offset in the data
buffer when a data tranfer needs multiple phases. The effect of this is that
the sense data transfered may be stored outside the sense buffer (sense buffer
+ some, potentially several KB, offset). This can only occur in PIO mode,
DMA is not affected.
This doesn't occur in "normal" use because when reading a data CD, either
the sense is issued for a non-data command (in which case c_skip stays to
0), or an error occured and no data has been transfered, and c_skip is still 0.
I can't see a case where a data READ/WRITE could cause a sense tranfer without
error.

The second problem is that b_resid can be set to a false value (resulting of
the sense tranfer and not the data transfer). Again this is not a problem with
usual data tranfers because both values ends up being 0 when no error occurs.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Thu Apr 15 16:21:27 1999 UTC (25 years, 7 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +10 -3 lines
If setting to pio mode < 3 fails, try to set pio mode 3 before returning
EIO. The spec says ATAPI devices should support "PIO 3 or better".
They are supposed to support less as well. Setting the device to a highter
mode than the controller shoul'nt be a problem, and this is likely what
happens with legaty ISA controllers.
Solve problem reported by Ruey-Shyang Guo.

Revision 1.20.2.1: download - view: text, markup, annotated - select for diffs
Thu Apr 8 15:52:42 1999 UTC (25 years, 8 months ago) by bouyer
Branches: netbsd-1-4
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +6 -3 lines
Pull up atapi_wdc.c rev 1.21 and scsipiconf.h rev 1.30:
Fix botch with atapi capability flags, preventing 16 bytes commands to be ever
sent, and interrupt DRQ capable devices to effectively use interrupts for
the CMD_OUT phase. Didn't break until the code was changed to handle shared
interrupts (and I guess nobody has a device that requires 16 bytes commands
yet). Should fix the hangs reported by some users at first access of an ATAPI
device.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Thu Apr 8 11:29:01 1999 UTC (25 years, 8 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +6 -3 lines
Fix a long-standing bug with the ACAP_* flags:
- the cap field is a u_int8_t, so none of the defined flags would fit in.
  Looks like nobody had a drive using 16 bytes commands.
- the ACAP_DRQ_* flags are all wrong. Just remove them and use the definitions
  from ata/atareg.h, there's no need to duplicate theses. The effect of this
  was that we were always polling for the command phase, even for drives
  with interrupt DRQ. This didn't break until the code was changed to support
  shared interrupts.

Should fix the lookup problems or 'boot hangs' reported by some users, and
kern/7111.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Thu Apr 1 21:46:30 1999 UTC (25 years, 8 months ago) by bouyer
Branches: MAIN
CVS tags: netbsd-1-4-base
Branch point for: netbsd-1-4
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +21 -20 lines
- 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.19: download - view: text, markup, annotated - select for diffs
Thu Mar 25 16:17:37 1999 UTC (25 years, 8 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +26 -23 lines
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.18: download - view: text, markup, annotated - select for diffs
Sun Feb 21 00:52:05 1999 UTC (25 years, 9 months ago) by hubertf
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +3 -1 lines
Only define WDCDEBUG if not already define (e.g. by kernel option)

Revision 1.17: download - view: text, markup, annotated - select for diffs
Mon Feb 15 18:40:01 1999 UTC (25 years, 9 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +14 -3 lines
If the REQUEST_SENSE command fails, issue a reset instead of XS_DRIVER_STUFFUP.
If REQUEST_SENSE succeeds but doens't return any data, return XS_SHORTSENSE
as the sense field will just contain a copy or the error register.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Tue Feb 2 12:59:31 1999 UTC (25 years, 10 months ago) by bouyer
Branches: MAIN
CVS tags: bouyer-ide-last-dist
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +8 -6 lines
For IDE/ATAPI protocols botches, reset the bus and return XS_RESET
instead of XS_DRIVER_STUFFUP.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Fri Jan 29 11:36:20 1999 UTC (25 years, 10 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +3 -3 lines
Cosmetic changes, from Soren S. Jorvan.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Sat Jan 9 03:16:17 1999 UTC (25 years, 10 months ago) by thorpej
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +25 -13 lines
Make this compile again after the void * arith changes.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Fri Jan 8 18:10:36 1999 UTC (25 years, 10 months ago) by augustss
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +23 -13 lines
Avoid arithmetic on `void *' since that's not ANSI C.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Thu Dec 17 13:05:05 1998 UTC (25 years, 11 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +19 -14 lines
Add a new quirk flags, "ADEV_NOSENSE", for devices that don't
handle properly the request sense command. Add <FX320S, , q01> as being
sense-unfriendly in the quirk table.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Wed Dec 16 13:02:04 1998 UTC (25 years, 11 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +19 -5 lines
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.10: download - view: text, markup, annotated - select for diffs
Sat Nov 21 15:41:42 1998 UTC (26 years ago) by drochner
Branches: MAIN
CVS tags: kenh-if-detach-base, kenh-if-detach
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +5 -6 lines
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.9: download - view: text, markup, annotated - select for diffs
Thu Nov 19 21:54:18 1998 UTC (26 years ago) by thorpej
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +8 -8 lines
Adapt to the new scsipi_adapter interface.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Tue Nov 17 14:45:39 1998 UTC (26 years ago) by bouyer
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +58 -21 lines
In atapi_wdc.c, issue a 'REQUEST SENSE' command when appropriate.
Return XS_SENSE when the full sense info has been retrieved, or
XS_SHORTSENSE if only the sense key was available (from the error register)
Make atapi_interpret_sense() deal with this, and call scsipi_interpret_sense()
for XS_SENSE. (XXX sd_interpret_sense() and the ioctl code needs to be made
aware of XS_SHORTSENSE too ! sense hanlding for these is now less broken for
devices that support 'REQUEST SENSE')
All the ATAPI devices I have access to seems to honnor the SENSE_REQUEST
command, but I suspect some ATAPI devices will not (althouh it's mandatory).
The code should be able to deal with this, but is untested ...

Revision 1.7: download - view: text, markup, annotated - select for diffs
Mon Oct 19 12:28:03 1998 UTC (26 years, 1 month ago) by bouyer
Branches: MAIN
CVS tags: chs-ubc-base, chs-ubc
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +6 -2 lines
Move the "warning: bcount value is %d after io" message in a WDCDEBUG_PRINT.
Ifdef DIAGNOSTIC, print the above message only if bcount is < 0.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Tue Oct 13 15:18:48 1998 UTC (26 years, 1 month ago) by bouyer
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +4 -1 lines
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.5: download - view: text, markup, annotated - select for diffs
Tue Oct 13 15:02:43 1998 UTC (26 years, 1 month ago) by bouyer
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +14 -8 lines
In debug message, always print controller:channel:drive

Revision 1.4: download - view: text, markup, annotated - select for diffs
Tue Oct 13 09:34:01 1998 UTC (26 years, 1 month ago) by bouyer
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +8 -7 lines
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.3: download - view: text, markup, annotated - select for diffs
Tue Oct 13 08:59:46 1998 UTC (26 years, 1 month ago) by bouyer
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +10 -6 lines
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.2: download - view: text, markup, annotated - select for diffs
Mon Oct 12 16:09:23 1998 UTC (26 years, 1 month ago) by bouyer
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +713 -0 lines
Merge bouyer-ide

Revision 1.1.2.13: download - view: text, markup, annotated - select for diffs
Mon Oct 12 14:33:39 1998 UTC (26 years, 1 month ago) by bouyer
Branches: bouyer-ide
CVS tags: bouyer-ide-merge
Diff to: previous 1.1.2.12: preferred, colored; branchpoint 1.1: preferred, colored; next MAIN 1.2: preferred, colored
Changes since revision 1.1.2.12: +2 -3 lines
Sync with HEAD.

Revision 1.1.2.12: download - view: text, markup, annotated - select for diffs
Mon Oct 5 08:17:35 1998 UTC (26 years, 2 months ago) by bouyer
Branches: bouyer-ide
Diff to: previous 1.1.2.11: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.11: +3 -10 lines
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.1.2.11: download - view: text, markup, annotated - select for diffs
Sun Oct 4 15:50:23 1998 UTC (26 years, 2 months ago) by bouyer
Branches: bouyer-ide
Diff to: previous 1.1.2.10: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.10: +17 -16 lines
New flag for wdc_xfer: C_DMA, set when a cmd will use DMA. This reduce some
if() in ata_wdc.c and atapi_wdc.c from 3 tests to one.

Revision 1.1.2.10: download - view: text, markup, annotated - select for diffs
Fri Oct 2 19:37:20 1998 UTC (26 years, 2 months ago) by bouyer
Branches: bouyer-ide
Diff to: previous 1.1.2.9: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.9: +9 -9 lines
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.1.2.9: download - view: text, markup, annotated - select for diffs
Fri Oct 2 17:58:37 1998 UTC (26 years, 2 months ago) by bouyer
Branches: bouyer-ide
Diff to: previous 1.1.2.8: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.8: +6 -4 lines
Use channel provided by your caller, not xfer->channel which is unitialized
at this point.

Revision 1.1.2.8: download - view: text, markup, annotated - select for diffs
Sun Sep 20 17:08:02 1998 UTC (26 years, 2 months ago) by bouyer
Branches: bouyer-ide
Diff to: previous 1.1.2.7: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.7: +1 -2 lines
Init up xfer->drive in wdc_ata_bio(), or bad things will happen for drive 1.
No need to init xfer->channel, it's done in wdc_exec_xfer().

Revision 1.1.2.7: download - view: text, markup, annotated - select for diffs
Sun Sep 20 13:16:17 1998 UTC (26 years, 2 months ago) by bouyer
Branches: bouyer-ide
Diff to: previous 1.1.2.6: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.6: +12 -20 lines
- 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.1.2.6: download - view: text, markup, annotated - select for diffs
Thu Aug 13 14:27:51 1998 UTC (26 years, 3 months ago) by bouyer
Branches: bouyer-ide
Diff to: previous 1.1.2.5: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.5: +71 -53 lines
 - 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.1.2.5: download - view: text, markup, annotated - select for diffs
Tue Jun 23 08:07:37 1998 UTC (26 years, 5 months ago) by leo
Branches: bouyer-ide
Diff to: previous 1.1.2.4: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.4: +74 -23 lines
Add necessary cruft to handle swapped byte-lanes on the data-register. It
basically boils down to the fact that there are 2 new options:
WDC_CAPABILITY_{ATA,ATAPI}_NOSTREAM with which you are able to control
the usage bus_space_read_multi_X() vs. bus_space_read_multi_stream_X().

Revision 1.1.2.4: download - view: text, markup, annotated - select for diffs
Fri Jun 19 22:04:25 1998 UTC (26 years, 5 months ago) by leo
Branches: bouyer-ide
Diff to: previous 1.1.2.3: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.3: +15 -14 lines
Use the stream functions where appropriate.

Revision 1.1.2.3: download - view: text, markup, annotated - select for diffs
Fri Jun 19 21:57:56 1998 UTC (26 years, 5 months ago) by leo
Branches: bouyer-ide
Diff to: previous 1.1.2.2: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.2: +1 -3 lines
Fix hw-locking.

Revision 1.1.2.2: download - view: text, markup, annotated - select for diffs
Thu Jun 11 09:27:24 1998 UTC (26 years, 5 months ago) by bouyer
Branches: bouyer-ide
Diff to: previous 1.1.2.1: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.1: +125 -2 lines
pciide: when setting up DMA mode, also enable fast timings for PIO modes
        if possible. For ATAPI devices, commands are always send via PIO.
atapi: matain a drive state (like wd drives) and use it to set up the
       timings if needed.

Revision 1.1.2.1: download - view: text, markup, annotated - select for diffs
Thu Jun 4 16:53:07 1998 UTC (26 years, 6 months ago) by bouyer
Branches: bouyer-ide
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +536 -0 lines
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.1
Thu Jun 4 16:53:07 1998 UTC (26 years, 6 months ago) by bouyer
Branches: MAIN
CVS tags: bouyer-ide-base
Branch point for: bouyer-ide
FILE REMOVED
file atapi_wdc.c was initially added on branch bouyer-ide.

Diff request

This form allows you to request diffs 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.

Log view options

CVSweb <webmaster@jp.NetBSD.org>