Home | History | Annotate | Download | only in mca
History log of /src/sys/dev/mca/edc_mca.c
RevisionDateAuthorComments
 1.55  25-Sep-2022  thorpej Remove unnecessary include of <sys/malloc.h>.
 1.54  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.53  24-Apr-2021  thorpej branches: 1.53.8;
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?).
 1.52  14-Jul-2016  msaitoh branches: 1.52.34;
- Use aprint*() more in xxx_attach().
- Add missing aprint_naive("\n").
- Remove extra spaces and tabs.
- KNF.
 1.51  11-Jul-2016  msaitoh KNF. No functional change.
 1.50  13-Apr-2015  riastradh Convert sys/dev to use <sys/rndsource.h>.
 1.49  20-Mar-2014  skrll branches: 1.49.6;
Mechanically replace simplelock with kmutex_t.
 1.48  12-Oct-2013  christos adjust for recent deferred changes.
 1.47  27-Oct-2012  chs branches: 1.47.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.46  02-Feb-2012  tls branches: 1.46.6;
Entropy-pool implementation move and cleanup.

1) Move core entropy-pool code and source/sink/sample management code
to sys/kern from sys/dev.

2) Remove use of NRND as test for presence of entropy-pool code throughout
source tree.

3) Remove use of RND_ENABLED in device drivers as microoptimization to
avoid expensive operations on disabled entropy sources; make the
rnd_add calls do this directly so all callers benefit.

4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
have lead to slight entropy overestimation for some sources.

5) Add new source types for environmental sensors, power sensors, VM
system events, and skew between clocks, with a sample implementation
for each.

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files). Tested with release
builds on amd64 and evbarm and live testing on amd64.
 1.45  07-Aug-2011  rmind branches: 1.45.2; 1.45.6;
Replace some wakeup_one(9) uses with mutex(9) or plain wakeup(9).
 1.44  12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.43  12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.42  13-Jan-2009  yamt branches: 1.42.2;
g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.41  16-Dec-2008  christos replace bitmask_snprintf(9) with snprintb(3)
 1.40  04-May-2008  martin branches: 1.40.8;
Move to standard TNF 2 clause license
 1.39  08-Apr-2008  cegger branches: 1.39.2; 1.39.4;
use aprint_*_dev and device_xname
 1.38  19-Oct-2007  ad branches: 1.38.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.37  29-Jul-2007  ad branches: 1.37.4; 1.37.6; 1.37.10; 1.37.12;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.36  09-Jul-2007  ad branches: 1.36.2;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.35  16-Nov-2006  christos branches: 1.35.8; 1.35.10;
__unused removal on arguments; approved by core.
 1.34  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.33  29-Mar-2006  thorpej branches: 1.33.8; 1.33.10;
Use device_private().
 1.32  11-Dec-2005  christos branches: 1.32.4; 1.32.6; 1.32.8; 1.32.10; 1.32.12;
merge ktrace-lwp.
 1.31  15-Oct-2005  yamt - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)
 1.30  26-Aug-2005  drochner kill some more simple submatch() functions, use config_stdsubmatch()
 1.29  25-Aug-2005  drochner replace the "locdesc_t" structure carrying the number of locators
explicitely by a plain integer array
the length in now known to all relevant parties, so this avoids
duplication of information, and we can allocate that thing in
drivers without hacks
 1.28  27-Feb-2005  perry branches: 1.28.4;
nuke trailing whitespace
 1.27  04-Feb-2005  perry de-__P
 1.26  28-Oct-2004  yamt branches: 1.26.4; 1.26.6;
move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.25  01-Sep-2004  drochner use a submatch function for drive attachment, and pass locators
just for sanity
 1.24  30-Aug-2004  drochner There is no point in using config_found_sm() if there is no submatch function.
(actually, there should be one...)
 1.23  10-Nov-2003  wiz Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
 1.22  25-Oct-2003  christos Fix uninitialized variable warnings
 1.21  01-Nov-2002  mrg branches: 1.21.6;
implement separate read/write disk statistics:
- disk_unbusy() gets a new parameter to tell the IO direction.
- struct disk_sysctl gets 4 new members for read/write bytes/transfers.
when processing hw.diskstats, add the read&write bytes/transfers for
the old combined stats to attempt to keep backwards compatibility.

unfortunately, due to multiple bugs, this will cause new kernels and old
vmstat/iostat/systat programs to fail. however, the next time this is
change it will not fail again.

this is just the kernel portion.
 1.20  02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.19  30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.18  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.17  20-Jul-2002  hannken Convert to new device buffer queue interface.
 1.16  31-Mar-2002  jdolecek branches: 1.16.2;
edc_cmd_wait(): it is absolutely necessary to wait for the BSR_CMD_INPROGRESS
flag to clear, even when the COMMAND COMPLETE interrupt already did happen,
otherwise we get ATTENTION ERROR for next command if it happens soon
enough; this fixes the reliability problems introduced by previous change

some other cleanup & simlify of edc_cmd_wait()/edc_run_cmd(), the 'secs'
is just a hint used in !poll case only
add some comments
move status_block[] back to edc_mca_softc, to save stack memory
make #ifdef DEBUG #ifdef EDC_DEBUG and g/c some obsolete debug stuff
make some EAGAINs EIOs
edc_intr(): wakeup the waiter for any command, not just READ/WRITE DATA
 1.15  31-Dec-2001  thorpej Labels must be followed by statements.
 1.14  06-Dec-2001  jdolecek it doesn't make sense to wait for resources during autoconfiguration
 1.13  04-Dec-2001  sommerfeld Fix so these files build with options DEBUG enabled.
The change to edc_mca.c may not work as I don't have any mca hardware.
 1.12  02-Dec-2001  jdolecek use the new MCABUS_DMA_16BIT flag to use 16bit DMA (not implicit anymore)
 1.11  23-Nov-2001  jdolecek Convert over to use the new MCA DMA facilities, which encapsulate
the MCA DMA controller access. This also means we gain >16MB RAM support.

While here, overhaul the driver to saner state, especially:
* simplify and clean the attach code a lot, and support the 'drive'
locator
* pass proper dev_t to readdisklabel() - formerly, the passed value was
completely broken (used incorrect major and wrong minor), but worked
by accident
* worker thread is now spawned per controller, rather than per-drive;
i/o cannot be done concurrently by different drivers, only one
i/o can be pending at any time
* simplify the command queue code, just sleep appropriately when
!poll case, g/c 'async' code formerly needed, move the bio code
from ed_mca.c to edc_mca.c:edc_bio()
* put all string arrays used by edc_dump_status_block() within #ifdef EDC_DEBUG,
and use numbers instead if it's not defined; this cuts object size by 5KB
* other misc cleanups
 1.10  13-Nov-2001  lukem add RCSID
 1.9  04-May-2001  jdolecek branches: 1.9.2; 1.9.4;
Implement polled command mode, and use it for writing system dump
and for initial autoconf probes; the latter eliminates need for
deferred configuration (and makes dmesg a bit nicer).

g/c EDF_IODONE flag - protect against interrupt by calling tsleep()
at splbio in worker thread

g/c unneeded stuff, improve some autoconf messages
 1.8  25-Apr-2001  simonb Spell occurred correctly.
 1.7  24-Apr-2001  jdolecek print the drq together with irq, slot info
 1.6  23-Apr-2001  jdolecek branches: 1.6.2;
Compact autoconf info by printing the IRQ number together
with 'at mca0 slot foo' info.
 1.5  22-Apr-2001  jdolecek g/c edc_dev_status[]
 1.4  22-Apr-2001  jdolecek fix edc_dump_status_block() to correctly print Command Error Code and
Device Error Code/Status when appropriate
add one item to TODO - need support for kernel memory crash dumps (to be
implemented "soon")
 1.3  22-Apr-2001  jdolecek edc_dump_status_block(): print RBA # and block count as unsigned
 1.2  22-Apr-2001  jdolecek Fix serious bug in bounce buf handling - the EDF_BOUNCEBUF flag needs
to be cleared always in edmcadone(), otherwise if there is a write
via bounce buffer followed by read directly to buf, the read operation
would return trashed data (the buf data would get overwritten
by contents of bounce buffer in edmcadone()).
Reset b_resid as necessary when the i/o is done, too.

g/c some unneeded stuff, use lockmgr()-style locking in ed_[un]lock(),
better avoid some deadlocks

These changes make the driver quite a bit more stable. It's actually
reliable enough to be possible to newfs the drive and use it for
read/write filesystem now.
 1.1  19-Apr-2001  jdolecek Use "edc" instead of "dasd". As pointed out by Soren, dasd doesn't
mean anything special in IBM-talk. And edc better matches prior art, too.
 1.6.2.2  23-Apr-2001  bouyer Sync with HEAD.
 1.6.2.1  23-Apr-2001  bouyer file edc_mca.c was added on branch thorpej_scsipi on 2001-04-23 09:42:23 +0000
 1.9.4.4  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.9.4.3  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.9.4.2  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.9.4.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.2.8  11-Nov-2002  nathanw Catch up to -current
 1.9.2.7  18-Oct-2002  nathanw Catch up to -current.
 1.9.2.6  01-Aug-2002  nathanw Catch up to -current.
 1.9.2.5  17-Apr-2002  nathanw Catch up to -current.
 1.9.2.4  08-Jan-2002  nathanw Catch up to -current.
 1.9.2.3  14-Nov-2001  nathanw Catch up to -current.
 1.9.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.9.2.1  04-May-2001  nathanw file edc_mca.c was added on branch nathanw_sa on 2001-06-21 20:04:00 +0000
 1.16.2.1  29-Aug-2002  gehenna catch up with -current.
 1.21.6.8  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.21.6.7  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.21.6.6  04-Feb-2005  skrll Sync with HEAD.
 1.21.6.5  02-Nov-2004  skrll Sync with HEAD.
 1.21.6.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.21.6.3  18-Sep-2004  skrll Sync with HEAD.
 1.21.6.2  03-Sep-2004  skrll Sync with HEAD
 1.21.6.1  03-Aug-2004  skrll Sync with HEAD
 1.26.6.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.26.6.1  12-Feb-2005  yamt sync with head.
 1.26.4.1  29-Apr-2005  kent sync with -current
 1.28.4.4  27-Oct-2007  yamt sync with head.
 1.28.4.3  03-Sep-2007  yamt sync with head.
 1.28.4.2  30-Dec-2006  yamt sync with head.
 1.28.4.1  21-Jun-2006  yamt sync with head.
 1.32.12.1  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.32.10.1  19-Apr-2006  elad sync with head.
 1.32.8.1  01-Apr-2006  yamt sync with head.
 1.32.6.1  22-Apr-2006  simonb Sync with head.
 1.32.4.1  09-Sep-2006  rpaulo sync with head
 1.33.10.2  10-Dec-2006  yamt sync with head.
 1.33.10.1  22-Oct-2006  yamt sync with head
 1.33.8.1  18-Nov-2006  ad Sync with head.
 1.35.10.1  11-Jul-2007  mjf Sync with head.
 1.35.8.5  23-Oct-2007  ad Sync with head.
 1.35.8.4  19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.35.8.3  13-May-2007  ad - Pass the error number and residual count to biodone(), and let it handle
setting error indicators. Prepare to eliminate B_ERROR.
- Add a flag argument to brelse() to be set into the buf's flags, instead
of doing it directly. Typically used to set B_INVAL.
- Add a "struct cpu_info *" argument to kthread_create(), to be used to
create bound threads. Change "bool mpsafe" to "int flags".
- Allow exit of LWPs in the IDL state when (l != curlwp).
- More locking fixes & conversion to the new API.
 1.35.8.2  10-Apr-2007  ad Nuke the deferred kthread creation stuff, as it's no longer needed.
Pointed out by thorpej@.
 1.35.8.1  09-Apr-2007  ad - Add two new arguments to kthread_create1: pri_t pri, bool mpsafe.
- Fork kthreads off proc0 as new LWPs, not new processes.
 1.36.2.1  15-Aug-2007  skrll Sync with HEAD.
 1.37.12.2  29-Jul-2007  ad It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.37.12.1  29-Jul-2007  ad file edc_mca.c was added on branch matt-mips64 on 2007-07-29 12:50:22 +0000
 1.37.10.1  25-Oct-2007  bouyer Sync with HEAD.
 1.37.6.1  06-Nov-2007  matt sync with HEAD
 1.37.4.1  26-Oct-2007  joerg 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.
 1.38.16.2  17-Jan-2009  mjf Sync with HEAD.
 1.38.16.1  02-Jun-2008  mjf Sync with HEAD.
 1.39.4.3  16-May-2009  yamt sync with head
 1.39.4.2  04-May-2009  yamt sync with head.
 1.39.4.1  16-May-2008  yamt sync with head.
 1.39.2.1  18-May-2008  yamt sync with head.
 1.40.8.1  19-Jan-2009  skrll Sync with HEAD.
 1.42.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.45.6.1  18-Feb-2012  mrg merge to -current.
 1.45.2.3  22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.45.2.2  30-Oct-2012  yamt sync with head
 1.45.2.1  17-Apr-2012  yamt sync with head
 1.46.6.3  03-Dec-2017  jdolecek update from HEAD
 1.46.6.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.46.6.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.47.2.1  18-May-2014  rmind sync with head
 1.49.6.2  05-Oct-2016  skrll Sync with HEAD
 1.49.6.1  06-Jun-2015  skrll Sync with HEAD
 1.52.34.2  22-Mar-2021  thorpej Audit CFARG_IATTR in config_found() calls, and remove it in situations
where the interface attribute is not ambiguous.
 1.52.34.1  22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.53.8.1  04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed