315813 |
23-Mar-2017 |
mav |
MFC r311305 (by asomers): Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)
The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are fixed-length strings. AFAICT the only place they're read is in sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated. However, the kernel doesn't null-terminate them. A bunch of copy-pasted code uses strncpy to write them, and doesn't guarantee null-termination. For at least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually overflows. You can see the result by doing "camcontrol negotiate da0 -v".
This change null-terminates those fields everywhere they're set in the kernel. It also shortens a few strings to ensure they'll fit within the 16-character field.
PR: 215474 Reported by: Coverity CID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005 CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000 CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014 CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021 CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027 CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187 CID: 1010035 1010036 1010042 1010041 1010040 1010039 |
315140 |
12-Mar-2017 |
mav |
MFC r314308: Fix LUN enabling on wildcard target, as done by CTL. |
305615 |
08-Sep-2016 |
pfg |
MFC r303891, r303892: sys: replace comma with semicolon when pertinent.
Uses of commas instead of a semicolons can easily go undetected. The comma can serve as a statement separator but this shouldn't be abused when statements are meant to be standalone. |
300060 |
17-May-2016 |
pfg |
MFC r298931, r298981, r299375:
Minor spelling fixes in: sys/dev, sys/sys
Many of these have user-visible strings. |
284176 |
09-Jun-2015 |
achim |
MFC r284022: Avoid ID conflict |
276486 |
31-Dec-2014 |
ngie |
MFC r264400,r265836:
r264400:
NO_MAN= has been deprecated in favor of MAN= for some time, go ahead and finish the job. ncurses is now the only Makefile in the tree that uses it since it wasn't a simple mechanical change, and will be addressed in a future commit.
r265836:
Remove last two NO_MAN= in the tree. In both of these cases, MAN= is what is needed. |
270284 |
21-Aug-2014 |
ian |
MFC r260401
Remove aicasm as a build dependency. It made sense when the ahc and ahd drivers and their firmware were under active development, but those days have passed. The firmware now exists in pre-compiled form, no longer dependent on it's sources or on aicasm. If you wish to rebuild the firmware from source, the glue still exists under the 'make firmware' target in sys/modules/aic7xxx.
This also fixes the problem introduced with r257777 et al with building kernels the old fashioned way in sys/$arch/compile/$CONFIG when the ahc/ahd drivers were included. |
270274 |
21-Aug-2014 |
ian |
MFC r257637, r257730, r257734, r257777, r257825, r257838, r257873:
Changes to how the aicasm tool is built. This series of changes results in the aicasm tool being built as part of the tools stages of world and kernel builds.
Most of these changes will ultimately be undone when r260401 is MFC'd, but it will leave in place the new kernel-build-tool machinery (KTMAKE stuff) in case a new special kernel tool ever comes along. |
266207 |
16-May-2014 |
ian |
MFC r262534, r262548, r262549, r262552, r262568, r262581, r262583, r262584, r262585, r262587, r262696, r262712
Replace many pasted identical definitions of cpu_initclocks() with a common implementation in arm/machdep.c.
aicasm: Don't complain about missing prototypes to ease bootstrap issues.
Vybrid: Add driver for Inter-Integrated Circuit (I2C).
imx6: Initialize the Low Power Mode bits to keep the ARM cores running during WFI.
All our current ARM multi-core systems have all cores in one package with a shared L2 cache, reflect that in the common cpu_topo() routine.
mpcore timer: Supply a DELAY() implementation via weak linkage, so that SoC-specific code can supply a better implementation.
imx6: Add some rudimentary voltage control.
Add an armv7 implementation of cpu_sleep().
Add __used attribute so that the DELAY implementation doesn't get optimized away as unreferenced, causing linker errors when trying to resolve the weak reference to the missing function. |
260342 |
05-Jan-2014 |
mav |
MFC r256826: Fix several target mode SIMs to not blindly clear ccb_h.flags field of ATIO CCBs. Not all CCB flags there belong to them. |
259981 |
28-Dec-2013 |
dim |
MFC r259833:
Remove another unused static const variable num_chip_names, from aic7xxx.c this time.
Noticed by: pluknet |
259979 |
28-Dec-2013 |
dim |
MFC r259827:
Remove unused static const variable num_chip_names from aic79xx.c.
Reviewed by: gibbs |
256281 |
10-Oct-2013 |
gjb |
Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation
|
254263 |
12-Aug-2013 |
scottl |
Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCI command register. The lazy BAR allocation code in FreeBSD sometimes disables this bit when it detects a range conflict, and will re-enable it on demand when a driver allocates the BAR. Thus, the bit is no longer a reliable indication of capability, and should not be checked. This results in the elimination of a lot of code from drivers, and also gives the opportunity to simplify a lot of drivers to use a helper API to set the busmaster enable bit.
This changes fixes some recent reports of disk controllers and their associated drives/enclosures disappearing during boot.
Submitted by: jhb Reviewed by: jfv, marius, achadd, achim MFC after: 1 day
|
253646 |
25-Jul-2013 |
uqs |
Match function definition to declaration and call-site.
SVN r95378 refactored ahc_9005_subdevinfo_valid out into a separate function but swapped the vendor/subvendor and device/subdevice pairs of the parameters.
Found by: Coverity Prevent, CID 744931 Reviewed by: gibbs
|
250460 |
10-May-2013 |
eadler |
Fxi a bunch of typos.
PR: misc/174625 Submitted by: Jeremy Chadwick <jdc@koitsu.org>
|
249574 |
17-Apr-2013 |
neel |
Correct misleading bootverbose output: ahc_isa_probe -> ahc_isa_identify
|
246713 |
12-Feb-2013 |
kib |
Reform the busdma API so that new types may be added without modifying every architecture's busdma_machdep.c. It is done by unifying the bus_dmamap_load_buffer() routines so that they may be called from MI code. The MD busdma is then given a chance to do any final processing in the complete() callback.
The cam changes unify the bus_dmamap_load* handling in cam drivers.
The arm and mips implementations are updated to track virtual addresses for sync(). Previously this was done in a type specific way. Now it is done in a generic way by recording the list of virtuals in the map.
Submitted by: jeff (sponsored by EMC/Isilon) Reviewed by: kan (previous version), scottl, mjacob (isp(4), no objections for target mode changes) Discussed with: ian (arm changes) Tested by: marius (sparc64), mips (jmallet), isci(4) on x86 (jharris), amd64 (Fabian Keil <freebsd-listen@fabiankeil.de>)
|
243906 |
05-Dec-2012 |
bapt |
remove redundant yyparse declarations
PR: conf/174079 Submitted by: Garrett Cooper <yanegomi@gmail.com>
|
243037 |
14-Nov-2012 |
dim |
Fix a bug in aicasm_gram.y, noted by a newer clang 3.2 snapshot: it compared an enum scope_type against a yacc-generated define, so the condition would always be false.
MFC after: 3 days
|
239104 |
06-Aug-2012 |
dim |
In sys/dev/aic7xxx/aic79xx_osm.c, function ahd_attach(), initialize the 'path' variable to NULL, to avoid using it uninitialized in certain cases.
Found by: clang MFC after: 1 week
|
239047 |
05-Aug-2012 |
eadler |
Remove variables which are initialized but never used thereafter reported by gcc46 warning
Reviewed by: scottl Approved by: cperciva MFC after: 1 week
|
237601 |
26-Jun-2012 |
ken |
Fix an issue that caused the kernel to panic inside CTL when trying to attach to target capable HBAs that implement the old immediate notify (XPT_IMMED_NOTIFY) and notify acknowledge (XPT_NOTIFY_ACK) CCBs. The new API has been in place since SVN change 196008 in 2009.
The solution is two-fold: fix CTL to handle the responses from the HBAs, and convert the HBA drivers in question to use the new API.
These drivers have not been tested with CTL, so how well they will interoperate with CTL is unknown.
scsi_target.c: Update the userland target example code to use the new immediate notify API.
scsi_ctl.c: Detect when an immediate notify CCB is returned with CAM_REQ_INVALID or CAM_PROVIDE_FAIL status, and just free it.
Fix a duplicate assignment.
aic79xx.c, aic79xx_osm.c: Update the aic79xx driver to use the new API. Target mode is not enabled on for this driver, so the changes will have no practical effect.
aic7xxx.c, aic7xxx_osm.c: Update the aic7xxx driver to use the new API.
sbp_targ.c: Update the firewire target code to work with the new API.
mpt_cam.c: Update the mpt(4) driver to work with the new API. Target mode is only enabled for Fibre Channel mpt(4) devices.
MFC after: 3 days
|
236578 |
04-Jun-2012 |
dim |
Fix build of aicasm when CC=clang. This was due to a side-effect of the EARLY_BUILD macro: the -Qunused-arguments flag isn't passed anymore when building this particular program. However, with clang 3.1 and -Werror, such unused argument warnings are flagged as errors, causing buildkernel to fail at this stage, due to the -nostdinc flag passed during linking. Since the -nostdinc flag isn't actually needed, just remove it.
X-MFC-With: r236528
|
236571 |
04-Jun-2012 |
dim |
Make aicasm compile without warnings if -Wpointer-sign is enabled.
MFC after: 3 days
|
233479 |
25-Mar-2012 |
rmh |
Follow non-BSD case when GNU/Hurd is detected.
|
232882 |
12-Mar-2012 |
jmallett |
Remove comments about creating DMA tags as children of the DMA tags of their parent bus where the code has now been modified to do so.
Reviewed by: scottl
|
228556 |
16-Dec-2011 |
dim |
Add "%option noinput" to aicasm_scan.l and aicasm_macro_scan.l, so no unneeded input functions will be emitted.
Spotted by: arundel MFC after: 1 week
|
224046 |
15-Jul-2011 |
emaste |
Improve portability #defines for compiling aicasm on other systems.
Submitted by: Robert Millan rmh debian.org Obtained from: Debian GNU/kFreeBSD
|
220863 |
19-Apr-2011 |
dim |
Remove support for the Intel C Compiler from the build infrastructure. This support has not worked for several years, and is not likely to work again, unless Intel decides to release a native FreeBSD version of their compiler. ;)
|
219902 |
23-Mar-2011 |
jhb |
Do a sweep of the tree replacing calls to pci_find_extcap() with calls to pci_find_cap() instead.
|
219577 |
12-Mar-2011 |
marius |
Allocate the DMA memory shared between the host and the controller as coherent.
Approved by: gibbs MFC after: 2 weeks
|
218909 |
21-Feb-2011 |
brucec |
Fix typos - remove duplicate "the".
PR: bin/154928 Submitted by: Eitan Adler <lists at eitanadler.com> MFC after: 3 days
|
213845 |
14-Oct-2010 |
rpaulo |
Revert r213765. This is required because our build infrastructure uses the host lex instead of the lex built during buildworld. I will MFC the lex changes soon and in a few weeks this I'll commit again r213765.
|
213765 |
13-Oct-2010 |
rpaulo |
Define YY_NO_INPUT. This makes aicasm buildable by clang with Werror turned on.
|
211437 |
17-Aug-2010 |
rpaulo |
For every instance of '.if ${CC} == "foo"' or '.if ${CC} != "foo"' in Makefiles or *.mk files, use ${CC:T:Mfoo} instead, so only the basename of the compiler command (excluding any arguments) is considered.
This allows you to use, for example, CC="/nondefault/path/clang -xxx", and still have the various tests in bsd.*.mk identify your compiler as clang correctly.
ICC if cases were also changed.
Submitted by: Dimitry Andric <dimitry at andric.com>
|
210055 |
14-Jul-2010 |
gibbs |
Correct logic bug in aicasm's undefined register bit access detection code.
The code in question verifies that all register write operations only change bits that are defined (in the register definition file) for that effected register. The bug effectively disabled this checking.
o Fix the check by testing the opcode against all supported read ("and" based) operands.
o Add missing bit definitions to the aic7xxx and aic79xx register definition files so that the warning (treated as a fatal error) does not spuriously fire.
Reported by: Pawel Worach <pawel.worach@gmail.com> MFC after: 1 week
|
203685 |
08-Feb-2010 |
brucec |
Document the usfs driver and the NO_SYSCTL_DESCR option, and update the comment for umass. Don't include the sysctl description variables in aic7xxx when NO_SYSCTL_DESCR is used.
Approved by: rrs (mentor)
|
202161 |
12-Jan-2010 |
gavin |
Spell "Hz" correctly wherever it is user-visible.
PR: bin/142566 Submitted by: N.J. Mann njm njm.me.uk Approved by: ed (mentor) MFC after: 2 weeks
|
201300 |
31-Dec-2009 |
ed |
Disable K&R style function definitions for WARNS=6.
Unfortunately there are two slight problems with that:
- Yacc and lex might generate code that generates warnings because of this. Require yacc and lex to be rebuilt during bootstrap. I'm not incrementing __FreeBSD_version here, because I assume someone else will do this eventually.
- When running `make buildkernel', it uses share/mk from the source treeo to build aicasm. Because aicasm also depends on lex, this would break. Lower WARNS to 5 for now. We should just increment it to 6 again somewhere in the very far future.
|
201261 |
30-Dec-2009 |
ed |
Add missing `void' keywords.
|
199260 |
13-Nov-2009 |
attilio |
Add sysctls in ahd(4) in order to keep track of different classes of errors. So far 3 different classes are present (correctable, uncorrectable and fatal) but more can be added easilly.
Obtained from: Sandvine Incorporated Reviewed by: emase, gibbs Sponsored by: Sandvine Incorporated MFC: 2 weeks
|
198684 |
30-Oct-2009 |
brueffer |
Add support for Adaptec 39320LPE adapters.
PR: 124202 Submitted by: Andre Albsmeier <Andre.Albsmeier@siemens.com> Reviewed by: gibbs MFC after: 1 week
|
198327 |
21-Oct-2009 |
brueffer |
Add a missing free() call.
PR: 138379 Submitted by: Patroklos Argyroudis <argp@census-labs.com> Reviewed by: gibbs MFC after: 1 week
|
195534 |
10-Jul-2009 |
scottl |
Separate the parallel scsi knowledge out of the core of the XPT, and modularize it so that new transports can be created.
Add a transport for SATA
Add a periph+protocol layer for ATA
Add a driver for AHCI-compliant hardware.
Add a maxio field to CAM so that drivers can advertise their max I/O capability. Modify various drivers so that they are insulated from the value of MAXPHYS.
The new ATA/SATA code supports AHCI-compliant hardware, and will override the classic ATA driver if it is loaded as a module at boot time or compiled into the kernel. The stack now support NCQ (tagged queueing) for increased performance on modern SATA drives. It also supports port multipliers.
ATA drives are accessed via 'ada' device nodes. ATAPI drives are accessed via 'cd' device nodes. They can all be enumerated and manipulated via camcontrol, just like SCSI drives. SCSI commands are not translated to their ATA equivalents; ATA native commands are used throughout the entire stack, including camcontrol. See the camcontrol manpage for further details. Testing this code may require that you update your fstab, and possibly modify your BIOS to enable AHCI functionality, if available.
This code is very experimental at the moment. The userland ABI/API has changed, so applications will need to be recompiled. It may change further in the near future. The 'ada' device name may also change as more infrastructure is completed in this project. The goal is to eventually put all CAM busses and devices until newbus, allowing for interesting topology and management options.
Few functional changes will be seen with existing SCSI/SAS/FC drivers, though the userland ABI has still changed. In the future, transports specific modules for SAS and FC may appear in order to better support the topologies and capabilities of these technologies.
The modularization of CAM and the addition of the ATA/SATA modules is meant to break CAM out of the mold of being specific to SCSI, letting it grow to be a framework for arbitrary transports and protocols. It also allows drivers to be written to support discrete hardware without jeopardizing the stability of non-related hardware. While only an AHCI driver is provided now, a Silicon Image driver is also in the works. Drivers for ICH1-4, ICH5-6, PIIX, classic IDE, and any other hardware is possible and encouraged. Help with new transports is also encouraged.
Submitted by: scottl, mav Approved by: re
|
193314 |
02-Jun-2009 |
delphij |
Re-enable WARNS=6 after my universe test.
|
193268 |
01-Jun-2009 |
delphij |
Initialize the match structure. This is unnecessary but gcc insists to complain about it when we raise the WARNS level.
|
193247 |
01-Jun-2009 |
delphij |
Revert the WARNS change for now, need some time to fix the real problem.
|
193245 |
01-Jun-2009 |
delphij |
Mark as WARNS=6.
|
193244 |
01-Jun-2009 |
delphij |
Code cleanups to make this WARNS=6 clean.
PR: bin/96128
|
189575 |
09-Mar-2009 |
imp |
remove now-redunant cardbus attachment.
|
183054 |
15-Sep-2008 |
sam |
Make ddb command registration dynamic so modules can extend the command set (only so long as the module is present): o add db_command_register and db_command_unregister to add and remove commands, respectively o replace linker sets with SYSINIT's (and SYSUINIT's) that register commands o expose 3 list heads: db_cmd_table, db_show_table, and db_show_all_table for registering top-level commands, show operands, and show all operands, respectively
While here also: o sort command lists o add DB_ALIAS, DB_SHOW_ALIAS, and DB_SHOW_ALL_ALIAS to add aliases for existing commands o add "show all trace" as an alias for "show alltrace" o add "show all locks" as an alias for "show alllocks"
Submitted by: Guillaume Ballet <gballet@gmail.com> (original version) Reviewed by: jhb MFC after: 1 month
|
176366 |
17-Feb-2008 |
gibbs |
Only print sense data diagnostics if debugging is enabled with the AHD_SHOW_SENSE flag.
|
176364 |
17-Feb-2008 |
gibbs |
Remove superfluous setting of the transport_version field of our path inquiry response - a likely holdover from the port of this code from the aic7xxx driver.
|
176355 |
17-Feb-2008 |
gibbs |
Advertise to CAM the ability of 790X controllers to negotiate information unit transfers (packetized/U320 protocol) and QAS.
|
172842 |
21-Oct-2007 |
julian |
fix up some code for older systems changed by accident in the last commit this whole support for systems earlier than 5.0 should probably be removed but I'll at least FIX it before removing it, so that CVS has it right.
|
172836 |
20-Oct-2007 |
julian |
Rename the kthread_xxx (e.g. kthread_create()) calls to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first.
I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls.
|
171675 |
31-Jul-2007 |
scottl |
Fix locking mistakes in the error recovery paths of the AHC and AHD drivers.
Approved by: re
|
170872 |
17-Jun-2007 |
scottl |
Prepare for future integration between CAM and newbus. xpt_bus_register now takes a device_t to be the parent of the bus that is being created. Most SIMs have been updated with a reasonable argument, but a few exceptions just pass NULL for now. This argument isn't used yet and the newbus integration likely won't be ready until after 7.0-RELEASE.
|
168873 |
19-Apr-2007 |
scottl |
Up until now, the free SCB pool received only a small initial allocation, and new SCBs were allocated on demand later if needed. This has two problems. First, allocating SCBs involves allocating contiguous memory, and if memory is exhausted then the VM will try to page out to satisfy the request, leading to recursion and deadlock. The second problem is that it can cause lock order reversals due to parts of the VM still being under Giant.
Fix the problem be allocating the full pool at driver attach, when it is safe to do so.
|
168807 |
17-Apr-2007 |
scottl |
Basic MPSAFE locking for the AHC and AHD drivers.
|
168752 |
15-Apr-2007 |
scottl |
Remove Giant from CAM. Drivers (SIMs) now register a mutex that CAM will use to synchornize and protect all data objects that are used for that SIM. Drivers that are not yet MPSAFE register Giant and operate as usual. RIght now, no drivers are MPSAFE, though a few will be changed in the coming week as this work settles down.
The driver API has changed, so all CAM drivers will need to be recompiled. The userland API has not changed, so tools like camcontrol do not need to be recompiled.
|
166901 |
23-Feb-2007 |
piso |
o break newbus api: add a new argument of type driver_filter_t to bus_setup_intr()
o add an int return code to all fast handlers
o retire INTR_FAST/IH_FAST
For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current
Reviewed by: many Approved by: re@
|
166813 |
18-Feb-2007 |
ceri |
Correct typos containing my login name (plus one more in expr.y). Found courtesy of a recursive grep in the wrong directory.
|
166109 |
19-Jan-2007 |
jhb |
- Change the PCI-X registers constants to be relative to the PCI-X PCI capability rather than hardcoded offsets for a particular card. While I'm here, expand the constants some. - Change the ahd(4) driver to use pci_find_extcap() to locate the PCI-X capability to keep up with the first change.
Reviewed by: scottl, gibbs (earlier version)
|
165628 |
29-Dec-2006 |
yar |
Fix a group of typos: preceed -> precede, preceeded -> preceded, preceeding -> preceding.
Submitted by: Andre Guibert de Bruet <andy@siliconlandmark.com>
|
163896 |
02-Nov-2006 |
mjacob |
2nd and final commit that moves us to CAM_NEW_TRAN_CODE as the default.
Reviewed by multitudes.
|
162051 |
05-Sep-2006 |
mjacob |
Coverity: initialize some variables before potential use.
|
161928 |
03-Sep-2006 |
jmg |
add a newbus method for obtaining the bus's bus_dma_tag_t... This is required by arches like sparc64 (not yet implemented) and sun4v where there are seperate IOMMU's for each PCI bus... For all other arches, it will end up returning NULL, which makes it a no-op...
Convert a few drivers (the ones we've been working w/ on sun4v) to the new convection... Eventually all drivers will need to replace the parent tag of NULL, w/ bus_get_dma_tag(dev), though dev is usually different for each driver, and will require hand inspection...
Reviewed by: scottl (earlier version)
|
158651 |
16-May-2006 |
phk |
Since DELAY() was moved, most <machine/clock.h> #includes have been unnecessary.
|
156412 |
07-Mar-2006 |
jhb |
Clean up the way we handle auxiliary commands for a given ddb command table. Previously, the ddb code knew of each linker set of auxiliary commands and which explicit command list they were tied to. These changes add a simple command_table struct that contains both the static list of commands and the pointers for any auxiliary linker set of additional commands. This also makes it possible for other arbitrary command tables to be defined in other parts of the kernel w/o having to edit ddb itself.
The DB_SET macro has also been trimmed down to just creating an entry in a linker set. A new DB_FUNC macro does what the old DB_SET did which is to not only add an entry to the linker set but also to include a function prototype for the function being added. With these changes, it's now also possible to create aliases for ddb functions using DB_SET() directly if desired.
|
153165 |
06-Dec-2005 |
ru |
Fix -Wundef warnings from compiling GENERIC and LINT kernels of all architectures.
|
153110 |
05-Dec-2005 |
ru |
Fix -Wundef warnings found when compiling i386 LINT, GENERIC and custom kernels.
|
153072 |
04-Dec-2005 |
ru |
Fix -Wundef.
|
152648 |
21-Nov-2005 |
ru |
Fix mysterious build failures (with parallel make) early in buildkernel: provide a real but dummy name to ${DEPENDFILE} so that the relevant exists() check in bsd.prog.mk fails and ensures that ${GENHDRS} are built before any other objects.
MFC after: 3 days
|
150453 |
22-Sep-2005 |
gibbs |
Use the AHC_DISABLE_PCI_PERR flag to silence parity error reporting on chips where setting the FAILDIS bit is not effective. While here, try again to make it clear that reported parity errors indicate a failure of some PCI device *other than* the aic7xxx controller.
|
150451 |
22-Sep-2005 |
gibbs |
Enhance diagnostic printfs for the chains of free lists used to avoid SCB ID collissions to non-packetized targets.
|
150450 |
22-Sep-2005 |
gibbs |
Correct bug that caused the completed "recovery" scb to have its timer reset rather than the timer of an SCB still pending on the controller after recovery completed. This should correct timeout loops seen in the field.
|
150449 |
22-Sep-2005 |
gibbs |
Set allow_memio to 1 if fetching the allow_memio hint fails. This is the default behavior according the the bootverbose printf in the failure case.
|
148659 |
03-Aug-2005 |
rwatson |
Back out change accidentally committed as Makefile:1.21 -- a local tweak to let the 6.x/7.x kernel series build on a 5.x userland.
Pointed out by: njl
|
148654 |
03-Aug-2005 |
rwatson |
Modify device drivers supporting multicast addresses to lock if_addr_mtx over iteration of their multicast address lists when synchronizing the hardware address filter with the network stack-maintained list.
Problem reported by: Ed Maste (emaste at phaedrus dot sandvine dot ca> MFC after: 1 week
|
146734 |
29-May-2005 |
nyan |
Remove bus_{mem,p}io.h and related code for a micro-optimization on i386 and amd64. The optimization is a trivial on recent machines.
Reviewed by: -arch (imp, marcel, dfr)
|
144370 |
31-Mar-2005 |
sam |
remove useless ptr check; cur_column can never be null
Noticed by: Coverity Prevent analysis tool
|
143164 |
05-Mar-2005 |
imp |
Use BUS_PROBE_DEFAULT for pci probe return value
|
141999 |
16-Feb-2005 |
gibbs |
aic79xx.c: aic7xxx.c: Allow print_reg() to be called with a NULL column.
aic79xx.c: Correct new usage of SCB_GET_TAG().
aic7xxx.c: Fix stray ahd that snuck in here.
|
141979 |
16-Feb-2005 |
gibbs |
On Rev. B silicon, we disabled the enhanced busfree detection logic to close holes in detecting busfrees that occur after a packetized target transitions to a non-packetized phase. The most common case where this occurs is when a target is externally reset so the controller believes a packetzied negotiation agreement is still in effect. Unfortunately, disabling this feature seems to cause problems for the 7901B. Re-enable ehanced busfree detection for this part until I can get my hands on a samble to figure out if the old workaround is necessary and, if so, how to make it work correctly.
|
141978 |
16-Feb-2005 |
gibbs |
MF5S: Explicitly initialize timedout_scb lists, use SCB_TAG for all access to the hardware_scb->tag field, limit max lun reported to CAM to 63, return after a panic to silence a warning.
|
139757 |
06-Jan-2005 |
scottl |
Make this compile from the last commit
|
139749 |
06-Jan-2005 |
imp |
Start each of the license/copyright comments with /*-, minor shuffle of lines
|
139103 |
21-Dec-2004 |
ru |
Start the dreaded NOFOO -> NO_FOO conversion.
OK'ed by: core
|
137871 |
18-Nov-2004 |
gibbs |
Add some useful target mode diagnostics for incoming commands under the AHC_SHOW_TQIN debug flag.
|
137870 |
18-Nov-2004 |
gibbs |
Revert to basing all timeout/timer values in ms rather than us. The switch to us was to help out the Linux port, but really just invited overflow. In fact, the request sense timer was overflowing prior to this change making it much shorter than intended.
aic_osm_lib.h: Be more careful about overflow in all timer/timeout primitives.
|
136910 |
24-Oct-2004 |
ru |
For variables that are only checked with defined(), don't provide any fake value.
|
136711 |
19-Oct-2004 |
gibbs |
aic7xxx.h: Add constants for SPI protocol delays that are needed for target mode.
aic7xxx.c: Correct a target mode issue that caused an occassional spurious REQ to be seen on the bus when performing manual message processing (e.g. transfer rate negotiation).
Enforce phase change bus settle rules with explicit delays when performing manual message processing in target mode. The sequencer already did this for "fast-path", target mode message processing.
|
136569 |
15-Oct-2004 |
gibbs |
Skip probe attempts for ISA PnP devices.
Pointed out by: imp
|
134531 |
30-Aug-2004 |
gibbs |
Correct a typo in a comment: alloated->allocated
Reported by: Jens Schweikhardt <schweikh@schweikhardt.net>
|
134157 |
22-Aug-2004 |
gibbs |
In the PCI error interrupt handler, specify the width of the PCI configuration cycle using the correct argument. The location and width were reversed.
MFC in: 2 days
|
134156 |
22-Aug-2004 |
gibbs |
Set AHD_BUSFREEREV_BUG in the bug field for Rev B chips, not the feature field.
Reported by: Ken Westerback <krw@openbsd.org> MFC in: 2 days
|
133982 |
18-Aug-2004 |
gibbs |
Initialize iobase from the resource allocated by bus_alloc_resource_any() rather than with isa_get_port(). This value is only used in diagnostics, but the value we want to print is the value in our resource, not in any hint.
|
133966 |
18-Aug-2004 |
gibbs |
Invert the polarity of two tests in the recovery code that could cause the driver to issue a bus reset more quickly than intended. We want to *wait* if we find another SCB that could be the cause of this timeout, not proceed to a bus reset.
Noticed by: kan
|
133965 |
18-Aug-2004 |
gibbs |
Remove spurious EISA definitions left over from the initial port of the aic7xxx driver to U320 hardware.
|
133964 |
18-Aug-2004 |
gibbs |
Remove ISA attachments dependence on eisaconf.h
Noticed by: Takahashi Yoshihiro <nyan@jp.FreeBSD.org>
|
133912 |
17-Aug-2004 |
gibbs |
Add ISA attachement files for the aic7xxx driver.
Approved by: re Reminded by: obrien
|
133911 |
17-Aug-2004 |
gibbs |
Add an ISA attachement to the aic7xxx driver to handle 284X controllers. The ISA probe uses an identify routine to probe all slot locations from 1 to 14 that do not conflict with other allocated resources. This required making aic7770.c part of the driver core when compiled as a module.
aic7xxx.c: aic79xx.c: aic_osm_lib.c: Use aic_scb_timer_start() consistently to start the watchdog timer. This removes a few places that verbatum copied the code in aic_scb_timer_start().
During recovery processing, allow commands to still be queued to the controller. The only requirement we have is that our recovery command be queued first - something the code already guaranteed. The only other change required to make this work is to prevent timers from being started for these newly queued commands.
Approved by: re
|
133670 |
13-Aug-2004 |
gibbs |
Extend critical section protection around portions of selection processing that cannot tolerate changes to the waiting for selection queue by the host or the host canceling an active selection.
|
133669 |
13-Aug-2004 |
gibbs |
Fix an off by one in the critical section clearing code. The code was adjusting twice for the instruction pointer indicating the *next* instruction to execute. The aic79xx driver had a similar bug, but was fixed some time ago.
|
133122 |
04-Aug-2004 |
gibbs |
Correct a very rare case where command ordering could be compromised by a transaction performing a driver handled message sequence (an scb with the MK_MESSAGE flag set).
SCBs that perform host managed messaging must always be at the head of their per-target selection queue so that the firmware knows to manually assert ATN if the current negotiation agreement is packetized. In the past we guaranteed this by queuing these SCBs separarately in the execution queue. This exposes the system to potential command reordering in two cases:
1) Another SCB for the same ITL nexus is queued that does not have the MK_MESSAGE flag set. This SCB will be queued to the per-target list which can be serviced before the MK_MESSAGE scb that preceeded it.
2) If the target cannot accept all of the commands in the per-target selection queue in one selection, the remainder is queued to the tail of the selection queues so as to effect round-robin scheduling. This could allow the MK_MESSAGE scb to be sent to the target before the requeued commands.
This commit changes the firmware policy to defer queuing MK_MESSAGE SCBs into the selection queues until this can be done without affecting order. This means that the target's selection queue is either empty, or the last SCB on the execution queue is also a MK_MESSAGE SCB. During any wait, the firmware halts the download of new SCBs so only a single "holding location" is required.
Luckily, MK_MESSAGE SCBs are rare and typically occur only during CAM's bus probe where only one command is outstanding at a time. However, during some recovery scenarios, the reordering *could* occur.
aic79xx.c: Update ahd_search_qinfifo() and helper routines to search for pending MK_MESSAGE scbs and properly restitch the execution queue if either the MK_MESSAGE SCB is being aborted, or the MK_MESSAGE SCB can be queued due to the execution queue draining due to aborts.
Enable LQOBUSFREE status to assert an interrupt. This should be redundant since a BUSFREE interrupt should always occur along with an LQOBUSFREE event, but on the Rev A, this doesn't seem to be guaranteed.
When a PPR request is rejected when a previously existing packetized agreement is in place, assume that the target has been reset without our knowledge and revert to async/narrow transfers. This corrects two issues: the stale ENATNO setting that was used to send the PPR is cleared so the firmware is not confused by a future packetized selection with ATN asserted but no MK_MESSAGE flag in the SCB and it speeds up recovery by aborting any pending packetized transactions that by definition are now dead.
When re-queueing SCBs after a failed negotiation attempt, ensure command ordering by freezing the device queue first.
Traverse the list of pending SCBs rather than the whole SCB array on the controller when pushing MK_MESSAGE flag changes out to the controller. The original code was optimized for the aic7xxx controllers where there are fewer controller slots then pending SCBs and the firmware picks SCB slots. For the U320 controller, the hope is that we have fewer pending SCBs then the 512 slots on the controller.
Enhance some diagnostics.
Factor out some common code.
aic79xx.h: Add prototype for new ahd_done_with_status() that is used to factor out some commone code.
aic79xx.reg: Add definisions for the pending MK_MESSAGE SCB.
aic79xx.seq: Defer MK_MESSAGE SCB queing to the execution queue so as to preserve command ordering. Re-arrange some of the selection processing code so the above change had no performance impact on the common code path.
Close a few critical section holes.
When entering a non-packetized phase, manually enable busfree interrupts, since the controller hardware does not do this automatically.
aic79xx_inline.h: Enhance logging for queued SCBs.
aic79xx_osm.c: Add new a new DDB ahd command, ahd_dump, which invokes the ahd_dump_card_state() routine on the unit specified with the ahd_sunit DDB command.
aic79xx_pci.c: Turn on the BUSFREEREV bug for the Rev B. controller. This is required to close the busfree during non-packetized phase hole.
|
132199 |
15-Jul-2004 |
phk |
Do a pass over all modules in the kernel and make them return EOPNOTSUPP for unknown events.
A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything".
|
132107 |
13-Jul-2004 |
stefanf |
Remove erroneous semicolons.
|
129879 |
30-May-2004 |
phk |
Add missing <sys/module.h> includes
|
129134 |
11-May-2004 |
gibbs |
aic79xx.c: Allow 500us between pauses in ahd_pause_and_flushwork(). The maximum we will wait is now 500ms.
In the same routine, remove any attempt to clear ENSELO. Let the firmware do it once the current selection has completed. This avoids some race conditions having to do with non-packetized completions and the auto-clearing of ENSELO on packetized completions.
Also avoid attempts to clear critical sections when interrups are pending. We are going to loop again anyway, so clearing critical sections is a waste of time. It also may not be possible to clear a critical section if the source of the interrupt was a SEQINT.
aic79xx_pci.c: Use the Generic 9005 mask when looking for generic 7901B parts. This allows the driver to attach to 7901B parts on motherboards using a non-Adaptec subvendor ID.
aic79xx_inline.h: Test for the SCBRAM_RD_BUG against the bugs field, not the flags field in the softc.
aic79xx.c: Cancel pending transactions on devices that respond with a selection timeout. This decreases the duration of timeout recovery when a device disappears.
aic79xx.c: Don't bother forcing renegotiation on a selection timeout now that we use the device reset handler to abort any pending commands on the target. The device reset handler already takes us down to async narrow and forces a renegotiation.
In the device reset handlers, only send a BDR sent async event if the status is not CAM_SEL_TIMEOUT. This avoids sending this event in the selection timeout case
aic79xx.c: Modify the Core timeout handler to verify that another command has the potential to timeout before passing off a command timeout as due to some other command. This safety measure is added in response to a timeout recovery failure on H2B where it appears that incoming reselection status was lost during a drive pull test. In that case, the recovery handler continued to wait for the command that was active on the bus indefinetly. While the root cause of the above issue is still being determined seems a prudent safeguard.
aic79xx_pci.c: Add a specific probe entry for the Dell OEM 39320(B).
aic79xx.c: aic79xx.h: aic79xx.reg: aic79xx.seq: Modify the aic79xx firmware to never cross a cacheline or ADB boundary when DMA'ing completion entries to the host. In PCI mode, at least in 32/33 configurations, the SCB DMA engine may lose its place in the data-stream should the target force a retry on something other than an 8byte aligned boundary. In PCI-X mode, we do this to avoid split transactions since many chipsets seem to be unable to format proper split completions to continue the data transfer.
The above change allows us to drop our completion entries from 8 bytes to 4. We were using 8 byte entries to ensure that PCI retries could only occur on an 8byte aligned boundary. Now that the sequencer guarantees this by splitting up completions, we can safely drop the size to 4 bytes (2 byte tag, one byte SG_RESID, one byte pad).
Both the split-completion and PCI retry problems only show up under high tag load when interrupt coalescing is being especially effective. The switch from a 2byte completion entry to an 8 byte entry to solve the PCI problem increased the chance of incurring a split in PCI-X mode when multiple transactions were completed at once. Dropping the completion size to 4 bytes also means that we can complete more commands in a single DMA (128byte FIFO -> 32 commands instead of 16).
aic79xx.c: Modify the SCSIINT handler to defer clearing sequencer critical sections to the individual interrupt handlers. This allows us to immediately disable any outgoing selections in the case of an unexpected busfree so we don't inadvertantly clear ENSELO *after* a new selection has started. Doing so may cause the sequencer to miss a successful selection.
In ahd_update_pending_scbs(), only clear ENSELO if the bus is currently busy and a selection is not already in progress or the sequencer has yet to handle a pending selection. While we want to ensure that the selection for the SCB at the head of the selection queue is restarted so that any change in negotiation request can take effect, we can't clobber pending selection state without confusing the sequencer into missing a selection.
|
129133 |
11-May-2004 |
gibbs |
o When restarting the sequencer, clear any pending sequencer interrupt codes. These codes are only relevant to the code that was last being executed and that context is cleared when we reset the program counter. This addresses a race condition between a sequencer interrupt and any SCSI event that causes us to restart the sequencer.
o When running the untagged-Q, we must start the timer for any transaction we queue.
o Give the firmware half a millisecond between pauses to flush work out. This should give us around half a second of total delay before flagging an issue with pausing and flushing controller work.
Only attempt to clear critical sections if there are no pending interrupts in the pause and flush loop. If the sequencer has issued an INTSTAT, we may not be able to step out of the critical section.
o Cancel pending transactions on devices that respond with a selection timeout. This decreases the duration of timeout recovery when a device disappears.
Don't bother forcing renegotiation on a selection timeout now that we use the device reset handler to abort any pending commands on the target. The device reset handler already takes us down to async narrow and forces a renegotiation.
o In the device reset handlers, only send a BDR sent async event if the status is not CAM_SEL_TIMEOUT. This avoids sending this event in the selection timeout case.
o Modify the Core timeout handler to verify that another command has the potential to timeout before passing off a command timeout as due to some other command.
|
129132 |
11-May-2004 |
gibbs |
Add aic_scb_timer_start() which will be used in the aic7xxx driver to start the timer on SCBs queued in the untagged SCB queue.
The core treats timeouts in usecs to satisfy Linux requirements. Multiply accordingly.
|
127135 |
17-Mar-2004 |
njl |
Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
|
126891 |
12-Mar-2004 |
trhodes |
These are changes to allow to use the Intel C/C++ compiler (lang/icc) to build the kernel. It doesn't affect the operation if gcc.
Most of the changes are just adding __INTEL_COMPILER to #ifdef's, as icc v8 may define __GNUC__ some parts may look strange but are necessary.
Additional changes: - in_cksum.[ch]: * use a generic C version instead of the assembly version in the !gcc case (ASM code breaks with the optimizations icc does) -> no bad checksums with an icc compiled kernel Help from: andre, grehan, das Stolen from: alpha version via ppc version The entire checksum code should IMHO be replaced with the DragonFly version (because it isn't guaranteed future revisions of gcc will include similar optimizations) as in: ---snip--- Revision Changes Path 1.12 +1 -0 src/sys/conf/files.i386 1.4 +142 -558 src/sys/i386/i386/in_cksum.c 1.5 +33 -69 src/sys/i386/include/in_cksum.h 1.5 +2 -0 src/sys/netinet/igmp.c 1.6 +0 -1 src/sys/netinet/in.h 1.6 +2 -0 src/sys/netinet/ip_icmp.c
1.4 +3 -4 src/contrib/ipfilter/ip_compat.h 1.3 +1 -2 src/sbin/natd/icmp.c 1.4 +0 -1 src/sbin/natd/natd.c 1.48 +1 -0 src/sys/conf/files 1.2 +0 -1 src/sys/conf/files.amd64 1.13 +0 -1 src/sys/conf/files.i386 1.5 +0 -1 src/sys/conf/files.pc98 1.7 +1 -1 src/sys/contrib/ipfilter/netinet/fil.c 1.10 +2 -3 src/sys/contrib/ipfilter/netinet/ip_compat.h 1.10 +1 -1 src/sys/contrib/ipfilter/netinet/ip_fil.c 1.7 +1 -1 src/sys/dev/netif/txp/if_txp.c 1.7 +1 -1 src/sys/net/ip_mroute/ip_mroute.c 1.7 +1 -2 src/sys/net/ipfw/ip_fw2.c 1.6 +1 -2 src/sys/netinet/igmp.c 1.4 +158 -116 src/sys/netinet/in_cksum.c 1.6 +1 -1 src/sys/netinet/ip_gre.c 1.7 +1 -2 src/sys/netinet/ip_icmp.c 1.10 +1 -1 src/sys/netinet/ip_input.c 1.10 +1 -2 src/sys/netinet/ip_output.c 1.13 +1 -2 src/sys/netinet/tcp_input.c 1.9 +1 -2 src/sys/netinet/tcp_output.c 1.10 +1 -1 src/sys/netinet/tcp_subr.c 1.10 +1 -1 src/sys/netinet/tcp_syncache.c 1.9 +1 -2 src/sys/netinet/udp_usrreq.c
1.5 +1 -2 src/sys/netinet6/ipsec.c 1.5 +1 -2 src/sys/netproto/ipsec/ipsec.c 1.5 +1 -1 src/sys/netproto/ipsec/ipsec_input.c 1.4 +1 -2 src/sys/netproto/ipsec/ipsec_output.c
and finally remove sys/i386/i386 in_cksum.c sys/i386/include in_cksum.h ---snip--- - endian.h: * DTRT in C++ mode - quad.h: * we don't use gcc v1 anymore, remove support for it Suggested by: bde (long ago) - assym.h: * avoid zero-length arrays (remove dependency on a gcc specific feature) This change changes the contents of the object file, but as it's only used to generate some values for a header, and the generator knows how to handle this, there's no impact in the gcc case. Explained by: bde Submitted by: Marius Strobl <marius@alchemy.franken.de> - aicasm.c: * minor change to teach it about the way icc spells "-nostdinc" Not approved by: gibbs (no reply to my mail) - bump __FreeBSD_version (lang/icc needs to know about the changes)
Incarnations of this patch survive gcc compiles since a loooong time, I use it on my desktop. An icc compiled kernel works since Nov. 2003 (exceptions: snd_* if used as modules), it survives a build of the entire ports collection with icc.
Parts of this commit contains suggestions or submissions from Marius Strobl <marius@alchemy.franken.de>.
Reviewed by: -arch Submitted by: netchild
|
126890 |
12-Mar-2004 |
trhodes |
This are the build infrastructure changes to allow to use the Intel C/C++ compiler (lang/icc) to build the kernel.
The icc CPUTYPE CFLAGS use icc v7 syntax, icc v8 moans about them, but doesn't abort. They also produce CPU specific code (new instructions of the CPU, not only CPU specific scheduling), so if you get coredumps with signal 4 (SIGILL, illegal instruction) you've used the wrong CPUTYPE.
Incarnations of this patch survive gcc compiles and my make universe. I use it on my desktop.
To use it update share/mk, add /usr/local/intel/compiler70/ia32/bin (icc v7, works) or /usr/local/intel_cc_80/bin (icc v8, doesn't work) to your PATH, make sure you have a new kernel compile directory (e.g. MYKERNEL_icc) and run CFLAGS="-O2 -ip" CC=icc make depend CFLAGS="-O2 -ip" CC=icc make in it.
Don't compile with -ipo, the build infrastructure uses ld directly to link the kernel and the modules, but -ipo needs the link step to be performed with Intel's linker.
Problems with icc v8: - panic: npx0 cannot be emulated on an SMP system - UP: first start of /bin/sh results in a FP exception
Parts of this commit contains suggestions or submissions from Marius Strobl <marius@alchemy.franken.de>.
Reviewed by: silence on -arch Submitted by: netchild
|
125503 |
05-Feb-2004 |
ru |
Fixed style of DPADD and LDADD assignments as per style.Makefile(5).
|
125449 |
04-Feb-2004 |
gibbs |
aic7xxx.c: Shorten a diagnostic printf to fit in 80 columns.
In ahc_abort_scbs() remove an incorrect diagnostic test that printed a spurious warning.
|
125448 |
04-Feb-2004 |
gibbs |
aic79xx.c: aic79xx.seq: Convert the COMPLETE_DMA_SCB list to an "stailq". This allows us to safely keep the SCB that is currently being DMA'ed back the host on the head of the list while processing completions off of the bus. The newly completed SCBs are appended to the tail of the queue. In the past, we just dequeued the SCB that was in flight from the list, but this could result in a lost completion should the host perform certain types of error recovery that must cancel all in-flight SCB DMA operations.
Switch from using a 16bit completion entry, holding just the tag and the completion valid bit, to a 64bit completion entry that also contains a "status packet valid" indicator. This solves two problems: o The SCB DMA engine on at least Rev B. silicon does not properly deal with a PCI disconnect that occurs at a non-64bit aligned offset in the chips "source buffer". When the transfer is resumed, the DMA engine continues at the correct offset, but may wrap to the head of the buffer causing duplicate completions to be reported to the host. By using a completion buffer in host memory that is 64bit aligned and using 64bit completion entries, such disconnects should only occur at aligned addresses. This assumes that the host bridge will only disconnect on cache-line boundaries and that cache-lines are multpiles of 64bits.
o By embedding the status information in the completion entry we can avoid an extra memory reference to the HSCB for commands that complete without error.
Use the comparison of a "host freeze count" and a "sequencer freeze count" to allow the host to process most SCBs that complete with non-zero status without having to clear critical sections. Instead the host can just pause the sequencer, performs any necessary cleanup in the waiting for selection list, increments its freeze count on the controller, and unpauses. This is only possible because the sequencer defers completions of SCBs with bad status until after all pending selections have completed. The sequencer then avoids referencing any data structures the host may touch during completion of the SCB until the freeze counts match.
aic79xx.c: Change the strategy for allocating our sentinal HSCB for the QINFIFO. In the past, this allocation was tacked onto the QOUTFIFO allocation. Now that the qoutfifo has grown to accomodate larger completion entries, the old approach will result in a 64byte allocation that costs an extra page of coherent memory. We now do this extra allocation via ahd_alloc_scbs() where the "unused space" can be used to allocate "normal" HSCBs.
In our packetized busfree handler, use the ENSELO bit to differentiate between packetized and non-packetized unexpected busfree events that occur just after selection, but before the sequencer has had the oportunity to service the selection.
When cleaning out the waiting for selection list, use the SCSI mode instead of the command channel mode. The SCB pointer in the command channel mode may be referenced by the SCB dma engine even while the sequencer is paused, whereas the SCSI mode SCB pointer is only accessed by the sequencer.
Print the "complete on qfreeze" sequencer SCB completion list in ahd_dump_card_state(). This list holds all SCB completions that are deferred until a pending select-out qfreeze event has taken effect.
aic79xx.h: Add definitions and structures to handle the new SCB completion scheme.
Add a controller flag that indicates if the controller is in HostRAID mode.
aic79xx.reg: Remove macros used for toggling from one data fifo mode to the other. They have not been in use for some time.
Add scratch ram fields for our new qfreeze count scheme, converting the complete dma list into an "stailq", and providing for the "complete on qfreeze" SCB completion list. Some other fields were moved to retain proper field alignment (alignment >= field size in bytes).
aic79xx.seq: Add code to our idle loop to: o Process deferred completions once a qfreeze event has taken full effect. o Thaw the queue once the sequencer and host qfreeze counts match.
Generate 64bit completion entries passing the SCB_SGPTR field as the "good status" indicator. The first bit in this field is only set if we have a valid status packet to send to the host.
Convert the COMPLETE_DMA_SCB list to an "stailq".
When using "setjmp" to register an idle loop handler, do not combine the "ret" with the block move to pop the stack address in the same instruction. At least on the A, this results in a return to the setjmp caller, not to the new address at the top of the stack. Since we want the latter (we want the newly registered handler to only be invoked from the idle loop), we must use a separate ret instruction.
Add a few missing critical sections.
Close a race condition that can occur on Rev A. silicon. If both FIFOs happen to be allocated before the sequencer has a chance to service the FIFO that was allocated first, we must take special care to service the FIFO that is not active on the SCSI bus first. This guarantees that a FIFO will be freed to handle any snapshot requests for the FIFO that is still on the bus. Chosing the incorrect FIFO will result in deadlock.
Update comments.
aic79xx_inline.h Correct the offset calculation for the syncing of our qoutfifo.
Update ahd_check_cmdcmpltqueues() for the larger completion entries.
aic79xx_pci.c: Attach to HostRAID controllers by default. In the future I may add a sysctl to modify the behavior, but since FreeBSD does not have any HostRAID drivers, failing to attach just results in more email and bug reports for the author.
MFC After: 1week
|
123679 |
19-Dec-2003 |
gibbs |
Move all of the recovery thread routines next to each other.
Correct the recovery thread's loop so that it will terminate properly on shutdown. We also clear the recovery_thread proc pointer so that any additional calls to aic_terminate_recovery_thread() will not attempt to kill a thread that doesn't exist. Lastly, code the loop so that termination will still be successfull even if the termination request occurs just prior to us entering the loop or while the recovery thread is off recovering commands.
|
123675 |
19-Dec-2003 |
gibbs |
We only need to terminate our recovery thread once.
|
123655 |
19-Dec-2003 |
gibbs |
In ahd_run_qoutfifos, correct a !=/== logic bug that would cause an infinite loop any time we manually flush the good status FIFO. Also make our loop delay unconditional to ensure we don't miss any FIFO allocations by the hardware.
|
123579 |
17-Dec-2003 |
gibbs |
ahc_eisa.c: ahc_pci.c: ahd_pci.c: aic7xxx.c: aic79xx.c: aic_osm_lib.c: aic_osm_lib.h: Use common OSM routines from aic_osm_lib for bus dma operations, delay routines, accessing CCBs, byte swapping, etc.
aic7xxx_pci.c: Provide a better description for the 2915/30LP on attach.
aic7xxx.c: aic79xx.c: aic7770.c: aic79xx_pci.c: aic7xxx_pci.c: aic7xxx_93cx6.c: Move FBSDID behind an ifdef so that these core files will still compile under other OSes.
aic79xx.h: aic79xx_pci.c: aic79xx.seq: To speed up non-packetized CDB delivery in Rev B, all CDB acks are "released" to the output sync as soon as the command phase starts. There is only one problem with this approach. If the target changes phase before all data are sent, we have left over acks that can go out on the bus in a data phase. Due to other chip contraints, this only happens if the target goes to data-in, but if the acks go out before we can test SDONE, we'll think that the transfer has completed successfully. Work around this by taking advantage of the 400ns or 800ns dead time between command phase and the REQ of the new phase. If the transfer has completed successfully, SCSIEN should fall *long* before we see a phase change. We thus treat any phasemiss that occurs before SCSIEN falls as an incomplete transfer.
aic79xx.h: Add the AHD_FAST_CDB_DELIVERY feature.
aic79xx_pci.c: Set AHD_FAST_CDB_DELIVERY for all Rev. B parts.
aic79xx.seq: Test for PHASEMIS in the command phase for all AHD_FAST_CDB_DELIVERY controlelrs.
ahd_pci.c: ahc_pci.c: aic7xxx.h: aic79xx.h: Move definition of controller BAR offsets to core header files.
aic7xxx.c: aic79xx.c: In the softc free routine, leave removal of a softc from the global list of softcs to the OSM (the caller of this routine). This allows us to avoid holding the softc list_lock during device destruction where we may have to sleep waiting for our recovery thread to halt.
ahc_pci.c: Use ahc_pci_test_register access to validate I/O mapped in addition to the tests already performed for memory mapped access.
Remove unused ahc_power_state_change() function. The PCI layer in both 4.X and 5.X now offer this functionality.
ahd_pci.c: Remove reduntant definition of controller BAR offsets. These are also defined in aic79xx.h.
Remove unused ahd_power_state_change() function. The PCI layer in both 4.X and 5.X now offer this functionality.
aic7xxx.c: aic79xx.c: aic79xx.h: aic7xxx.h: aic7xxx_osm.c: aic79xx_osm.c: Move timeout handling to the driver cores. In the case of the aic79xx driver, the algorithm has been enhanced to try target resets before performing a bus reset. For the aic7xxx driver, the algorithm is unchanged. Although the drivers do not currently sleep during recovery (recovery is timeout driven), the cores do expect all processing to be performed via a recovery thread. Our timeout handlers are now little stubs that wakeup the recovery thread.
aic79xx.c: aic79xx.h: aic79xx_inline.h: Change shared_data allocation to use a map_node so that the sentinel hscb can use this map node in ahd_swap_with_next_hscb. This routine now swaps the hscb_map pointer in additon to the hscb contents so that any sync operations occur on the correct map.
physaddr -> busaddr
Pointed out by: Jason Thorpe <thorpej@wasabisystems.com>
aic79xx.c: Make more use of the in/out/w/l/q macros for accessing byte registers in the chip.
Correct some issues in the ahd_flush_qoutfifo() routine. o Run the qoutfifo only once the command channel DMA engine has been halted. This closes a window where we might have missed some entries. o Change ahd_run_data_fifo() to not loop to completion. If we happen to start on the wrong FIFO and the other FIFO has a snapshot savepointers, we might deadlock. This required our delay between FIFO tests to be moved to the ahd_flush_qoutfifo() routine. o Update/add comments. o Remove spurious test for COMPLETE_DMA list being empty when completing transactions from the GSFIFO with residuals. The SCB must be put on the COMPLETE_DMA scb list unconditionally. o When halting command channel DMA activity, we must disable the DMA channel in all cases but an update of the QOUTFIFO. The latter case is required so that the sequencer will update its position in the QOUTFIFO. Previously, we left the channel enabled for all "push" DMAs. This left us vulnerable to the sequencer handling an SCB push long after that SCB was already processed manually by this routine. o Correct the polarity of tests involving ahd_scb_active_in_fifo(). This routine returns non-zero for true.
Return to processing bad status completions through the qoutfifo. This reduces the time that the sequencer is kept paused when handling transactions with bad status or underruns.
When waiting for the controller to quiece selections, add a delay to our loop. Otherwise we may fail to wait long enough for the sequencer to comply.
On H2A4 hardware, use the slow slewrate for non-paced transfers. This mirrors what the Adaptec Windows drivers do.
On the Rev B. only slow down the CRC timing for older U160 devices that might need the slower timing. We define "older" as devices that do not support packetized protocol.
Wait up to 5000 * 5us for the SEEPROM to become unbusy. Write ops seem to take much longer than read ops.
aic79xx.seq: For controllers with the FAINT_LED bug, turn the diagnostic led feature on during selection and reselection. This covers the non-packetized case. The LED will be disabled for non-packetized transfers once we return to the top level idle loop. Add more comments about the busy LED workaround.
Extend a critical section around the entire command channel idle loop process. Previously the portion of this handler that directly manipulated the linked list of completed SCBs was not protected. This is the likely cause of the recent reports of commands being completed twice by the driver.
Extend critical sections across the test for, and the longjump to, longjump routines. This prevents the firmware from trying to jump to a longjmp handler that was just cleared by the host.
Improve the locations of several critical section begin and end points. Typically these changes remove instructions that did not need to be inside a critical section.
Close the "busfree after selection, but before busfree interrupts can be enabled" race to just a single sequencer instruction. We now test the BSY line explicitly before clearing the busfree status and enabling the busfree interrupt.
Close a race condition in the processing of HS_MAILBOX updates. We now clear the "updated" status before the copy. This ensures that we don't accidentally clear the status incorrectly when the host sneaks in an update just after our last copy, but before we clear the status. This race has never been observed.
Don't re-enable SCSIEN if we lose the race to disable SCSIEN in our interrupt handler's workaround for the RevA data-valid too early issue.
aic79xx_inline.h: Add comments indicating that the order in which bytes are read or written in ahd_inw and ahd_outw is important. This allows us to use these inlines when accessing registers with side-effects.
aic79xx_pci.c: The 29320 and the 29320B are 7902 not 7901 based products. Correct the driver banner.
aic7xxx.h: Enable the use of the auto-access pause feature on the aic7870 and aic7880. It was disabled due to an oversight.
aic7xxx.reg: Move TARG_IMMEDIATE_SCB to alias LAST_MSG to avoid leaving garbage in MWI_RESIDUAL. This prevents spurious overflows whn operating target mode on controllers that require the MWI_RESIDUAL work-around.
aic7xxx.seq: AHC_TMODE_WIDEODD_BUG is a bug, not a softc flag. Reference the correct softc field when testing for its presence.
Set the NOT_IDENTIFIED and NO_CDB_SENT bits in SEQ_FLAGS to indicate that the nexus is invalid in await busfree.
aic7xxx_93cx6.c: Add support for the C56/C66 versions of the EWEN and EWDS commands.
aic7xxx.c: aic7xxx_pci.c: Move test for the validity of left over BIOS data to ahc_test_register_access(). This guarantees that any left over CHIPRST value is not clobbered by our register access test and lost to the test that was in ahc_reset.
|
123578 |
17-Dec-2003 |
gibbs |
When outputing a code listing, properly display macros that expand to multiple instructions.
|
123577 |
16-Dec-2003 |
gibbs |
Modify assembler to ignore carriage returns in input. This should make those using the assembler under cygwin happy.
|
123019 |
28-Nov-2003 |
imp |
Sometimes cardbus attachments don't attach, so while we track down this problem put these lines back in. While they should be unnecessary, they appear to be sometimes necessary.
Reviewed in concept: dfr Approved by: re (scottl@)
|
121939 |
03-Nov-2003 |
dfr |
Remove explicit cardbus attachments from drivers where this is identical to the pci attachment. Cardbus is a derived class of pci so all pci drivers are automatically available for matching against cardbus devices.
Reviewed by: imp
|
121421 |
23-Oct-2003 |
des |
0x7FFFFFFFFF is >32 bits and needs an explicit LL.
|
120445 |
25-Sep-2003 |
scottl |
aic79xx_pci.c: aic7xxx_pci.c: When performing our register test, be careful to avoid resetting the chip when pausing the controller. The test reads the HCNTRL register and then writes it back with the PAUSE bit explicitly set. If the last write to the controller before our probe is to reset it, the CHIPRST bit will still be set, so we must mask it off before the PAUSE operation. On some chip versions, we cannot access registers for a few 100us after a reset, so this inadvertant reset was causing PCI errors to occur on the read to check for paused status.
Submitted by: gibbs
|
119690 |
02-Sep-2003 |
jhb |
Use PCIR_BAR(x) instead of PCIR_MAPS.
Glanced over by: imp, gibbs Tested by: i386 LINT
|
119418 |
24-Aug-2003 |
obrien |
Use __FBSDID(). Also some minor style cleanups.
|
119277 |
22-Aug-2003 |
imp |
Prefer new location of pci include files (which have only been in the tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD.
|
117126 |
01-Jul-2003 |
scottl |
Mega busdma API commit.
Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg. Lockfunc allows a driver to provide a function for managing its locking semantics while using busdma. At the moment, this is used for the asynchronous busdma_swi and callback mechanism. Two lockfunc implementations are provided: busdma_lock_mutex() performs standard mutex operations on the mutex that is specified from lockfuncarg. dftl_lock() is a panic implementation and is defaulted to when NULL, NULL are passed to bus_dma_tag_create(). The only time that NULL, NULL should ever be used is when the driver ensures that bus_dmamap_load() will not be deferred. Drivers that do not provide their own locking can pass busdma_lock_mutex,&Giant args in order to preserve the former behaviour.
sparc64 and powerpc do not provide real busdma_swi functions, so this is largely a noop on those platforms. The busdma_swi on is64 is not properly locked yet, so warnings will be emitted on this platform when busdma callback deferrals happen.
If anyone gets panics or warnings from dflt_lock() being called, please let me know right away.
Reviewed by: tmm, gibbs
|
116940 |
28-Jun-2003 |
gibbs |
Fix a race condition in the flushing of commands that have completed across the bus but not to the host before processing of an exception condition (busfree, bus reset, etc.). When flushing the controller of completed commands, we also look for packetized commands that have completed with good status and are stored in the "good status fifo". The hardware will post to the good status fifo even if data for that command is still active in a FIFO. In one particular failure case, a command outstanding on the bus reconnected, transferred data into a FIFO, and provided good status while the host driver was processing an expected busfree event (PPR message negotiation). This resulted in an entry in the good status fifo that we completed, but since the sequencer was paused, the data in the data FIFO for this command had never been transferred to the host. Once the busfree processing was complete, the sequencer was unpaused, and the data completed its transfer to the host. In some instances, the client for the data was notified of the completion and attempted to view the data before it arrived. This case only occurred during FreeBSD's multi-target probe of the SCSI bus while some devices are negotiating to go packetized and some devices are already running in packetized.
The fix is to run and FIFOs active with a context in the good status fifo to completion before completing the command to the SCSI layer. This requies duplicating the FIFO rundown operations in the host driver that would usually be handled by the firmware, but there is no other alternative.
Don't blindly shutdown the SCB dma engine when restarting the sequencer. We may be killing an operation that is not supposed to be cancelled. The cases where we need to shutdown these dma engines are already handled elsewhere in the driver.
Fix a few more ahd_in?() -> ahd_in?_scbram() instances.
|
116938 |
28-Jun-2003 |
gibbs |
aic79xx.h: Add softc flag to indicate that we have seen at least one selection since the last bus reset or SE/LVD bus change.
aic79xx.c: Fix a few style nits.
In ahd_update_pending_scbs(), only touch card registers once we have found an SCB that needs to be updated. This removes lots of clutter from PCI traces taken of error recovery performed by the driver.
Short circuit the first selection iocell workaround handler if we've run once since the last bus reset or iocell change. This also removes clutter from PCI traces.
Note if completions are pending in the qoutfifo when we dump card state.
|
116937 |
28-Jun-2003 |
gibbs |
Use clr instead of an explicit mov from ALLZEROS to clear SCB_FIFO_USE_COUNT. This is just a syntactic change.
|
116936 |
28-Jun-2003 |
gibbs |
Implement ahd_inq_scbram() and change the implemention of ahd_inl_scbram to use ahd_inw_scbram instead of ahd_inb_scbram().
|
116935 |
28-Jun-2003 |
gibbs |
Correct a typo in a comment.
Add a comment in ahd_clear_critical_sections() about our need to leave ENBUSFREE set in SIMODE1 while single stepping.
Re-arrange some delay loops so that we always perform a read after any register write and before the delay. This should make the delay loop more accurate.
When completing message processing for a packetized commention, return the controller to a state where invalid non-packetized phases will still cause protocol violations. These are the same operations as those performed in the clear_target_state routine in the firmware.
Now that we have a chip with working ABORTPENDING support (the 7901B), comment out the automatic use of this feature until we can adequately test it. The previous checkin updated the bug mask for the 7901B so this code was exercised.
When resetting the bus, perform an ahd_flush_device_writes() call so that our reset assertion delay is acurately timed from when the reset bit is written to the controller.
|
116934 |
28-Jun-2003 |
gibbs |
aic79xx.seq: Remove an old comment that no longer applies.
Fix a jump in our unexpected non-packetized phase handler to use an explicit lable. The old code had a hardcoded jump offset that was off by one instruction.
|
116933 |
28-Jun-2003 |
gibbs |
aic79xx.h: Add a 7901A specific feature definition.
aic79xx_pci.c: Split out the general aic790X setup into it's own setup handler that works on single and dual controllers. Adjust all other PCI setup handlers to initialize the chips basic features and type before calling the generic handler.
Turn off a few Rev B workarounds that are not required on the 7901B.
|
116767 |
23-Jun-2003 |
gibbs |
Add parenthesis so that we get all of the bits all of the contents of the CCSCBCTL register into our local varaible. The other bits are used in later tests. This avoids a potential deadlock in ahd_run_qoutfifo() if we happen to catch the DMA engine in just the right state.
|
116351 |
14-Jun-2003 |
njl |
Merge common XPT_CALC_GEOMETRY functions into a single convenience function. Devices below may experience a change in geometry.
* Due to a bug, aic(4) never used extended geometry. Changes all drives >1G to now use extended translation. * sbp(4) drives exactly 1 GB in size now no longer use extended geometry. * umass(4) drives exactly 1 GB in size now no longer use extended geometry.
For all other controllers in this commit, this should be a no-op.
Looked over by: scottl
|
116142 |
10-Jun-2003 |
gibbs |
Sync perforce IDs.
|
115920 |
06-Jun-2003 |
gibbs |
When single stepping, only leave ENBUSFREE enabled if it was already enabled. We don't want to set it when it shouldn't be set, we just don't want to inadvertantly turn it off. This should fix a recent report of the aic7xxx driver repeatedly complaining of "unexpected busfree while idle" in one configuration.
|
115919 |
06-Jun-2003 |
gibbs |
Clear stale PCI errors during our test for successfully mapping our registers. This avoids the disabling of memory mapped I/O just because some other driver probe happened to touch our registers.
|
115918 |
06-Jun-2003 |
gibbs |
Work around SCSI spec violation by the Quantum Atlas 10K. This drive delays going async after receiving a WDTR message. We now send an SDTR message after a WDTR even if our goal is to go async. This should work even for confused devices.
If we get an unexpected busfree when attempting a WDTR or SDTR, only set the goal negotiation parameters we were trying to negotiate to off. This means that should a WDTR message fail, we will still try an SDTR if our goal is non-async.
Fix a few more places where we were looking at goal.period instead of goal.offset for determining if we should be negotiating sync. This should not have any impact on our behavior, but the offset is more definitive and should be used.
|
115917 |
06-Jun-2003 |
gibbs |
aic7770.c: aic79xx.c: aic79xx.h: aic79xx_pci.c: aic7xxx.c: aic7xxx.h: aic7xxx_pci.c: Switch ah?_reset() to take an additional "reinit" argument. Use this instead of init_level to determin if the chip should be fully reinitialized after a chip reset. This is required so that ah?_shutdown() can reset the chip without side-effects.
aic79xx.c: Implement ahd_suspend() and ahd_resume().
aic7xxx.c: Change ahc_loadseq() to *not* restart the sequencer. This brings the loadseq behavior in line with that of the 7902 driver and also simplifies the init routine.
Correct the resume routine to enable interrupts and restart the sequencer.
|
115915 |
06-Jun-2003 |
gibbs |
Add probe entry for the 284X with BIOS disabled.
|
115914 |
06-Jun-2003 |
gibbs |
Constify a string used in our EISA probe tables.
Fix a few style nits.
|
115408 |
30-May-2003 |
scottl |
aic79xx.c: Use the special LUNLEN_SINGLE_LEVEL constant for post Rev A4 hardware for single byte luns. Without this change, Rev B hardware would place the single byte of lun data in byte 0 of the lun structure when it should be in byte 1. Since there are few if any devices on the market that support multiple luns in target mode, the corrupted lun field (which was only corrupted for non-zero luns) wasn't hurting us.
Approved by: re (rwatson)
|
115407 |
30-May-2003 |
scottl |
Fix a reported case of severe data corruption:
aic79xx.h: aic79xx.reg: Return the SCB_TAG field to 16byte alignment. It seems that on some PCI systems, SCBs are not transferred correctly to the controller with the previous placement of the SCB_TAG field.
Approved by: re (rwatson)
|
115343 |
27-May-2003 |
scottl |
Bring back bus_dmasync_op_t. It is now a typedef to an int, though the BUS_DMASYNC_ definitions remain as before. The does not change the ABI, and reverts the API to be a bit more compatible and flexible. This has survived a full 'make universe'.
Approved by: re (bmah)
|
115338 |
26-May-2003 |
gibbs |
This driver supports the 2920C not the 2920. Make this clear in our card identification string.
PR: kern/50428 Approved by: RE
|
115337 |
26-May-2003 |
gibbs |
Consistently use #ifdef for testing AHC_TARGET_MODE.
Approved by: RE
|
115336 |
26-May-2003 |
gibbs |
aic79xx.c: aic79xx_osm.h: aic7xxx_osm.h: Explicitly define functions that take no arguments with "(void)"
Approved by: RE
|
115335 |
26-May-2003 |
gibbs |
Correct/Simplify ignore wide residue message handling
aic79xx.c: In ahd_handle_ign_wide_residue(): o Use SCB_XFERLEN_ODD SCB field to determine transfer "oddness" rather than the DATA_COUNT_ODD logic. SCB_XFERLEN_ODD is toggled on every ignore wide residue message so that multiple ignore wide residue messages for the same transaction are properly supported. o If the sg list has been exausted, the sequencer doesn't bother to update the residual data count since it is known to be zero. Perform the zeroing manually before calculating the remaining data count. o Use multibyte in/out macros instead of shifting/masking by hand.
aic79xx_inline.h: In ahd_setup_scb_common(), setup the SCB_XFERLEN_ODD field.
aic79xx.reg: Use the SCB_TASK_ATTRIBUTE field as a bit field in the non-packetized case. We currently only define one bit, SCB_XFERLEN_ODD.
Remove the ODD_SEG bit field that was used to carry the odd transfer length information through the SG cache. This is obviated by SCB_XFERLEN_ODD field.
Remove the DATA_COUNT_ODD scratch ram byte that was used dynamicaly compute data transfer oddness. This is obviated by SCB_XFERLEN_ODD field.
aic79xx.seq: Remove all updates to the DATA_COUNT_ODD scratch ram field. Remove all uses of ODD_SEG. These two save quite a few sequencer instructions.
Use SCB_XFERLEN_ODD to validate the end of transfer ignore wide residue message case.
|
115334 |
26-May-2003 |
gibbs |
FIFOEMP can lag LAST_SEG_DONE in the Ultra2 and U160 hardware. Wait a few extra clocks for FIFOEMP to assert before calling an overrun.
Approved by: RE
|
115333 |
26-May-2003 |
gibbs |
Correct/Simplify ignore wide residue message handling
aic7xxx.c: In ahc_handle_ign_wide_residue(): o Use SCB_XFERLEN_ODD SCB field to determine transfer "oddness" rather than the DATA_COUNT_ODD logic. SCB_XFERLEN_ODD is toggled on every ignore wide residue message so that multiple ignore wide residue messages for the same transaction are properly supported. o If the sg list has been exausted, the sequencer doesn't bother to update the residual data count since it is known to be zero. Perform the zeroing manually before calculating the remaining data count. o Ensure that SG_LIST_NULL is cleared in the residual sg pointer for "mid-transfer" ignore wide residue cases. o Use multibyte in/out macros instead of shifting/masking by hand.
aic7xxx.h: Modify the SCB_GET_LUN() macro to mask the lun hardware SCB field with LID. This leaves two bits in the LUN field that can be used for other purposes.
aic7xxx.reg: Change LID to be 0x3F. This is the maximum supported lun size for non-packetized SCSI. Map the top bit of the lun to SCB_XFERLEN_ODD. The host must set this bit whenever a transfer is an odd length.
Remove the ODD_SEG bit field that was used to carry the odd transfer length information through the SG cache. This is obviated by SCB_XFERLEN_ODD field.
Remove the DATA_COUNT_ODD scratch ram byte that was used dynamicaly compute data transfer oddness. This is obviated by SCB_XFERLEN_ODD field.
aic7xxx.seq: Be more careful in our handling of the SCB_LUN field. It must be masked with LID if only lun information is desired.
Remove all updates to the DATA_COUNT_ODD scratch ram field. Remove all uses of ODD_SEG. These two save quite a few sequencer instructions.
Use SCB_XFERLEN_ODD to validate the end of transfer ignore wide residue message case.
aic7xxx_inline.h: In ahc_queue_scb(), setup the SCB_XFERLEN_ODD field.
Approved by: RE
|
115332 |
26-May-2003 |
gibbs |
Fix disabling of PCI parity error interrupts. We need to set FAILDIS in the SEQCTL register, not the HCNTRL register.
aic7xxx.c: Remeber SEQCTL settings in the "seqctl" field of our softc. seqctl defaults to just having FASTMODE set, but the bus attachments can override this.
aic7xxx.h: Add the seqctl softc field.
aic7xxx_pci.c: Update the seqctl softc field and manually update SEQCTL when to many PCI errors occur
Approved by: RE
|
115331 |
26-May-2003 |
gibbs |
Change hadling of the Rev. A packetized lun output bug to be more efficient by having the sequencer copy the single byte of valid lun data into the long lun field.
aic79xx.c: Memset our hardware SCB to 0 so that untouched fields don't confuse diagnostic output. With the old method for handling the Rev A bug, if the long lun field was not 0, this could result in bogus lun information being sent to drives.
Use the same SCB transfer size for all chip types now that the long lun is not DMA'ed to the chip.
aic79xx.seq: Add code to copy lun information for Rev.A hardware.
aic79xx_inline.h: Remove host update of the long_lun field on every packetized command.
|
115330 |
26-May-2003 |
gibbs |
Add 7901B support.
Sort IDs based on chip type.
Remove IROC IDs. We'll switch to using the IROC masks if/when we want to start attaching to IROC controllers.
Approved by: RE
|
115329 |
26-May-2003 |
gibbs |
Fixup spelling of "coalesce" and derivatives.
Approved by: RE
|
115328 |
26-May-2003 |
gibbs |
Remove stray K&R style function definition.
Approved by: RE
|
114623 |
04-May-2003 |
gibbs |
Correct spelling errors.
Switch to handling bad SCSI status as a sequencer interrupt instead of having the kernel proccess these failures via the completion queue. This is done because:
o The old scheme required us to pause the sequencer and clear critical sections for each SCB. It seems that these pause actions, if coincident with a sequencer FIFO interrupt, would result in a FIFO interrupt getting lost or directing to the wrong FIFO. This caused hangs when the driver was stressed under high "queue full" loads. o The completion code assumed that it was always called with the sequencer running. This may not be the case in timeout processing where completions occur manually via ahd_pause_and_flushwork(). o With this scheme, the extra expense of clearing critical sections is avoided since the sequencer will only self pause once all pending selections have cleared and it is not in a critical section.
aic79xx.c Add code to handle the new BAD_SCB_STATUS sequencer interrupt code. This just redirects the SCB through the already existing ahd_complete_scb() code path. Remove code in ahd_handle_scsi_status() that paused the sequencer, made sure that no selections where pending, and cleared critical sections. Bad status SCBs are now only processed when all of these conditions are true.
aic79xx.reg: Add the BAD_SCB_STATUS sequencer interrupt code.
aic79xx.seq: When completing an SCB upload to the host, if we are doing this because the SCB contains non-zero SCSI status, defer completing the SCB until there are no pending selection events. When completing these SCBs, use the new BAD_SCB_STATUS sequencer interrupt. For all other uploaded SCBs (currently only for underruns), the SCB is completed via the normal done queue. Additionally, keep the SCB that is currently being uploaded on the COMPLETE_DMA_SCB list until the dma is completed, not just until the DMA is started. This ensures that the DMA is restarted properly should the host disable the DMA transfer for some reason.
In our RevA workaround for Maxtor drives, guard against the host pausing us while trying to pause I/O until the first data-valid REQ by clearing the current snapshot so that we can tell if the transfer has completed prior to us noticing the REQINIT status.
In cfg4data_intr, shave off an instruction before getting the data path running by adding an entrypoint to the overrun handler to also increment the FIFO use count.
In the overrun handler, be sure to clear our LONGJMP address in both exit paths.
Perform a few sequencer optimizations.
aic79xx.c: Print the full path from the SCB when a packetized status overrun occurs.
Remove references to LONGJMP_SCB which is being removed from firmware usage.
Print the new SCB_FIFO_USE_COUNT field in the per-SCB section of ahd_dump_card_state(). The SCB_TAG field is now re-used by the sequencer, so it no longer makes sense to reference this field in the kernel driver.
aic79xx.h: Re-arrange fields in the hardware SCB from largest size type to smallest. This makes it easier to move fields without changing field alignment.
The hardware scb tag field is now down near the "spare" portion of the SCB to facilitate reuse by the sequencer.
aic79xx.reg: Remove LONGJMP_ADDR.
Rearrange SCB fields to match aic79xx.h. Add SCB_FIFO_USE_COUNT as the first byte of the SCB_TAG field.
aic79xx.seq: Add a per-SCB "Fifos in use count" field and use it to determine when it is safe (all data posted) to deliver status back to the host. The old method involved polling one or both FIFOs to verify that the current task did not have pending data. This makes running down the GSFIFO very cheap, so we will empty the GSFIFO in one idle loop pass in all cases.
Use this simplification of the completion process to prune down the data FIFO teardown sequencer for packetized transfers. Much more code is now shared between the data residual and transfer complete cases.
Correct some issues in the packetized status handler. It used to be possible to CLRCHN our FIFO before status had fully transferred to the host. We also failed to handle NONPACKREQ phases that could occur should a CRC error occur during transmission of the status data packet.
Correct a few big endian issues:
aic79xx.c: aic79xx_inline.h: aic79xx_pci.c: aic79xx_osm.c: o Always get the SCB's tag via the SCB_GET_TAG acccessor o Add missing use of byte swapping macros when touching hscb fields. o Don't double swap SEEPROM data when it is printed. Correct a big-endian bug. We cannot assign a o When assigning a 32bit LE variable to a 64bit LE variable, we must be explict about how the words of the 64bit LE variable are initialized. Cast to (uint32_t*) to do this.
aic79xx.c: In ahd_clear_critical_section(), hit CRLSCSIINT after restoring the interrupt masks to avoid what appears to be a glitch on SCSIINT. Any real SCSIINT status will be persistent and will immidiately reset SCSIINT. This clear should only get rid of spurious SCSIINTs.
This glitch was the cause of the "Unexpected PKT busfree" status that occurred under high queue full loads
Call ahd_fini_scbdata() after shutdown so that any ahd_chip_init() routine that might access SCB data will not access free'd memory.
Reset the bus on an IOERR since the chip doesn't seem to reset to the new voltage level without this.
Change offset calculation for scatter gather maps so that the calculation is correct if an integral multiple of sg lists does not fit in the allocation size.
Adjust bus dma tag for data buffers based on 39BIT addressing flag in our softc.
Use the QFREEZE count to simplify ahd_pause_and_flushworkd(). We can thus rely on the sequencer eventually clearing ENSELO.
In ahd_abort_scbs(), fix a bug that could potentially corrupt sequencer state. The saved SCB was being restored in the SCSI mode instead of the saved mode. It turns out that the SCB did not need to be saved at all as the scbptr is already restored by all subroutines called during this function that modify that register.
aic79xx.c: aic79xx.h: aic79xx_pci.c: Add support for parsing the seeprom vital product data. The VPD data are currently unused.
aic79xx.h: aic79xx.seq: aic79xx_pci.c: Add a firmware workaround to make the LED blink brighter during packetized operations on the H2A.
aic79xx_inline.h: The host does not use timer interrupts, so don't gate our decision on whether or not to unpause the sequencer on whether or not a timer interrupt is pending.
|
114621 |
03-May-2003 |
gibbs |
aic7xxx.c: aic7xxx.h: Split out core chip initialization into ahc_chip_init(). This will allow us to reset the chip correctly at times other than initial chip setup.
aic7770.c aic7xxx_pci.c: Flesh out bus chip init methods for our two bus attachments and use these, in addition to bus suspend/resume hooks to get the core in better shape for handling these events.
When disabling PCI parity error checking, use FAILDIS. Although the chip docs indicate that clearing PERRESPEN should also work, it does not.
Auto-disable pci parity error checking after informing the user of AHC_PCI_TARGET_PERR_THRESH number of parity errors observed as a target.
aic7xxx.h: aic7xxx_pci.c aic7770.c aic7xxx.c Add the instruction_ram_size softc field.
Remove the now unused stack_size softc field.
Modify ahc_loadseq to return a failure code and to actually check the downloaded instruction count against the limit set in our softc.
Modify callers of ahc_loadseq to handle load failures as appropriate.
Set instruction RAM sizes for each chip type.
aic7xxx_pci.c: Add some delay in the aic785X termination control code. This may fix problems with the 2930.
Be consistent in how we access config space registers. 16bit registers are accessed using 16bit ops.
aic7xxx.c: Correct spelling errors.
Have ahc_force_renegotiation() take a devinfo as is done in the U320 driver. Use this argument to correct a bug in the selection timeout handler where we forced a renegotiation with the last device that had set SAVED_SCSIID. SAVED_SCSIID is only updated once a selection is *sucessfull* and so is stale for any selection timeout.
Cleanup the setup of the devinfo for busfree events. We now use this devinfo for a call to ahc_force_renegotiation() at the bottom of the routine, so it must be initialized in all cases.
In ahc_pause_and_flushwork(), adjust the loop so that it will exit in the hot-eject case even if the INT_PEND mask is something other than 0xFF (as it is in this driver).
Correct a wrapping string constant.
Call ahc_fini_scbdata() after shutdown so that any ahc_chip_init() routine that might access SCB data will not access free'd memory.
Correctly setup our buffer tag to indicate that 39bit addressing is available if in 39bit addressing mode.
Rearrange some variable declarations based on type size.
aic7xxx.c aic7xxx.h: aic7xxx.reg: Consistently use MAX_OFFSET for the user max syncrate set from non-volatile storage. This ensures that the offset does not conflict with AHC_OFFSET_UNKNOWN.
Change AHC_OFFSET_UNKNOWN to 0xFF. This is a value that the curr->offset can never be, unlike '0' which we previously used. This fixes code that only checks for a non-zero offset to determine if a sync negotiation is required since it will fire in the unknown case even if the goal is async.
Change MAX_OFFSET to 0x7f which is the max offset U160 aic7xxx controllers can negotiate. This ensures that curr->offset will not match AHC_OFFSET_UNKNOWN.
aic7xxx_inline.h: Have our inline interrupt handler return with a value indicating whether we serviced a real interrupt. This is required for Linux support.
Return earlier if the interrupt is not for us.
|
114618 |
03-May-2003 |
gibbs |
hc_eisa.c: ahc_pci.c: ahd_pci.c: Don't bogusly use the BUS_DMA_ALLOCNOW flag in our psuedo parent bus dma tag.
|
113350 |
10-Apr-2003 |
mux |
I deserve a big pointy hat for having missed all those references to bus_dmasync_op_t in my last commit.
|
113296 |
09-Apr-2003 |
jake |
Compile with PAE.
|
112842 |
30-Mar-2003 |
jake |
- Temporary fix so this compiles with 64 bit bus_addr_t.
Sponsored by: DARPA, Network Associates Laboratories Approved by: scottl
|
112641 |
25-Mar-2003 |
scottl |
aic79xx.reg: Correct default precompensation value for RevA hardware.
|
111954 |
06-Mar-2003 |
gibbs |
aic79xx.c: Include read streaming in the PPR flags we display in diagnostics.
In ahd_reset(), set the known mode after our initial pause prior to setting the mode. We can't just set the mode directly because the current mode, after the pause, is most likely unknown and setting the mode when the saved mode is unknown will trigger an assertion in the mode debug code.
Complete an audit for SCB RAM reads. These reads must be performed via the special ahd_in?_scbram() methods so we can perform a Rev A. PCI-X workaround.
Remove a superfluous mode save operation that was performed just prior to a call to ahd_clear_critical_section(). The saved mode was never restored and wouldn't have been valid anyway since the mode could change while single stepping out of a critical section.
aic79xx.h: Add new BUG definition AHD_PCIX_SCBRAM_RD_BUG.
aic79xx_inline.h: Update ahd_inb_scbram routine to check for AHD_PCIX_SCBRAM_RD_BUG and only apply the workaround if this bug is active. The old code applied the workaround in all cases.
aic79xx_pci.c: Set AHD_PCIX_SCBRAM_RD_BUG for the A4.
Remove an attempted saved_modes call in ahd_pci_test_register_access(). Saving the modes can only occur when we are paused, but the call was happening before the chip was known to be paused. Restoring the modes doesn't make sense either since the code makes no assumptions about the state of the sequencer until the first time the mode is set by the driver. This happens after the registers are successfully mapped.
|
111653 |
27-Feb-2003 |
gibbs |
aic79xx.c: Clear the LQICRC_NLQ status should it pop up after we have already handled the SCSIPERR. During some streaming operations this status can be delayed until the stream ends. Without this change, the driver would complain about a "Missing case in ahd_handle_scsiint".
In the LQOBUSFREE handler...
Don't return the LQOMGR back to the idle state until after we have cleaned up ENSELO and any status related to this selection. The last thing we need is the LQO manager starting another select-out before we have updated the execution queue. It is not clear whether the LQOMGR would, or would not start a new selection early.
Make sure ENSELO is off prior to clearing SELDO by flushing device writes.
Move assignment of the next target SCB pointer inside of an if to make the code clearer. The effect is the same.
Dump card state in both "Unexpected PKT busfree" paths.
In ahd_reset(), set the chip to SCSI mode before reading SXFRCTL1. That register only exists in the SCSI mode. Also set the mode explicitly to the SCSI mode after chip reset due to paranoia. Re-arrange code so that SXFRCTL1 is restored as quickly after the chip reset as possible.
S/G structurs must be 8byte aligned. Make this official by saying so in our DMA tag.
Disable CIO bus stretch on MDFFSTAT if SHVALID is about to come true. This can cause a CIO bus lockup if a PCI or PCI-X error occurs while the stretch is occurring - the host cannot service the PCI-X error since the CIO bus is locked out and SHVALID will never resolve. The stretch was added in the Rev B to simplify the wait for SHVALID to resolve, but the code to do this in the open source sequencer is so simple it was never removed.
Consistently use MAX_OFFSET for the user max syncrate set from non-volatile storage. This ensures that the offset does not conflict with AH?_OFFSET_UNKNOWN.
Have ahd_pause_and_flushwork set the mode to ensure that it has access to the registers it checks. Also modify the checking of intstat so that the check against 0xFF can actually succeed if the INT_PEND mask is something other than 0xFF. Although there are no cardbus U320 controllers, this check may be needed to recover from a hot-plug PCI removal that occurs without informing the driver.
Fix a typo. sg_prefetch_cnt -> sg_prefetch_align. This fixes an infinite loop at card initialization if the cacheline size is 0.
aic79xx.h: Add AHD_EARLY_REQ_BUG bug flag.
Fix spelling errors.
Include the CDB's length just after the CDB pointer in the DMA'ed CDB case.
Change AH?_OFFSET_UNKNOWN to 0xFF. This is a value that the curr->offset can never be, unlike '0' which we previously used. This fixes code that only checks for a non-zero offset to determine if a sync negotiation is required since it will fire in the unknown case even if the goal is async.
aic79xx.reg: Add comments for LQISTAT bits indicating their names in the 7902 data book. We use slightly different and more descriptive names in the firmware.
Fix spelling errors.
Include the CDB's length just after the CDB pointer in the DMA'ed CDB case.
aic79xx.seq: Update comments regarding rundown of the GSFIFO to reflect reality.
Fix spelling errors.
Since we use an 8byte address and 1 byte length, shorten the size of a block move for the legacy DMA'ed CDB case from 11 to 9 bytes.
Remove code that, assuming the abort pending feature worked, would set MK_MESSAGE in the SCB's control byte on completion to catch invalid reselections. Since we don't see interrupts for completed selections, this status update could occur prior to us noticing the SELDO. The "select-out" queue logic will get confused by the MK_MESSAGE bit being set as this is used to catch packatized connections where we select-out with ATN. Since the abort pending feature doesn't work on any released controllers yet, this code was never executed.
Add support for the AHD_EARLY_REQ_BUG. Don't ignore persistent REQ assertions just because they were asserted within the bus settle delay window. This allows us to tolerate devices like the GEM318 that violate the SCSI spec.
Remove unintentional settnig of SG_CACHE_AVAIL. Writing this bit should have no effect, but who knows...
On the Rev A, we must wait for HDMAENACK before loading additional segments to avoid clobbering the address of the first segment in the S/G FIFO. This resolves data-corruption issues with certain IBM (now Hitachi) and Fujitsu U320 drives.
Rearrange calc_residual to avoid an extra jmp instruction.
On RevA Silicon, if the target returns us to data-out after we have already trained for data-out, it is possible for us to transition the free running clock to data-valid before the required 100ns P1 setup time (8 P1 assertions in fast-160 mode). This will only happen if this L-Q is a continuation of a data transfer for which we have already prefetched data into our FIFO (LQ/Data followed by LQ/Data for the same write transaction). This can cause some target implementations to miss the first few data transfers on the bus. We detect this situation by noticing that this is the first data transfer after an LQ (LQIWORKONLQ true), that the data transfer is a continuation of a transfer already setup in our FIFO (SAVEPTRS interrupt), and that the transaction is a write (DIRECTION set in DFCNTRL). The delay is performed by disabling SCSIEN until we see the first REQ from the target.
Only compile in snapshot savepointers handler for RevA silicon where it is enabled.
Handle the cfg4icmd packetized interrupt. We just need to load the address and count, start the DMA, and CLRCHN once the transfer is complete.
Fix an oversight in the overrun handler for packetized status operations. We need to wait for either CTXTDONE or an overrun when checking for an overrun. The previous code did not wait and thus could decide that no overrun had occurred even though an overrun will occur on the next data-valid req. Add some comment to this section for clarity.
Use LAST_SEG_DONE instead of LASTSDONE for testing transfer completion in the packetized status case. LASTSDONE may come up more quickly since it only records completion on the SCSI side, but since LAST_SEG_DONE is used everywhere else (and needs to be), this is less confusing.
Add a missing invalidation of the longjmp address in the non-pack handler. This code needs additional review.
aic79xx_inline.h: Fix spelling error.
aic79xx_osm.c: Set the cdb length for CDBs dma'ed from host memory.
Add a comment indicating that, should CAM start supporting cdbs larger than 16bytes, the driver could store the CDB in the status buffer.
aic79xx_pci.c: Add a table entry for the 39320A.
Added a missing comma to an error string table.
Fix spelling errors.
|
109709 |
22-Jan-2003 |
gibbs |
Revert AHD_TIMER_MAX_US to its original definition now that the ahc and ahd modules have correct dependencies on the assembler.
|
109628 |
21-Jan-2003 |
phk |
Bandaid to make the kernel compile until the scsi-crew can find out what is happening.
|
109603 |
20-Jan-2003 |
gibbs |
Fix a missed goal.period -> goal.offset change. In this case, the bug resulted in comparing a period against an offset.
|
109590 |
20-Jan-2003 |
gibbs |
aic7xxx.reg: Add a constant for the controller's stack size and the maximum scsi offset.
aic7xxx.seq: Style nit. The source is implied to be the destination unless overridden in an "and" instruction.
Update target mode code for changes in identify seen sequencer flags.
aic7xxx_pci.c: Ensure that the PCIERRGENDIS bit is set in the PCIERRGEN config space register. Perhaps this is a reason for the spurios parity errors reported on U160 controllers.
Honor the AHC_NO_BIOS_INIT flag.
Allow PCI interrupt reporting to be disabled, by clearing the PERRRESEN bit in the command register. This option is now enabled via a new softc flag: AHC_DISABLE_PCI_PERR.
Disable SERR and pause the controller prior to performing our mmapped I/O test. This should handle the case of controllers that do not "auto-access pause". For legacy controllers, use SCB ram instead of scratch ram since the latter may contain settings left over from the BIOS that we will use if an seeprom is not found.
Make use of new ahc_inl/outl() inlines.
aic7xxx.h: Reformat a few comments to follow driver style.
Add a controller flags that indicate that a controller has not been initialized by the BIOS and whether to disable PCI parity errors..
Remove stack probing softc members.
Add a few more syncrate constants that are useful in speed fallback calculations.
Add the SHOW_MASKED_ERRORS debug flag.
aic7xxx.h: aic7xxx.c: Implement the SCB_SILENT flag. This is useful for hushing up the driver during DV or other operations that we expect to cause transmission errors. The messages will still print if the SHOW_MASKED_ERRORS debug option is enabled.
aic7xxx_inline.h: Implement ahc_[in|out][w|l|q]. This removes the need for manual 'or and shift" type operations throughout the driver.
aic7xxx.c: Move SELTO dignostic so that the SCB is still valid when we use it for printing path information.
If we are narrow, limit syncrate to Ultra2.
Don't clobber ppr_options when forcing a renegotiation. The current ppr_options may be referenced while queuing new commands. Don't set our width to unknown when forcing negotiation on narrow controllers. This will confuse the negotiation code into negotiating with a wide message on narrow controllers.
Add an "asserting atn" diagnostic with controller/target information.
Remove the probe_stack code. The stack is always 4 deep on legacy controllers, so probing is pointless. This also avoids an issue where probing the stack would upset the aic7770.
In ahc_reset(), record whether or not we found the controller in a reset state. If the controller was already reset, assume that no BIOS has initialized the controller and ignore left over scratch ram settings.
Fix an ifdef bug that caused sequencer debugging to be enabled always.
Clear the ultraenb flag in our tstate during startup. The ultraenbled'ness of a device is recorded in the user transfer settings. tstate->ultraenb bitmask indicates which devices we have negotiated an ultra speed with. Just after initialization, we are async. Setting the ultraenb flag while async seems to be harmless, but it was confusing to see the ULTRAENB flag set in the SCB.
Enhance residual diagnostic to indicate if the residual if for sense information or normal data transfers.
Indicate the features, bugs, and flags set in the softc that are used to control firmware patch download when booting verbose.
In ahc_dump_card_state() fix a logic reversal. The SCSIPHASE register only exists on U160 controllers. The SCSISIGI register exists on all controllers. Not the other way around. Also print out the ERROR register.
Allow ahc_dump_card_state() to be called when the sequencer is not paused. Add dump card state markers as in the U320 driver.
|
109588 |
20-Jan-2003 |
gibbs |
aic79xx.c: Implement the SCB_SILENT flag. This is useful for hushing up the driver during DV or other operations that we expect to cause transmission errors. The messages will still print if the SHOW_MASKED_ERRORS debug option is enabled.
Save and restore the NEGOADDR address when setting new transfer settings. The sequencer performs lookups in the negotiation table too and it expects NEGOADDR to remain consistent across pause/unpause sessions.
Consistently use "offset" instead of "period" to determine if we are running sync or not.
Add a SHOW_MESSAGES diagnostic for when we assert ATN during message processing.
Print out IU, QAS, and RTI features when showing transfer options.
Limit the syncrate after all option conformance changes have taken place in ahd_devlimited_syncrate. Changes in options may change the final syncrate we accept.
Keep a copy of the hs_mailbox in our softc so that we can perform read/modify/write operations on the hs_mailbox without having to pause the sequencer to read the last written value. Use the ENINT_COALESS flag in the hs_mailbox to toggle interrupt coalessing.
Add entrypoints for enabling interrupt coalessing and setting both a timeout (how long to wait for commands to be coalessed) and a maximum commands to coaless value. Add a statistics timer that decides when to enable or disable interrupt coalessing based on load.
Add a routine, ahd_reset_cmds_pending() which is used to update the CMDS_PENDING sequencer variable whenever error recovery compeltes SCBs without notifying the sequencer. Since ahd_reset_cmds_pending is called during ahd_unpause() only if we've aborted SCBs, its call to ahd_flush_qoutfifo should not cause recursion through ahd_run_qoutfifo(). A panic has been added to ensure that this recursion does not occur.
In ahd_search_qinfifo, update the CMDS_PENDING sequencer variable directly. ahd_search_qinififo can be called in situations where using ahd_reset_cmds_pending() might cause recursion. Since we can safely determine the exact number to reduce CMDS_PENDING by in this scenario without running the qoutfifo, the manual update is sufficient.
Clean up diagnostics. Add ahd_flush_qoutfifo() which will run the qoutfifo as well as complete any commands sitting on the sequencer's COMPLETE_SCB lists or the good status FIFO. Use this routine in several places that did similar things in an add-hoc, but incomplete, fashion. A call to this routine was also added to ahd_abort_scbs() to close a race.
In ahd_pause_and_flushwork() only return once selections are safely disabled. Flush all completed commands via ahd_flush_qoutfifo().
Remove "Now packetized" diagnostic now that this information is incorperated into the actual negotiation messages that are displayed.
When forcing renegotiation, don't clober the current ppr_options. Much of the driver uses this information to determine if we are currently packetized or not.
Remove some stray spaces at column 1 in ahd_set_tags.
When complaining about getting a host message loop request with no pending messages, print out the SCB_CONTROL register down on the card.
Modify the ahd_sent_msg() routine to handle a search for an outgoing identify message. Use this to detect a msg reject on an identify message which typically indicates that the target thought we were packetized. Force a renegotiation in this case.
In ahd_search_qinfifo(), wait more effectively for SCB DMA activities to cease. We also disable SCB fetch operations since we are about to change the qinfifo and any fetch in progress will likely be invalidated.
In ahd_qinfifo_count(), fix the qinfifo empty case.
In ahd_dump_card_state(), print out CCSCBCTL in the correct mode.
If we are a narrow controller, don't set the current width to unknown when forcing a future negotiation. This just confuses the code into attempting a wide negotiation on a narrow bus.
Add support for task management function completions.
Modify ahd_handle_devreset so that it can handle lun resets in addition to target resets. Use ahd_handle_devreset for lun and target reset task management functions.
Handle the abort task TMF race case better. We now wait until any current selections are over and then set the TMF back to zero. This should cause the sequencer to ignore the abort TMF completion should it occur.
Correct a bug in the illegal phase handler that caused us to drop down to narrow when handling the unexpected command phase case after 3rd party reset of a packetized device.
Indicate the features, bugs, and flags set in the softc that are used to control firmware patch download when booting verbose.
aic79xx.h: Add coalessing and HS_MAILBOX fields.
Add per-softc variables for the stats "daemon".
Add a debug option for interrupt coalessing activities.
Add two new softc flags: o AHD_UPDATE_PEND_CMDS Run ahd_reset_cmds_pending() on the next unpause.
o AHD_RUNNING_QOUTFIFO Used to catch recursion through ahd_run_qoutfifo().
aic79xx.reg: Correct register addresses related to the software timer and the DFDBCTL register.
Add constants paramaterizing the software timer.
Add scratch ram locations for storing interrupt coalessing tunables.
Break INTMASK in SEQITNCTL out into INTMASK1 and INTMASK2. In at least the REV A, these are writable bits. We make use of that for a swtimer workaround in the sequencer.
Since HS_MAILBOX autoclears, provide a sequencer variable to store its contents.
Add SEQINT codes for handling task management completions.
aic79xx.seq: Correct ignore wide residue processing check for a wide negotiation being in effect. We must be in the SCSI register window in order to access the negotiation table.
Use the software timer and a commands completed count to implement interrupt coalessing. The command complete is deferred until either the maximum command threshold or a the expiration of a command deferral timer. If we have more SCBs to complete to the host (sitting in COMPLETE_SCB lists), always try to coaless them up to our coalessing limit. If coalessing is enabled, but we have fewer commands oustanting than the host's min coalessing limit, complete the command immediately.
Add code to track the number of commands outstanding. Commands are outstanding from the time they are placed into the execution queue until the DMA to post completion is setup.
Add a workaround for intvec_2 interrupts on the H2A4. In H2A4, the mode pointer is not saved for intvec2, but is restored on iret. This can lead to the restoration of a bogus mode ptr. Manually clear the intmask bits and do a normal return to compensate. We use intvec_2 to track interrupt coalessing timeouts.
Since we cannot disable the swtimer's countdown, simply mask its interrupt once we no longer care about it firing.
In idle_loop_cchan, update LOCAL_HS_MAILBOX everytime we are notified of an HS_MAILBOX update via the HS_MAILBOX_ACT bit in QOFF_CTLSTA. We have to use a local copy of persistant portions of the HS_MAILBOX as the mailbox auto-clears on any read.
Move the test for the cfg4istat interrupt up an instruction to hopefully close a race between the next outgoing selection and our disabling of selections.
Add a missing ret to the last instruction in load_overrun_buf.
Add notifications to the host of task management completions as well as the completions for commands that completed successfully before their corresponding TMF could be sent.
Hold a critical section during select-out processing until we have a fully identified connection. This removes a race condition with the legacy abort handler.
Correct a few spelling errors in some comments.
aic79xx_inline.h: Call ahd_reset_cmds_pending() in ahd_unpause if required.
Update cmdcmplt interrupt statistics in our interrupt handler.
Allow callers to ahd_send_scb() to set the task management function.
aic79xx_pci.c: Disable SERR and pause the controller prior to performing our mmapped I/O test. The U320 controllers do not support "auto-access-pause".
aic79xx_osm.c: Set the task management function now that ahd_send_scb() doesn't do it for us. We also perform a lun reset in response to BDR requests to packetized devices.
|
109576 |
20-Jan-2003 |
gibbs |
Allow constants to be complex expressions so long as those expressions can be fully evaluated during assembly.
Remove the numerical_value portion of the grammer which is no longer referenced.
|
109575 |
20-Jan-2003 |
gibbs |
Fix the last reference to the reg_print.c file handle in symtable_dump. This allows the assembler to operate without generating this file.
|
108479 |
31-Dec-2002 |
scottl |
Convert the use of MAXBSIZE in the dma tag to more appropriate values. Use BUS_SPACE_MAXSIZE_32BIT for the parent dma tags, and (NSEGS - 1) * PAGE_SIZE for the data buffer tags. FreeBSD/sparc64 is more strict about checking these values that other arches.
|
107628 |
05-Dec-2002 |
scottl |
The sequencer downloading code assumes that all jump labels are acurate in relation to a fully compiled sequencer program (all patches downloaded). Correct a few occurances of a relative jump across a macro that ended up jumping us into the last instruction of the macro.
Spproved by: re (bmah)
|
107623 |
04-Dec-2002 |
scottl |
Last minute fixes to ahc and ahd:
ahd_pci.c: Retrieve the allow_memio hint from the resource manager to determine whether or not to try PCI MEMIO.
aic79xx_osm.h: aic7xxx_osm.h: Don't wrongly abuse the callout_reset() interface when trying to abuse timeouts generated from the CAM layer. This fixes the console freeze and lost timeout problem that many have reported, especially on SMP systems.
aic79xx_pci.c aic7xxx_pci.c Rewrite the MEMIO test routine to prevent certain broken chipsets from trying to burst multiple DWORDs to the registers. Also make the routine better detect byte merging by the host bridge and deal with it.
aic79xx.reg: Correct an incorrect register definition.
Approved by: re (rwatson, jhb)
|
107441 |
01-Dec-2002 |
scottl |
Major update to the ahd driver to fix many bugs found in the previous version, plus add support for the new features found in the Rev B version of the chip. The changelog is quite long and can be provided on request. Major features include vastly improved protocol violation handling, full support for the 7902 Rev B, better parity error handling, and better packetized overrun handling, to name a few.
Approved by: re (blanket)
|
107440 |
01-Dec-2002 |
scottl |
Implement workaround for broken busfree-rev in the A4.
HP -> CPQ
Rearrange IDs to better match which chips they use.
Convert to uniform product description strings.
Simplify 7901A setup function.
Add the NONPACKFIFO_BUG and PACED_NEGTABLE_BUG entries for the A.
Add rev B bugs and features.
The double write workaround for CURRSCB is only required if abort pending is set. Remove this work around and set the abort pending bug bit on the B at least until we have better confirmation that the double write is always safe.
Add updated H2B identifiers
Move IOCell paramters into softc and add a hook for the OSM to modify these as well as other settings prior to committing them to the chip.
SLEW -> SLEWRATE
PREQDIS in DEVCONFIG1 went away after the A2. Remove all code that references this bit. This is especially important since this bit was reused in the B for a different HW fix workaround.
Properly set the AHD_NEW_IOCELL_OPTS and AHD_NEW_DFCNTRL_OPTS features for the B.
Remove stray/random extra 7901A generic PCI table entry. Also switch the correct 7901A generic entry to use ID_ALL_MASK since we can only differentiate the 7901A from the 7902 by checking for a "type field" of 0xE.
Set AHD_INTCOLLISIONT_BUG for the Rev B.
Set the PREQDIS bit in DEVCONFIG1 for the B. The bit is misnamed, but seems to disable a work-around that breaks on the B on PCI busses.
Add a routine for testing memory mapped register access. This will hopefully detect things like buggy via chipsets so that the OSM can fallback to using I/O mapped access when memory mapped I/O simply will not work.
Approved by: re (blanket)
|
107439 |
01-Dec-2002 |
scottl |
Add our controller name to the front of our diagnostic "Setting Mode" messages.
Use a read of HCNTRL to flush our write to CLRCMDCMPLT on the RevB. This allows us to check to see if the sequencer is paused and to initiate the interrupt collision workaround without incuring an extra read.
Approved by: re (blanket)
|
107438 |
01-Dec-2002 |
scottl |
Remove redundant check for chip type being PCI-X. PCI-X only workarounds are automatically masked out if we are operating in PCI mode.
Make use of ahd_pci_test_register_access()
Approved by: re (blanket)
|
107437 |
01-Dec-2002 |
scottl |
Update to include new ahd_scb_timer_reset API
Move IOCell paramters into softc and add a hook for the OSM to modify these as well as other settings prior to committing them to the chip.
Approved by: re (blanket)
|
107422 |
30-Nov-2002 |
scottl |
Synchronize perforce Id tags
Approved by: re (blanket)
|
107420 |
30-Nov-2002 |
scottl |
Bring in many bugfixes and changes obtained from formal testing:
aic7xxx.c: aic7xxx.h: aic7xxx.reg: aic7xxx.seq: Bring in the protocol violation handler from the U320 driver and replace the NO_IDENT sequencer interrupt code with the PROTO_VIOLATION code. Support for this code required the following changes:
SEQ_FLAGS: IDENTIFY_SEEN -> NOT_IDENTIFIED Added NO_CDB_SENT
SCB_CONTROL: TARGET_SCB == STATUS_RCVD for initiator mode
scb->flags: Added SCB_TARGET_SCB since we cannot rely on TARGET_SCB as a target/initiator differentiator due to it being overloaded in initiator mode to indicate that status has been received.
aic7xxx.seq: Move data fifo CLRCHN to mesgin_rdptrs which is a safer location for doing this operation. This also saves a sequencer instruction.
aic7xxx.c: aic7xxx.h: Change ahc/ahd_upate_neg_request() to take a "negotiation type" enum that allows us to negotiate: o only if the goal and current parameters differ. o only if the goal is non-async o always - even if the negotiation will be for async. aic7xxx.seq: Reset the FIFO whenever a short CDB transfer occurs so that the FIFO contents do not corrupt a future CDB transfer retry.
Add support for catching the various protocol violations handled by ahc_handle_protocol_violation.
Reformat some comments.
aic7xxx.c: aic7xxx.h: Just for safety, have the aic7xxx driver probe the stack depth.
aic7xxx.c: aic7xxx.h: Save and restore stack contents during diagnostics. Some chip variants overwrite stale entries on a stack "pop".
Don't use 0 to probe the stack depth. 0 is the typical value used to backfill the stack if entries are overwritten on a "pop".
aic7xxx.h: Add a missing typedef.
Collapse SCB flag entries so they are bit contiguous.
Add AHD_ULTRA2_XFER_PERIOD for narrow fallback calculations
aic7xxx.c: Don't panic (as a diagnostic to catch bugs) if we decided to force the renegotiation of async even if we believe we are already async. This should allow us to negotiate async instead of the full user goal rate during startup if bus resets are disabled.
Add a space to the end of the ahc/ahd_print_devinfo routines so that it behaves as expected by the code that uses it.
Only force a renegotiation on a selection timeout if the SCB was valid. Doing otherwise may be dangerous as the connection was not valid for an unknown reason.
Add additional diagnostic output to ahc_dump_card_state(), and have it use the register pretty printing functions.
Update ahc_reg_print() to handle a NULL cur_col.
Add a newline to ahc_dump_card_state() output.
Bring back "use_ppr". We need to use_ppr anytime doppr is true or we have non-zero protocol options. The later case was not handled in the recent removal of use_ppr.
Move a comment and remove a useless clearing of use_ppr.
Don't disable ENBUSFREE when single stepping on a DT capable controller. We cannot re-enable unexpected busfree detection, so we must clear BUSFREE on each step instead.
Correct the lookup of the SCB ID in ahc_handle_proto_error.
Remove a diagnostic printf. Remove unecessary restoration of the STACK for older chips.
Approved by: re (blanket)
|
107419 |
30-Nov-2002 |
scottl |
Add a routine for testing memory mapped register access. This will hopefully detect things like buggy via chipsets so that the OSM can fallback to using I/O mapped access when memory mapped I/O simply will not work.
Approved by: re (blanket)
|
107418 |
30-Nov-2002 |
scottl |
Always compile in the AHC_ALLOW_MEMIO code, but only try MEMIO if AHC_ALLOW_MEMIO is set, or the hint hint.ahc.N.allow_memio=1 is set in the bootloader.
Make use of ah?_pci_test_register_access().
Approved by: re (blanket)
|
107417 |
30-Nov-2002 |
scottl |
Handle changes to SCB_CONTROL, scb->flags and SEQ_FLAGS
Approved by: re (blanket)
|
107416 |
30-Nov-2002 |
scottl |
Use the new ahc_scb_timer_reset API
Remove AHC_ALLOW_MEMIO
Approved by: re (blanket)
|
107411 |
30-Nov-2002 |
scottl |
Add support for the Olivetti branded EISA boards.
Approved by: re (blanket)
|
107368 |
28-Nov-2002 |
scottl |
Revisit the printf format fixes for alpha. intmax_t doesn't exist in RELENG_4, so cast to u_long in order to stay compatible.
Approved by: re (blanket)
|
107303 |
27-Nov-2002 |
scottl |
Minor updates to the aicasm:
aicasm_gram.y: Use a direct move from allzeros to emulate a mvi of 0.
aicasm_insformat.h: sync $Id$
aicasm_symbol.c: Minor header change.
Approved by: re (blanket)
|
107218 |
25-Nov-2002 |
scottl |
Fix printf format problems that were stopping LINT on alpha
Submitted by: jmallett, many others Approved by: re
|
106803 |
12-Nov-2002 |
scottl |
Use better return types and a couple of casts to eliminate warnings on alpha. This will take the file out of sync with the private version that we maintain, but alpha tinderbox has been broken for too long.
Tested on: i386, sparc64, alpha
|
105202 |
16-Oct-2002 |
gibbs |
Never allow memory mapped I/O in PCI-X mode on controllers that do not support that configuration. This should fix problems with embedded 7902 controllers running in PCI-X mode.
|
104231 |
30-Sep-2002 |
gibbs |
Remove a left over '&' from the conversion to using our softc referenced seeprom store.
MFC after: 1 day
|
104172 |
30-Sep-2002 |
obrien |
Use fcntl.h from inside /sys.
Reviewd by: scottl
|
104094 |
28-Sep-2002 |
phk |
Be consistent about "static" functions: if the function is marked static in its prototype, mark it static at the definition too.
Inspired by: FlexeLint warning #512
|
104071 |
27-Sep-2002 |
gibbs |
Add a missing pair of curly braces to a conditional debug statement. This ensures that debug code doesn't trigger if it isn't enabled. <blush>
|
104028 |
27-Sep-2002 |
gibbs |
Remove redundant inclusion of inttypes.h in aicasm_gram.y and properly sort inttypes.h into list of includes.
Noticed by: Mike Barcroft <mike@freebsd.org>
|
104023 |
26-Sep-2002 |
gibbs |
Upgrade to version 1.1 of the aic79xx U320 driver.
aic79xx.c: o Remove redundant ahd_update_modes() call. o Correct panic in diagnostic should state corruption cause the SCB Id to be invalid during a selection timeout. o Add workaround for missing BUSFREEREV feature in Rev A silicon. o Corect formatting nits. o Use register pretty printing in more places. o Save and restore our SCB pointer when updating the waiting queue list for an "expected" LQ-out busfree. o In ahd_clear_intstat, deal with the missing autoclear in the CLRLQO* registers. o BE fixup in a diagnostic printf. o Make sure that we are in the proper mode before disabling selections in ahd_update_pending_scbs. o Add more diagnostics. o task_attribute_nonpkt_tag -> task_attribute: we don't need a nonpkt_tag field anymore for allowing all 512 SCBs to be used in non-packetized connections. o Negotiate HOLD_MCS to U320 devices. o Add a few additional mode assertions. o Restore the chip mode after clearing out the qinfifo so that code using ahd_abort_scbs sees a consistent mode. o Simplify the DMA engine shutdown routine prior to performing a bus reset. o Perform the sequencer restart after a chip reset prior to setting up our timer to poll for the reset to be complete. On some OSes, the timer could actually pre-empt us and order is important here. o Have our "reset poller" set the expected mode since there is no guarantee of what mode will be in force when we are called from the OS timer. o Save and restore the SCB pointer in ahd_dump_card_state(). This routine must not modify card state. o Ditto for ahd_dump_scbs().
aic79xx.h: o Add a few more chip bug definitions. o Align our tag on a 32bit boundary.
aic79xx.reg: aic79xx.seq: o Start work on removing workarounds for Rev B. o Use a special location in scratch from for stroring our SCBPTR during legacy FIFO allocations. This corrects problems in mixed packetized/non-packetized configurations where calling into a FIFO task corrupted our SCBPTR. o Don't rely on DMA priority to guarantee that all data in our FIFOs will flush prior to a command completion notification going out of the command channel. We've never seen this assumption fail, but better safe than sorry. o Deal with missing BUSFREEREV feature in H2A. o Simplify disconnect list code now that the list will always have only a single entry. o Implement the AHD_REG_SLOW_SETTLE_BUG workaround. o Swith to using "REG_ISR" for local mode scratch during our ISR. o Add a missing jmp to the data_group_dma_loop after our data pointers have been re-initialized by the kernel. o Correct test in the bitbucket code so that we actually wait for the bitbucket to complete before signaling the kernel of the overrun condition. o Reposition pkt_saveptrs to avoid a jmp instruction. o Update a comment to reflect that the code now waits for a FIFO to drain prior to issuing a CLRCHN.
aic79xx_inline.h: o Remove unused untagged queue handling code. o Don't attempt to htole64 what could be a 32bit value.
aic79xx_pci.c: o Set additional bug flags for rev A chips.
|
104022 |
26-Sep-2002 |
gibbs |
Expand vendor ID.
|
104021 |
26-Sep-2002 |
gibbs |
Correct a spelling error.
|
104020 |
26-Sep-2002 |
gibbs |
Sync perforce IDs for changes first committed to FreeBSD and then to the Adaptec driver repository.
|
104019 |
26-Sep-2002 |
gibbs |
Use inttypes.h
Upgrade assembler to allow a move immediate of 0. This is helpful in certain macros where we can't know the value of the immediate in advance.
|
103811 |
22-Sep-2002 |
scottl |
The ahc driver should only have one devclass, not one for each bus attachment.
Submitted by: too many people to count MFC after: 3 days
|
102764 |
01-Sep-2002 |
scottl |
Use the correct bit value for a debug options
|
102687 |
31-Aug-2002 |
gibbs |
Sync perforce Ids.
|
102686 |
31-Aug-2002 |
gibbs |
Identify new controllers and the aic7901A.
Move interrupt enable to the OSM.
Remove some debugging messages.
Remove chip bug workarounds for non-production asics.
|
102685 |
31-Aug-2002 |
gibbs |
Hook up the endian macros.
Correct some comments.
|
102684 |
31-Aug-2002 |
gibbs |
Enable card interrupts in our OSM rather than in the core. This ensures that we don't enter our interrupt handler until all OSM components it might reference have been fully initialized during attach.
Remove vestiges of untagged queue handling.
Add hints to ahd_get_scb() so it knows what type of SCB collision management to perform for each new transaction.
Properly disable/enable IU_REQ with changes in tagged queuing and disconnection settings passed in by CAM.
|
102683 |
31-Aug-2002 |
gibbs |
Correct lun representation during packetized operation.
Uninline some routines that are just too big to be inlined.
Add some helper macros for SCB ID collision management.
Use a hardware SCB rather than a full SCB for the "next SCB to queue" sentinal.
Update for new "high SCBID bit" qoutfifo delivery scheme.
If interrupts are disabled on the card, don't bother running our interrupt handler. Our handler was called due to a shared interrupt, and the card's interrupts are explicitly disabled to prevent entry into our interrupt handler.
|
102682 |
31-Aug-2002 |
gibbs |
Add a prefix to be used for assembler generated tables and functions for register pretty-printing.
Implement "top bit of SCBID is valid bit" qoutfifo delivery scheme.
"the the" -> "the".
Remove old and never used tag collision chain handling in the sequencer. Tag collisions are never allowed to get as far as on the controller.
Simplify busy target table handling routines.
Update comments to reflect reality.
Add support for catching more protocol violations.
Correct a bug in data fifo handling in mixed packetized and non-packetized environments. SG_STATE must be cleared even if an SG fetch is not in progress at the time of FIFO shutdown or we may confuse the non-packetized transaction idle-loop.
|
102681 |
31-Aug-2002 |
gibbs |
Convert to new assembler field syntax.
Add preliminary Rev B definitions.
Add QOUTFIFO_ENTRY_VALID_TAG for new qoufifo scheme.
Reserve SCB space for large luns.
|
102680 |
31-Aug-2002 |
gibbs |
Updates for new non-packetized SCB-ID collision avoidance, busy target table addressing changes, our qoufifo scheme, and long lun support.
Drop bus reset hold delay to 25us.
Remove chip workarounds for revisions that never went to production.
Add aic7901A identification information.
Remove untagged queue logic.
|
102679 |
31-Aug-2002 |
gibbs |
Identify the AIC7901A as such instead of an AIC7902.
Push protocol violation handler to its own routine. We now properly detect and recovery from the following target induced protocol violations: o Unexpected or invalid non-packetized Relesection o Command complete with no status message o Good Status after incomplete cdb transfer
Add an SCB collision avoidance algorithm that allows us to use all 512 SCBs for non-packetized operations. There is still the possibility of running out of SCBs with non-colliding tag identifiers, but the algorithm ensures that the stall will be rare and short lived.
Convert to a read-only algorithm for validing entries in the qoufifo. The sequencer now toggles the high bit of the SCB identifier on each wrap around of the qinfifo. If the high bit doesn't match the expected value for this pass of the qoufifo, the entry is not valid. This has the benefit of working on machines that have large granularity cache write back semantics without requiring any additional memory.
Remove lots of code related to untagged SCB queues. Since these controllers can keep a fully busy target table, we will never have untagged SCB queues.
Lots of improvements to diagnostic logging.
Clarify some comments.
Don't clear BUSFREE interrupt enable in SIMODE1 in the SELTO handler. Just clearing the interrupt status is sufficient and this avoids the chance of disabling busfree detection in connection that occurs while we are handling the busfree interrupt.
Clear all possible interrupt sources when handling a busfree interrupt. The hardware clears some but not all of them.
Don't panic if we get into the default SCSIINT handler. Dump the card state and clear all interrupt sources in the hope that we can continue.
LASTPHASE != PREVPHASE. Use the correct PREVPHASE for testing against values in the PERRDIAG register.
According to SPI4, the bus free that is required after certain PPR negotiations will only occur at the end of all message phases. Handle the bus free if it occurs after a transaction in either the message-in or message-out phases. The busfree can also occur if the status of IU_REQ changes due to a WDTR or SDTR message. We now set the expect busfree flag in ahd_set_syncrate so that it works regardless of message type.
Correct a problem with missing certain busfree events. The chip supports single-stepping even if a SCSIINT is pending. This obviates the need to clear all of the SCSI interrupt enables prior to single stepping. Since ENBUSFREE can only be disabled manually and not re-enabled, avoiding touching this bit in the single-step case yields reliable bus free detection.
Enhance ahd_clear_intstat to clear all SCSIINT sources.
Only use ahd_update_pending_scbs() if we are active on the bus. We cannot modify the "MK_MESSAGE" bits on SCBs in the execution queue if a selection might be in process since the sequencer uses this bit to detect PPR negotiation to a target with an outstanding IU_REQ agreement.
Allocate the SCB delivery mechansim's sentinal SCB specially so we don't waste a valid SCB for this task.
Move tranceive state settle logic to ahd_chip_init() since this needs to occur after every chip reset, not just the chip reset that happens during primary driver initialization.
Correct a bug with transmitting lun information in packetized connections.
Restrict busy target table operations to the range of luns that can be used for non-packetized connections. Larger luns can only be accessed in packetized mode.
Correct a busy target table addressing bug.
Be more careful about how we shutdown the DMA engines during bus reset events.
Only freeze the SIMQ once regardless of the number of bus reset events that occur while we are polling for the resets to stop.
Don't rely on the sequencer remaining paused() during our reset poll. It is safe for the sequencer to run during this time, and many callers to the bus reset code would need to be modified to make this assumption universally true.
Even if we are not going to clobber SCB state when an auto-request sense SCB has a check condition, we must still unfreeze the queue. Re-arrange the BAD STATUS handler to handle this case appropriately.
Modify the SCB download size depending on whether long luns are being stored in the SCB.
Add ahd_print_register() for pretty printing register diagnostics.
Don't trust that the flexport logic to detect the presence of a seeprom is available. It may not be on some motherboard implementations.
"the the" -> "the"
|
102678 |
31-Aug-2002 |
gibbs |
If interrupts are disabled on the card, don't bother running our interrupt handler. Our handler was called due to a shared interrupt, and the card's interrupts are explicitly disabled to prevent entry into our interrupt handler.
|
102677 |
31-Aug-2002 |
gibbs |
Update Perforce Ids.
|
102676 |
31-Aug-2002 |
gibbs |
Move interrupt enable into the OSM.
Set the AHC_LSCBS_ENABLED softc flag appropriately.
Convert to using softc storage for our seeprom data.
Break seeprom parsing out into a separate routine.
Change our policy in regards to AHC_SPIOCAP so that we will allow auto-termination to take place on some aic7855 based cards.
Remove initialized but never really used variables.
|
102675 |
31-Aug-2002 |
gibbs |
Cleanup endian macros.
Honor the AHC_REG_PRETTY_PRINT option.
Add lock placeholders for new locks used by the core. These are not currently needed for FreeBSD.
|
102674 |
31-Aug-2002 |
gibbs |
Enable card interrupts from the OSM.
Use "offset == 0" not "period == 0" to denote async trasnfers.
Implement TARG_IMMEDIATE_SCB non-disconnected target mode SCB delivery scheme.
In our timeout handler, don't rely on the phase already being set to denote an active connection. IDENTIFY_SEEN is more than sufficient.
Verify that the softc passed in ahc_detach is still known to the driver before blindly using it.
|
102673 |
31-Aug-2002 |
gibbs |
Add a prefix to be used for assembler generated tables and functions for register pretty-printing.
Only clear SELDO once we've recorded enough information for the host to understand that the connection is valid. The host uses the SELDO status as a handshake to close this race window.
Correct a bug in target mode handling of non-disconnected transactions. The host would indicate the correct SCB to DMA by setting the SCB id in the currently selected hardware SCB. Unfortunately, we would then immediated allocate a hardware SCB which, depending on the access patern might not be the same hardware SCB that the host setup for us. Avoid this by having the host put the SCBID into scratch ram.
|
102672 |
31-Aug-2002 |
gibbs |
Convert to new assembler field syntax.
Document the SXFRCTL2 register found on U2 and U160 controllers.
Overload the MWI_RESIDUAL field for use as the SCB to be downloaded for "immediate" (or those without the disconnect privledge) transactions.
Add scratch ram locations for the 274X that give us a bit more information including whether to enable extended translation.
|
102671 |
31-Aug-2002 |
gibbs |
Drop the bus reset hold delay back down to 25us. The 250us value slipped in from a debugging session.
Add AHC_LSCBS_ENABLED and AHC_SCB_CONFIG_USED ahc_flags which allow for some code to move to the core.
Remove extern for ahc_syncrates[]. The OSMs no longer need direct access to this array.
Add serial eeprom field to the ahc softc.
Prototype ahc_search_untagged_queues() and ahc_print_register().
Convert to AHC_SHOW_XXX debug option format.
|
102670 |
31-Aug-2002 |
gibbs |
Add ahc_print_devinfo() to simplify some diagnostic output.
Switch to using the same AHC_SHOW_XXX format as the ahd driver.
Always give the target a MSG_INITIATOR_DET_ERR for unexpected DT or ST phase errors.
Add AHC_SHOW_SELTO diagnostics.
Force renegotiation whenever an unexpected bus free occurs to rule out a negotiation mismatch as the cause for the error.
Use "offset != 0" as an intenal indicator of "async" rather than using a period of 0.
In ahc_fetch_devinfo(), correct a bug in getting "our id" as target. We weren't looking at all the SEQ_FLAGS that indicate that we are still in a selected rather than reselected state.
Add support for the AHC_SHOW_MESSAGES debugging option.
If ahc_parse_msg() tells us to terminate the message loop, do so without acking the message. The message may be one that the sequencer needs to handle on its own.
In ahc_parse_msg() return MSGLOOP_TERMINATED for all messages the sequencer handles.
Allocate storage for, and track, seeprom contents in our softc.
Touch all SCB bytes to avoid parity errors should one of our debugging routines read an otherwise uninitiatlized byte.
S/G lists must be 8 byte aligned. Reflect this in our DMA tag.
"the the" -> "the" in a comment
When pausing the card to perform error recovery, ensure that we are not in the process of being selected or have just been selected but have not yet handled that selection. This leaves only one other race window, in the command complete handler, that needs to be fixed to make recovery 100% bullet proof.
Convert a few straglers from bsd u_intX_t to inttypes uintX_t.
Remove unused variables.
Split out searching of the untagged holding queues to its own routine. In certain recovery scenarios, we want to just remove entries in the untagged queue without touching related transactions that are in the QINFIFO or WAITING queues that are searched by ahc_search_qinfifo().
Add an implementation of the ahc_print_register() routine which "pretty prints" registers. The extra bloat in the form of string tables for this feature is controlled by the AHC_REG_PRETTY_PRINT option.
Fix a few bugs in ahc_enable_lun() that could prevent controllers lacking the multiple-target-id feature from changing "our id" on the fly. Add a large comment to this section while I'm here describing the restrictions on "id switching".
|
102669 |
31-Aug-2002 |
gibbs |
Pass unparsed serial eeprom information into the driver core.
Honor the extended translation setting for EISA cards now that I've determined where this information is kept.
Defer card interrupt enabling to the OSM since it may have some initialization to perform that must occur before interrupts can be enabled.
|
102668 |
31-Aug-2002 |
gibbs |
Update assembler syntax and assembler to allow generation of register description tables used for diagnostic "pretty printing".
|
102662 |
31-Aug-2002 |
gibbs |
Tell the user about a failed IRQ mapping rather than fail silently.
|
101131 |
01-Aug-2002 |
scottl |
Allow the ahc and ahd drivers to be built as modules. This also breaks the ahc driver into a core back-end and pci and eisa front-ends.
|
100548 |
23-Jul-2002 |
peter |
Minimal tweak to not depend on NPCI, but still maintain portability to 4.x which still does need it (since pci_if.h isn't generated without pci being present)
|
100502 |
22-Jul-2002 |
robert |
- Remove unnecessary break statement. - Move a label to a syntactically correct place to keep gcc from warning.
|
97937 |
06-Jun-2002 |
gibbs |
Hook up the ahd driver.
|
97936 |
06-Jun-2002 |
gibbs |
Remove one more multi-line string literal.
|
97893 |
05-Jun-2002 |
gibbs |
Silence GCC warnings about multi-line strings.
Sync Perforce IDs.
|
97883 |
05-Jun-2002 |
gibbs |
Enter the ahd driver which supports the Adaptec AIC7902 Ultra320, PCI-X SCSI Controller chip.
|
96556 |
14-May-2002 |
obrien |
Tweak the include dirs w/o incurring extra warnings
|
96315 |
10-May-2002 |
obrien |
Use only bits w/in /sys if at all possible.
|
95862 |
01-May-2002 |
peter |
Add "CFLAGS+= -I${MAKESRCPATH}" when running under the kernel build, otherwise #include "aicasm.h" etc do not work with gcc-3 and later.
|
95533 |
26-Apr-2002 |
mike |
Move the new byte order function prototypes from <sys/param.h> to <sys/endian.h>. This puts us in line with NetBSD and OpenBSD.
|
95378 |
24-Apr-2002 |
gibbs |
Major update to the aic7xxx driver:
ahc_eisa.c: ahc_pci.c: Conform to new aic7xxx IRQ API.
Adapt to aic7xxx_freebsd -> aic7xxx_osm changes.
aic7770.c: Disable card generated interrupt early in our probe for "extra safety"
Commonize some seeprom code with the PCI side of the driver.
aic7xxx.c: Correctly initialize a few scratch ram locations during a sequencer restart. This avoids spurious sequencer ram parity errors in some configurations.
Include the softc in ahc_update_residual calls. We need it for some diagnostics in this code path.
Flag a data overrun on an auto-request sense failure as a CAM_AUTOSENSE_FAIL rather than a CAM_DATA_RUN_ERR.
Force a renegotiation after noticing a parity error. This covers targets that lose our negotiation settings but don't bother to give us a unit attention condition. This can happen if a target fails during a reselection of us during a cable pull.
Convert some code to using constants.
Fix some typos.
Correct target mode message loop handling. ahc_clear_msg_state was not clearing the "need to go to message out phase" bit once our loop was over.
Simplify some abort handling code.
Include tag information in target mode immediate notify events.
When shutting down EISA controllers, don't EISA BIOS settings in the high portions of scratch ram. This fixes warm boot issues on some systems.
Save a bit of space by only allocating the SCBs that we can use.
Avoid some code paths in ahc_abort_scbs() if we are currently acting as a target.
Correctly cleanup stranded SCBs in the card's SCB array. These are SCBs who's mapping has already been torn down by code that aborted the SCB by seeing it in another list first.
Add a comment about some potential bus reset issues for target mode on Twin (EISA only) controllers.
aic7xxx.h: Cleanup the hardware scb definitions a bit.
Allocate a ful 256 byte scb mapping index. This simplifies the lookup code since the table covers all possible (and potentially bogus) values.
Make AHC_DEBUG work again.
aic7xxx.reg: Updates to hardware SCB definition.
New definitions for target mode fixes.
aic7xxx.seq: In target mode, initialize SAVED_LUN just after we receive the identify message. It may be required in the error recovery path when a normal cdb packet (includes lun) is not sent up to the host for processing.
Respond to irregular messages during a selection in target mode.
Defer looking for space for a cdb packet until we are about to enter command phase. We want to be able to handle irregular messages even if we would otherwise return QUEUE_FULL or BUSY.
Add support for sending Ignore Wide Residue messages as a target.
In the disable disconnect case in target mode, set our transfer rate correctly once data are availble.
aic7xxx_93cx6.c: aic7xxx_93cx6.h: Add the ability to write and erase the seeprom.
aic7xxx_inline.h: Correct Big Endian handling of large cdb sizes (> 12 bytes).
Adaptec to changes in the calc_residual API.
Correct a target mode bug where we always attempted to service the input queue even if no progress could be made due to lack of ATIOs.
aic7xxx_osm.c: Adaptec to new IRQ mapping API. The new API allows the core to only enable our IRQ mapping once it is safe (sufficient initialization) to do so.
Slap bootverbose protection around some diagnostics.
Only attempt DT phases if we are wide.
aic7xxx_osm.h: Enable big endian support.
Adjust for IRQ API change.
aic7xxx_pci.c: Be more careful about relying on subvendor 9005 information. We now only trust it for HBAs. This should allow the driver to attach to some MBs where the subvendor/device information does not follow the Adaptec spec.
Only enable interrupts on the card once we are fully setup.
Disable external SCB ram usage on the aic7895. I have not been able to make it 100% reliable.
Adjust to seeprom routines being properly prefixed with "ahc".
Fix a few bugs in the external SCB ram probing routine. We need to clear any parity errors we've triggered during the probe to avoid future, fatal, interrupts.
If we detect an invalid cable combination, pretent there are no cable at all. This will enable all of the terminators which is probably the safest configuration we can "guess".
MFC after: 4 days
|
95376 |
24-Apr-2002 |
gibbs |
Add macro functionality.
Staticize and allow unique naming of data structures so that more than on sequencer program can be statically compiled into the kernel at a time.
|
92770 |
20-Mar-2002 |
alfred |
Remove __P.
|
92065 |
11-Mar-2002 |
obrien |
Due to changes in the handling of the #line directive by GCC(cpp) 3.1, we must now explicitly list the source directory with -I.
|
88022 |
16-Dec-2001 |
gibbs |
Remove reliance on i++ in multiple arguments to a function. C does not guarantee the order of increment.
Noticed by: GCC 3.0 use by the Linux community and jhb
|
81809 |
17-Aug-2001 |
gibbs |
Restore initialization of ahc->unpause lost in rev 1.76. ahc->unpause should be initialized to 0 for PCI adapters which was a side-effect of the memset in ahc_alloc(). EISA/VL adapters require our unpause value to include the "levelness" of our interrupt.
This change allows EISA adapters to work again.
PR: 29689, 29471
|
81170 |
05-Aug-2001 |
gibbs |
aic7xxx.c: Correct an off by one in our critical section handling. SEQADDR always reads the next instruction to execute, so we must subtract one from its value before making comparisons with entries in the critical section table.
Print a few additional registers whenever we dump card state.
Show the SCB_CONTROL and SCB_TAG values for all pending SCBs in card SCB ram when dumping card state.
aic7xxx.seq: Fix a bug introduced while optimizing the SDPTR path. We would ack the SDPTR message twice on Ultra2 or better chips if it occurred after all data had been transferred for a transaction.
Change our workaround for the PCI2.1 retry bug on some chips. Although the previous workaround was logically correct, its faster method of draining the FIFO seemed to occassionally confuse the FIFO state. We now drain the FIFO at half the speed which avoids the problem.
aic7xxx_pci.c: Chips with the PCI 2.1 retry bug can't handle a 16byte cachesize. If the cachesize is set to 16bytes, drop it to 0.
|
80510 |
28-Jul-2001 |
gibbs |
Remove a bootverbose diagnostic that makes bootverbose just too verbose.
|
80169 |
22-Jul-2001 |
assar |
add %option nounput
|
79874 |
18-Jul-2001 |
gibbs |
ahc_pci.c: If bus_dma will give us addresses > 32 bits, setup our dma tag to accept up to 39bit addresses.
aic7770.c: Update the softc directly rather than use an intermediate "probe_config" structure.
aic7xxx.c: Complete core work to support 39bit addresses for bulk data dma operations. Controller data structures still must reside under the 4GB boundary to reduce code/data size in the sequencer and related data structures. This has been tested under Linux IA64 and will be tested on IA64 for FreeBSD as soon as our port can run there.
Add bus dmamap synchronization calls around manipulation of all controller/kernel shared host data structures.
Implement data pointer reinitialation for a second data phase in a single connection in the kernel rather than bloat the sequencer. This is an extremely rare operation (does it ever happen?) and the sequencer implementation was flawed for some of the newest chips.
Don't ever allow our target role to initiate a PPR. This is forbidden by the SCSI spec.
Add a few missing endian conversions in the ignore wide pointers code. The core has been tested on the PPC under Linux and should work for FreeBSD PPC. As soon as I can test the OSM layer for FreeBSD PPC, I will.
Move some of ahc_softc_init() into ahc_alloc() now that the probe_config structure is gone.
Add a 4GB boundary condition on all of our dma tags. 32bit DAC under PCI only works on a single 4GB "page". Although we can cross 4GB on a true 64bit bus, the card won't always be installed in one and we can save code space and cost in implementing high address support by assuming the high DWORD address will never change.
Add diagnostics to ahc_search_qinfifo().
Correct a target mode issue with bus resets. To avoid an interrupt storm from a malicious third party holding the reset line, the sequencer would defer re-enabling the reset interrupt until either a select-out or select-in. Unfortunately, the select-in enable bit is cleared by a bus reset, so a second reset will render the card deaf to an initiator's attempts to contact it. We now re-enable bus reset interrupts immediately if the target role is enabled.
aic7xxx.h: Remove struct ahc_probe_config.
SCB's now contain a pointer to the sg_map_node so we can perfrom bus dma sync operations on the SG list prior to queuing a command.
aic7xxx.reg: Register the Perforce ID for this file with the VERSION keyword so it is printed in generated files.
Add the DSCOMMAND1 register which is used to access the high DWORD of address bits.
Add the data pointer reinitialize sequencer interrupt code.
aic7xxx.seq: Register the Perforce ID for this file with the VERSION keyword so it is printed in generated files.
Remove code to re-enable the bus reset interrupt after a select-in. In target mode we cannot defer this operation as ENSELI is cleared by a bus reset.
Complete 39bit support.
Generate a sequencer inteerrupt rather than handle the data pointers re-initialitation in the sequencer.
Inline the "seen identify" assertion to save a few cycles.
Short circuit the update of our residual data if we have fully completed a transfer. The residual is correct from our last S/G load operation.
Short circuit full SDPTR processing if the residual is 0. Just mark the transfer as complete.
aic7xxx_93cx6.c: Synchronize perforce IDs.
aic7xxx_freebsd.c: Complete untested 39bit support.
Add missing endia conversions.
Clear our residuals prior to starting a command. The update residual code in the core only sets the residual if there is one.
aic7xxx_freebsd.h: Modeify ahc_dmamap_sync() macros to take an offset and a length. This is how sync operations are performed in NetBSD, and we should update our bus dma implementation to match.
aic7xxx_inline.h: Add data structure synchronization helper functions.
Fix a bug in ahc_intr() where we would not clear our unsolicited interrupt counter after running our PCI interrupt handler. This may have been the cause of the spurious PCI interrupt messages.
aic7xxx_pci.c: Adjust for loss of probe_config structure.
Guard against bogus 9005 subdevice information as seen on some IBM MB configurations.
Add 39bit address support.
MFC after: 10 days
|
79873 |
18-Jul-2001 |
gibbs |
Add support for parsing version strings out of assembler source files and outputing them in generated files.
Fixed a few other scanner bugs that for some reason didn't show up until these modifications were made.
MFC after: 10 days
|
78577 |
22-Jun-2001 |
mjacob |
Move check against CAM_NEW_TRAN_CODE ahead of the file that might include the option file that would define it.
|
78555 |
21-Jun-2001 |
mjacob |
Don't dereference NULL regs pointer (should mapping I/O ports fail, as they did for me on an alpha)
Approved by: gibbs@freebsd.org MFC after: 2 days
|
76634 |
15-May-2001 |
gibbs |
ahc_eisa.c: ahc_pci.c: Prepare for making ahc a module by adding module dependency and version info.
aic7770.c: Remove linux header ifdefs. The headers are handled differently in Linux where local includes (those using "'s instead of <>'s) are allowed.
Don't map our interrupt until after we are fully setup to handle interrupts. Our interrupt line may be shared so an interrupt could occur at any time.
aic7xxx.c: Remove linux header ifdefs.
current->curr to avoid Linux's use of current as a #define for the current task on some architectures.
Add a helper function, ahc_assert_atn(), for use in message phases we handle manually. This hides the fact that U160 chips with the expected phase matching disabled need to have SCSISIGO updated differently.
if (ahc_check_residual(scb) != 0) ahc_calc_residual(scb); else ahc_set_residual(scb, 0);
becomes:
ahc_update_residual(scb);
Modify scsi parity error (or CRC error) handling to reflect expected phase being disabled on U160 chips.
Move SELTO handling above BUSFREE handling so we can use the new busfree interrupt behavior on U160 chips.
In ahc_build_transfer_msg() filter the period and ppr_options prior to deciding whether a PPR message is required. ppr_options may be forced to zero which will effect our decision.
Correct a long standing but latent bug in ahc_find_syncrate(). We could choose a DT only rate even though DT transfers were disabled. In the CAM environment this was unlikely as CAM filters our rate to a non-DT value if the device does not support such rates.
When displaing controller characteristics, include the speed of the chip. This way we can modify the transfer speed based on optional features that are enabled/disabled in a particular application.
Add support for switching from fully blown tagged queing to just using simple queue tags should the device reject an ordered tag.
Remove per-target "current" disconnect and tag queuing enable flags. These should be per-device and are not referenced internally be the driver, so we let the OSM track this state if it needs to.
Use SCSI-3 message terminology.
aic7xxx.h: The real 7850 does not support Ultra modes, but there are several cards that use the generic 7850 PCI ID even though they are using an Ultra capable chip (7859/7860). We start out with the AHC_ULTRA feature set and then check the DEVSTATUS register to determine if the capability is really present.
current -> curr
ahc_calc_residual() is no longer static allowing it to be called from ahc_update_residual() in aic7xxx_inline.h.
Update some serial eeprom definitions for the latest BIOS versions.
aic7xxx.reg: Add a combined DATA_PHASE mask to the SCSIPHASE register definition to simplify some sequencer code.
aic7xxx.seq: Take advantage of some performance features available only on the U160 chips. The auto-ack feature allows us to ack data-in phases up to the data-fifo size while the sequencer is still setting up the DMA engine. This greatly reduces read transfer latency and simplifies testing for transfer complete (check SCSIEN only). We also disable the expected phase feature, and enable the new bus free interrupt behavior, to avoid a few instructions.
Re-arrange the Ultra2+ data phase handling to allow us to do more work in parallel with the data fifo flushing on a read.
On an SDTR, ack the message immediately so the target can prepare the next phase or message byte in parallel with our work to honor the message.
aic7xxx_93cx6.c: Remove linux header ifdefs.
aic7xxx_freebsd.c: current -> curr
Add a module event handler.
Handle tag downgrades in our ahc_send_async() handler. We won't be able to downgrade to "basic queuing" until CAM is made aware of this queuing type.
aic7xxx_freebsd.h: Include cleanups.
Define offsetof if required.
Correct a few comments.
Update prototype of ahc_send_async().
aic7xxx_inline.h: Implement ahc_update_residual().
aic7xxx_pci.c: Remove linux header ifdefs.
Correct a few product strings.
Enable several U160 performance enhancing features.
Modify Ultra capability determination so we will enable Ultra speeds on devices with a 7850 PCI id that happen to really be a 7859 or 7860.
Don't map our interrupt until after we are fully setup to handle interrupts. Our interrupt line may be shared so an interrupt could occur at any time.
|
75201 |
04-Apr-2001 |
ken |
Don't allow immediate values of 0 for operations that can take either an immediate value or the accumulator. 0 is the chip's internal representation for the accumulator, and so 0 is an invalid immediate value when the accumulator can also be specified as an argument.
Submitted by: gibbs
|
75048 |
01-Apr-2001 |
gibbs |
Change ahc_update_pending_scbs() so that it safe to be called even if the controller is not paused. This prevents SCB list corruption that was introduced in the last checkin.
|
74972 |
29-Mar-2001 |
gibbs |
aic7770.c: aic7xxx_pci.c: Enable board generation of interrupts only once our handler is in place and all other setup has occurred.
aic7xxx.c: More conversion of data types to ahc_* names. tmode_tstate and tmode_lstate are the latest victims.
Clean up the check condition path by branching early rather than indenting a giant block of code.
Add support for target mode initiated sync negotiation. The code has been tested by forcing the feature on for all devices, but for the moment is left inaccesible until a decent mechanism for controlling the behavior is complete. Implementing this feature required the removal of the old "target message request" mechanism. The old method required setting one of the 16 bit fields to initiate negotiation with a particular target. This had the nice effect of being easy to change the request and have it effect the next command. We now set the MK_MESSAGE bit on any new command when negotiation is required. When the negotiation is successful, we walk through and clean up the bit on any pending commands. Since we have to walk the commands to reset the SCSI syncrate values so no additional work is required. The only drawback of this approach is that the negotiation is deferred until the next command is queued to the controller. On the plus side, we regain two bytes of sequencer scratch ram and 6 sequencer instructions.
When cleaning up a target mode instance, never remove the "master" target mode state object. The master contains all of the saved SEEPROM settings that control things like transfer negotiations. This data will be cloned as the defaults if a target mode instance is re-instantiated.
Correct a bug in ahc_set_width(). We neglected to update the pending scbs to reflect the new parameters. Since wide negotiation is almost always followed by sync negotiation it is doubtful that this had any real effect.
When in the target role, don't complain about "Target Initiated" negotiation requests when an initiator negotiates with us.
Defer enabling board interrupts until after ahc_intr_enable() is called.
Pull all info that used to be in ahc_timeout for the FreeBSD OSM into ahc_dump_card_state(). This info should be printed out on all platforms.
aic7xxx.h: Add the SCB_AUTO_NEGOITATE scb flag. This allows us to discern the reason the MK_MESSAGE flag is set in the hscb control byte. We only want to clear MK_MESSAGE in ahc_update_pending_scbs() if the MK_MESSAGE was set due to an auto transfer negotiation.
Add the auto_negotiate bitfield for each tstate so that behavior can be controlled for each of our enabled SCSI IDs.
Use a bus interrupt handler vector in our softc rather than hard coding the PCI interrupt handler. This makes it easier to build the different bus attachments to the aic7xxx driver as modules.
aic7xxx.reg: Remove the TARGET_MSG_REQUEST definition for sequencer ram.
aic7xxx.seq: Fix a few target mode bugs:
o If MK_MESSAGE is set in an SCB, transition to message in phase and notify the kernel so that message delivery can occur. This is currently only used for target mode initiated transfer negotiation.
o Allow a continue target I/O to compile without executing a status phase or disconnecting. If we have not been granted the disconnect privledge but this transfer is larger than MAXPHYS, it may take several CTIOs to get the job done.
Remove the tests of the TARGET_MSG_REQUEST field in scratch ram.
aic7xxx_freebsd.c: Add support for CTIOs that don't disconnect. We now defer the clearing of our pending target state until we see a CTIO for that device that has completed sucessfully.
Be sure to return early if we are in a target only role and see an initiator only CCB type in our action routine.
If a CTIO has the CAM_DIS_DISCONNECT flag set, propogate this flag to the SCB. This flag has no effect if we've been asked to deliver status as well. We will complete the command and release the bus in that case.
Handle the new auto_negotiate field in the tstate correctly.
Make sure that SCBs for "immediate" (i.e. to continue a non disconnected transaction) CTIO requests get a proper mapping in the SCB lookup table. Without this, we'll complain when the transaction completes.
Update ahc_timeout() to reflect the changes to ahc_dump_card_state().
aic7xxx_inline.h: Use ahc->bus_intr rather than ahc_pci_intr.
|
74840 |
27-Mar-2001 |
ken |
Rewrite of the CAM error recovery code.
Some of the major changes include:
- The SCSI error handling portion of cam_periph_error() has been broken out into a number of subfunctions to better modularize the code that handles the hierarchy of SCSI errors. As a result, the code is now much easier to read.
- String handling and error printing has been significantly revamped. We now use sbufs to do string formatting instead of using printfs (for the kernel) and snprintf/strncat (for userland) as before.
There is a new catchall error printing routine, cam_error_print() and its string-based counterpart, cam_error_string() that allow the kernel and userland applications to pass in a CCB and have errors printed out properly, whether or not they're SCSI errors. Among other things, this helped eliminate a fair amount of duplicate code in camcontrol.
We now print out more information than before, including the CAM status and SCSI status and the error recovery action taken to remedy the problem.
- sbufs are now available in userland, via libsbuf. This change was necessary since most of the error printing code is shared between libcam and the kernel.
- A new transfer settings interface is included in this checkin. This code is #ifdef'ed out, and is primarily intended to aid discussion with HBA driver authors on the final form the interface should take. There is example code in the ahc(4) driver that implements the HBA driver side of the new interface. The new transfer settings code won't be enabled until we're ready to switch all HBA drivers over to the new interface.
src/Makefile.inc1, lib/Makefile: Add libsbuf. It must be built before libcam, since libcam uses sbuf routines.
libcam/Makefile: libcam now depends on libsbuf.
libsbuf/Makefile: Add a makefile for libsbuf. This pulls in the sbuf sources from sys/kern.
bsd.libnames.mk: Add LIBSBUF.
camcontrol/Makefile: Add -lsbuf. Since camcontrol is statically linked, we can't depend on the dynamic linker to pull in libsbuf.
camcontrol.c: Use cam_error_print() instead of checking for CAM_SCSI_STATUS_ERROR on every failed CCB.
sbuf.9: Change the prototypes for sbuf_cat() and sbuf_cpy() so that the source string is now a const char *. This is more in line wth the standard system string functions, and helps eliminate warnings when dealing with a const source buffer.
Fix a typo.
cam.c: Add description strings for the various CAM error status values, as well as routines to look up those strings.
Add new cam_error_string() and cam_error_print() routines for userland and the kernel.
cam.h: Add a new CAM flag, CAM_RETRY_SELTO.
Add enumerated types for the various options available with cam_error_print() and cam_error_string().
cam_ccb.h: Add new transfer negotiation structures/types.
Change inq_len in the ccb_getdev structure to be "reserved". This field has never been filled in, and will be removed when we next bump the CAM version.
cam_debug.h: Fix typo.
cam_periph.c: Modularize cam_periph_error(). The SCSI error handling part of cam_periph_error() is now in camperiphscsistatuserror() and camperiphscsisenseerror().
In cam_periph_lock(), increase the reference count on the periph while we wait for our lock attempt to succeed so that the periph won't go away while we're sleeping.
cam_xpt.c: Add new transfer negotiation code. (ifdefed out)
Add a new function, xpt_path_string(). This is a string/sbuf analog to xpt_print_path().
scsi_all.c: Revamp string handing and error printing code. We now use sbufs for much of the string formatting code. More of that code is shared between userland the kernel.
scsi_all.h: Get rid of SS_TURSTART, it wasn't terribly useful in the first place.
Add a new error action, SS_REQSENSE. (Send a request sense and then retry the command.) This is useful when the controller hasn't performed autosense for some reason.
Change the default actions around a bit.
scsi_cd.c, scsi_da.c, scsi_pt.c, scsi_ses.c: SF_RETRY_SELTO -> CAM_RETRY_SELTO. Selection timeouts shouldn't be covered by a sense flag.
scsi_pass.[ch]: SF_RETRY_SELTO -> CAM_RETRY_SELTO.
Get rid of the last vestiges of a read/write interface.
libkern/bsearch.c, sys/libkern.h, conf/files: Add bsearch.c, which is needed for some of the new table lookup routines.
aic7xxx_freebsd.c: Define AHC_NEW_TRAN_SETTINGS if CAM_NEW_TRAN_CODE is defined.
sbuf.h, subr_sbuf.c: Add the appropriate #ifdefs so sbufs can compile and run in userland.
Change sbuf_printf() to use vsnprintf() instead of kvprintf(), which is only available in the kernel.
Change the source string for sbuf_cpy() and sbuf_cat() to be a const char *.
Add __BEGIN_DECLS and __END_DECLS around function prototypes since they're now exported to userland.
kdump/mkioctls: Include stdio.h before cam.h since cam.h now includes a function with a FILE * argument.
Submitted by: gibbs (mostly) Reviewed by: jdp, marcel (libsbuf makefile changes) Reviewed by: des (sbuf changes) Reviewed by: ken
|
74507 |
20-Mar-2001 |
gibbs |
This is an MFC candidate.
In our idle loop, use an or instruction to set PRELOADEN rather than rewriting the contents of DMAPARAMS to DFCNTRL. The later may re-enable the DMA engine if the idle loop is called to complete the preload of at least one segment when a target disconnects on an S/G segment boundary but before we have completed fetching the next segment. This correts a hang, usually in message out phase, when this situation occurs. This bug has been here for a long time, so the situation is rare, but not impossible to reproduce. It only affected Ultra2/U160 controllers.
Correct a few comments.
Extra Sanity. Make sure that SCSIEN is also turned off, along with HDMAEN, at the end of the data phase.
|
74434 |
19-Mar-2001 |
gibbs |
This is an MFC candidate.
aic7xxx.c: Correct code that traverses the phase table. A much too quick push to staticize this structure resulted in non-functional lookup code. This corrects the printing of the phase where a timeout occurred.
aic7xxx.reg: Use FIFOQWDEMP as the name for bit 5 of DFSTATUS just like the Adaptec data books.
aic7xxx.seq: Refine the 2.1 PCI retry bug workaround for certain, non-ULTRA2, controllers. When the DMA of an SCB completes, it can take some time for HDONE to come true after MREQPEN (PCI memory request pending) falls. If HDONE never comes true, we are in the hung state and must manually drain the FIFO. We used to test HDONE for 3 clock cycles to detect this condition. This works on all of the hardware I can personally test. Some controllers were reported to take 4 clock cycles, so the last version of this code waited 4 clock cycles. This still didn't work for everyone. To fix this, I've adjusted the work around so that even if the hardware hasn't hung, but we run the work-around code, the result is a long winded way to complete the transfer, rather than a hang.
|
74094 |
11-Mar-2001 |
gibbs |
This is an MFC candidate.
ahc_eisa.c: Change aic7770_map_int to take an additional irq parameter. Although we can get the irq from the eisa dev under FreeBSD, we can't do this under linux, so the OSM interface must supply this.
ahc_pci.c: Move ahc_power_state_change() to the OSM. This allows us to use a platform supplied function that does the same thing. -current will move to the FreeBSD native API in the near future.
aic7770.c: Sync up with core changes to support Linux EISA.
We now store a 2 bit primary channel number rather than a bit flag that only allows b to be the primary channel. Adjust for this change.
aic7xxx.c: Namespace and staticization cleanup. All exported symbols use an "ahc_" prefix to avoid collisions with other modules.
Correct a logic bug that prevented us from dropping ATN during some exceptional conditions during message processing.
Take advantage of a new flag managed by the sequencer that indicates if an SCB fetch is in progress. If so, the currently selected SCB needs to be returned to the free list to prevent an SCB leak. This leak is a rarity and would only occur if a bus reset or timeout resulting in a bus reset occurred in the middle of an SCB fetch.
Don't attempt to perform ULTRA transfers on ultra capable adapters missing the external precision resistor required for ultra speeds. I've never encountered an adapter configured this way, but better safe than sorry.
Handle the case of 5MHz user sync rate set as "0" instead of 0x1c in scratch ram.
If we lookup a period of 0 in our table (async), clear the scsi offset.
aic7xxx.h: Adjust for the primary channel being represented as a 2 bit integer in the flags member of the ahc softc.
Cleanup the flags definitions so that comment blocks are not cramped.
Update seeprom definitions to correctly reflect the fact that the primary channel is represented as a 2 bit integer.
Add AHC_ULTRA_DIASABLED softc flag to denote controllers missing the external precision resistor.
aic7xxx.reg: Add DFCACHETH to the definition of DFSTATUS for completness sake.
Add SEQ_FLAGS2 which currently only contains the SCB_DMA (SCB DMA in progress) flag.
aic7xxx.seq: Correct a problem when one lun has a disconnected untagged transaction and another lun has disconnected tagged transactions. Just because an entry is found in the untagged table doesn't mean that it will match. If the match on the lun fails, cleanup the SCB (return it to the disconnected list or free it), and snoop for a tag message. Before this change, we reported an unsolicited reselection. This bug was introduced about a month ago during an overly aggressive optimization pass on the reselection code.
When cleaning up an SCB, we can't just blindly free the SCB. In the paging case, if the SCB came off of the disconnected list, its state may never have been updated in host memory. So, check the disconnected bit in SCB_CONTROL and return the SCB to the disconnected list if appropriate.
Manage the SCB_DMA flag of SEQ_FLAGS2.
More carefully shutdown the S/G dma engine in all cases by using a subroutine. Supposedly not doing this can cause an arbiter hang on some ULTRA2 chips.
Formatting cleanup.
On some chips, at least the aic7856, the transition from MREQPEND to HDONE can take a full 4 clock cycles. Test HDONE one more time to avoid this race. We only want our FIFO hung recovery code to execute when the engine is really hung.
aic7xxx_93cx6.c: Sync perforce ids.
aic7xxx_freebsd.c: Adjust for the primary channel being a 2 bit integer rather than a flag for 'B' channel being the primary.
Namespace cleanup.
Unpause the sequencer in one error recovery path that neglected to do so. This could have caused us to perform a bus reset when a recovery message might have otherwise been successful.
aic7xxx_freebsd.h: Use AHC_PCI_CONFIG for controlling compilation of PCI support consistently throughout the driver.
Move ahc_power_state_change() to OSM.
aic7xxx_inline.h Namespace cleanup.
Adjust our interrupt handler so it will work in the edge interrupt case. We must process all interrupt sources when the interrupt fires or risk not ever getting an interrupt again. This involves marking the fact that we are relying on an edge interrupt in ahc->flags and checking for this condition in addition to the AHC_ALL_INTERRUPTS flag. This fixes hangs on the 284X and any other aic7770 installation where level interrupts are not available.
aic7xxx_pci.c: Move the powerstate manipulation code into the OSM. Several OSes now provide this functionality natively.
Take another shot at using the data stored in scratch ram if the SCB2 signature is correct and no SEEPROM data is available. In the past this failed if external SCB ram was configured because the memory port was locked. We now release the memory port prior to testing the values in SCB2 and re-acquire it prior to doing termination control.
Adjust for new 2 bit primary channel setting.
Trust the STPWLEVEL setting on v 3.X BIOSes too.
Configure any 785X ID in the same fashion and assume that any device with a rev id of 1 or higher has the PCI 2.1 retry bug.
|
72811 |
21-Feb-2001 |
gibbs |
aic7xxx.c: Use the target offset rather than the target Id to reference the untagged SCB array. The offset and id are identical save in the twin channel case. This should correct several issues with the 2742T.
Set the user and goal settings prior to setting the current settings. This allows the async update routine to filter out intermediate transfer negotiation updates that may be less than interesting. The Linux OSM uses this to reduce the amount of stuff printed to the console.
aic7xxx.seq: Correct an issue with the aic7770 in twin channel mode. We could continually attempt to start a selection even though a selection was already occurring on one channel. This might have the side effect of hanging our selection or causing us to select the wrong device.
While here, create a separate polling loop for when we have already started a selection. This should reduce the latency of our response to a (re)selection. The diffs look larger than they really are due to some code rearrangement to optimize out a jmp.
aic7xxx_freebsd.c: Use the target offset rather than the target Id to reference the untagged SCB array. The offset and id are identical save in the twin channel case. This should correct several issues with the 2742T.
aic7xxx_inline.h: Get back in sync with perforce revision ID.
aic7xxx_pci.c: Identify adapters in ARO mode as such.
Ensure that not only the subvendor ID is correct (9005) but also that the controller type field is valid before looking at other information in the subdevice id. Intel seems to have decided that their subdevice id of 8086 is more appropriate for some of their MBs with aic7xxx parts than Adaptec's sanctioned scheme.
Add an exclusion entry for SISL (AAC on MB based adapters). Adapters in SISL mode are owned by the RAID controller, so even if a driver for the RAID controller is not present, it isn't safe for us to touch them.
|
72670 |
18-Feb-2001 |
markm |
Set the interrupt-harvesting bit for those hardware items that I can actually test.
Nothing will happen until the sysadmin turns on intr-harvesting on her computer.
|
72640 |
18-Feb-2001 |
asmodai |
Preceed/preceeding are not english words. Use precede or preceding.
|
72552 |
17-Feb-2001 |
gibbs |
Limit CHANNEL_B_PRIMARY's effect to twin channel adapters where we can easily register our sub-busses in the reversed order. In the future, we may provide a hint to CAM on how to order the scans for multi-function adapters that also set this flag, but trying to do it the "twin channel" way will lead to a panic.
|
72325 |
10-Feb-2001 |
gibbs |
aic7xxx.c: Style nits.
Make sure that our selection hardware is disabled as soon as possible after detecting a busfree and even go so far as to disable the selection hardware in advance of an event that will cause a busfree (ABORT or BUS DEVICE RESET message). The concern is that the selection hardware will select a target for which, after processing the bus free, there will be no commands pending. The sequencer idle loop will re-enable the selection should it still be necessary.
In ahc_handle_scsiint(), clear SSTAT0 events several PCI transactions (most notably reads) prior to clearing SCSIINT. The newer chips seem to take a bit of time to see the change which can make the clearing of SCSIINT ineffective.
Don't bother panicing at the end of ahc_handle_scsiint(). Getting to the final else just means we lost the race with clearing SCSIINT.
In ahc_free(), handle init-level 0. This can happen when we fail the attach for RAID devices. While I'm here, also kill the parent dma tag.
In ahc_match_scb(), consider initiator ccbs to be any that are not from the target mode group. This fixes a bug where an external target reset CCB was not getting cleaned up by the reset code.
Don't bother freezing a ccb in any of our "abort" routines when the status is set to CAM_REQ_CMP. This can happen for a target reset ccb.
aic7xxx.reg: Reserve space for a completion queue. This will be used to enhance performance in the near future.
aic7xxx.seq: Remove an optimization for the 7890 autoflush bug that turned out to allow, in rare cases, some data to get lost.
Implement a simpler, faster, fix for the PCI_2_1 retry bug that hangs the sequencer on an SCB dma for certain chips.
Test against SAVED_SCSIID rather than SELID during target reselections. This is how we always did it in the past, but the code was modified while trying to work around an issue with the 7895. SAVED_SCSIID takes into account twin channel adapters such as the 2742T, whereas SELID does not have the channel bit. This caused invalid selection warnings and other strangeness on these cards.
aic7xxx_pci.c Use the correct mask for checking the generic aic7892 entry.
|
72085 |
06-Feb-2001 |
asmodai |
Fix typo: depricated -> deprecated.
|
71999 |
04-Feb-2001 |
phk |
Mechanical change to use <sys/queue.h> macro API instead of fondling implementation details.
Created with: sed(1) Reviewed by: md5(1)
|
71717 |
27-Jan-2001 |
gibbs |
Update Copyright notices for new year. (should have been in last commit).
|
71473 |
23-Jan-2001 |
gibbs |
When flipping the first entry in the qinfifo with the "next queued SCB", we must also inform the card of this change. Otherwise the sequencer will traverse a corrupt list of SCBS. The side effects of this problem were unknown SCBs completing in the qoutfifo or worse yet, panics due to sequencer interrupts that referenced what, to the kernel, were invalid SCB ids.
|
71390 |
22-Jan-2001 |
gibbs |
ahc_eisa.c: Initialize rid to 0. This doesn't seem to make any difference (the driver doesn't care what rid it gets and no-one seems to check rid's value), but follows standard conventions.
Pass in our device_t to ahc_alloc(). We now use device_T softc storage, so passing NULL results in a panic.
Set the unit number in our softc so that the driver core can retrieve it.
ahc_pci.c: Set the unit number in our softc so that the driver core can retrieve it.
aic7770.c: Insert our softc into the list of softcs when initialization is successful.
aic7xxx.c: Remove a workaround for an aic7895 bug we will never trigger.
Add additional diagnostic info to ahc_dump_card_state().
Always panic the system if a sequencer assertion fails.
AHC_SCB_BTT is a "flag" not a "feature". Check the right field in the softc.
Replace a hard coded number with a constant.
Guard against looping forever in ahc_pause_and_flushwork(). A hot eject or card failure may make the intstat register return 0xFF, so limit the number of interrupts we'll process.
Correct the code in ahc_search_qinfifo() that guarantees that the sequencer will see an abort collision if the qinfifo is modified when a DMA is in progress. We now do this fixup after modifying the queue. This guarantees that the HSCB we place at the head of the queue is not the same as the old head. Using "next hscb" (guaranteed not to be the same as the first SCB) before clearing the queue could free up the original head hscb to be used during a remove operation placing it again at the head of the qinfifo.
aic7xxx.h: Reduce the maximum number of outstanding commands to 253 from 254. To handle our output queue correctly on machines that only support 32bit stores, we must clear the array 4 bytes at a time. To avoid colliding with a DMA write from the sequencer, we must be sure that 4 slots are empty when we write to clear the queue. This reduces us to 253 SCBs: 1 that just completed and the known three additional empty slots in the queue that preceed it. Yahoo was able to force this race on one of their systems. Interrupts were disabled for such a time that the entire output queue was filled (254 entries complete without any processing), and our 32bit write to clear the status clobbered one entry.
Add a feature tag for devices that are removable.
aic7xxx.reg: Never use the sequencer interrupt value of 0xF0. We need to guanrantee that an INTSTAT value of 0xFF can only occur during card failure or a hot-eject.
Align the busy targets table with the begining of scratch space. This seems to appease a chip bug in the aic7895.
aic7xxx.seq: Be sure to disable select-out after a bus free event that occurs early in a selection. If we don't disable select-out, we will believe that it is enabled even though a new selection will never occur.
Move the clearing of SELDI to just before a jump. This appeases another chip bug of the aic7895.
Make the target mode command loop a bit more efficient.
AHC_SCB_BTT is a "flag" not a "feature". Check the right field in the softc.
Properly cleanup the last SCB we tested against should we fail to properly find an SCB for a reselection.
Add some additional sequencer debugging code.
aic7xxx_freebsd.c: Limit the driver to 253 outstanding commands per adapter.
Guard against overflow in timeout handling.
aic7xxx_inline.h: AHC_SCB_BTT is a "flag" not a "feature". Check the right field in the softc.
aic7xxx_pci.c: Set the removable feature for the apa1480 cardbus and the 29160C Compact PCI card.
Don't report high byte termination information for narrow cards.
Use a PCI read rather than a questionable delay when fetching/setting termination settings.
|
70807 |
09-Jan-2001 |
gibbs |
Index our "DMA safe" sense buffers by SCB rather than hscb. hscbs may be traded during error recovery due to the way we manage the qinfifo. This has the effect of changing the index to the sense buffer even though the request sense command references the original buffer. SCBs don't play this swapping game and so serve as a more consistent reference.
|
70693 |
05-Jan-2001 |
gibbs |
aic7xxx.c: aic7xxx.h: First pass at big-endian support in the Core.
Capture state for second channel on TWIN channel adapters for suspend and resume.
aic7xxx_freebsd.h: Stubs for endian conversion functions. These will get filled out once we get an official kernel api for this kind of thing that is something more elegant and efficient than a bunch of manual swaps #ifdefed by platform.
aic7xxx_pci.c Allow the second channel of motherboard aic7896 chips to be attached. It turns out that the encoding of the subdevice id differs between PCI cards and MB based controllers and our check to see, via the subvendor id, if the second channel was "stuffed" always turned out negative.
|
70204 |
20-Dec-2000 |
gibbs |
ahc_eisa.c: ahc_pci.c: Add detach support.
Make use of soft allocated on our behalf by newbus.
For PCI devices, disable the mapping type we aren't using for extra protection from rogue code.
aic7xxx_93cx6.c: aic7xxx_93cx6.h: Sync perforce IDs.
aic7xxx_freebsd.c: Capture the eventhandle returned by EVENTHANDER_REGISTER so we can kill the handler off during detach.
Use AHC_* constants instead of hard coded numbers in a few more places.
Test PPR option state when deciding to "really" negotiate when the CAM_NEGOTIATE flag is passed in a CCB.
Make use of core "ahc_pause_and_flushwork" routine in our timeout handler rather than re-inventing this code.
Cleanup all of our resources (really!) in ahc_platform_free(). We should be all set to become a module now.
Implement the core ahc_detach() routine shared by all of the FreeBSD front-ends.
aic7xxx_freebsd.h: Softc storage for our event handler.
Null implementation for the ahc_platform_flushwork() OSM callback. FreeBSD doesn't need this as XPT callbacks are safe from all contexts and are done directly in ahc_done().
aic7xxx_inline.h: Implement new lazy interrupt scheme. To avoid an extra PCI bus read, we first check our completion queues to see if any work has completed. If work is available, we assume that this is the source of the interrupt and skip reading INTSTAT. Any remaining interrupt status will be cleared by a second call to the interrupt handler should the interrupt line still be asserted. This drops the interrupt handler down to a single PCI bus read in the common case of I/O completion. This is the same overhead as in the not so distant past, but the extra sanity of perforning a PCI read after clearing the command complete interrupt and before running the completion queue to avoid missing command complete interrupts added a cycle.
aic7xxx.c: During initialization, be sure to initialize all scratch ram locations before they are read to avoid parity errors. In this case, we use a new function, ahc_unbusy_tcl() to initialize the scratch ram busy target table.
Replace instances of ahc_index_busy_tcl() used to unbusy a tcl without looking at the old value with ahc_unbusy_tcl().
Modify ahc_sent_msg so that it can find single byte messages. ahc_sent_msg is now used to determine if a transfer negotiation attempt resulted in a bus free.
Be more careful in filtering out only the SCSI interrupts of interest in ahc_handle_scsiint.
Rearrange interrupt clearing code to ensure that at least one PCI transaction occurrs after hitting CLRSINT1 and writting to CLRINT. CLRSINT1 writes take a bit to take effect, and the re-arrangement provides sufficient delay to ensure the write to CLRINT is effective. The old code might report a spurious interrupt on some "fast" chipsets.
export ahc-update_target_msg_request for use by OSM code.
If a target does not respond to our ATN request, clear it once we move to a non-message phase. This avoids sending a MSG_NOOP in some later message out phase.
Use max lun and max target constants instead of hard-coded values.
Use softc storage built into our device_t under FreeBSD.
Fix a bug in ahc_free() that caused us to delete resources that were not allocated.
Clean up any tstate/lstate info in ahc_free().
Clear the powerdown state in ahc_reset() so that registers can be accessed.
Add a preliminary function for pausing the chip and processing any posted work.
Add a preliminary suspend and resume functions.
aic7xxx.h: Limit the number of supported luns to 64. We don't support information unit transfers, so this is the maximum that makes sense for these chips.
Add a new flag AHC_ALL_INTERRUPTS that forces the processing of all interrupt state in a single invokation of ahc_intr(). When the flag is not set, we use the lazy interrupt handling scheme.
Add data structures to store controller state while we are suspended.
Use constants instead of hard coded values where appropriate.
Correct some harmless "unsigned/signed" conflicts.
aic7xxx.seq: Only perform the SCSIBUSL fix on ULTRA2 or newer controllers. Older controllers seem to be confused by this.
In target mode, ignore PHASEMIS during data phases. This bit seems to be flakey on U160 controllers acting in target mode.
aic7xxx_pci.c: Add support for the 29160C CPCI adapter.
Add definitions for subvendor ID information available for devices with the "9005" vendor id. We currently use this information to determine if a multi-function device doesn't have the second channel hooked up on a board.
Add rudimentary power mode code so we can put the controller into the D0 state. In the future this will be an OSM callback so that in FreeBSD we don't duplicate functionality provided by the PCI code. The powerstate code was added after I'd completed my regression tests on this code.
Only capture "left over BIOS state" if the POWRDN setting is not set in HCNTRL.
In target mode, don't bother sending incremental CRC data.
|
70000 |
13-Dec-2000 |
marcel |
Fix include directories for crossbuilding.
aicasm is run on the build machine and therefore needs to be compiled and linked against the headers and libraries (resp) of the build machine. Since normally the default include directories are search after any specified on the command line, make sure we don't accidentally pick up machine dependent headers from the kernel compile directory by specifying /usr/include first.
This solves the (cross) build problem for ia64.
Approved by: gibbs
|
68660 |
13-Nov-2000 |
gibbs |
Don't attempt to reference a NULL scb_data area during teardown events occurring early in initialization. This fixes attachments to the parity engines that FreeBSD doesn't support.
|
68623 |
12-Nov-2000 |
gibbs |
aic7xxx.c: Shutdown the card when a catastrophic error occurs. This quenches any interrupts stemming from the card.
aic7xxx_inline.h: Return instead of processing additional interrupt state after handling a catastrophic error. We now shutdown the chip in this case in the hopes that the system can live without this controller. The shutdown process invalidates any other interrupt state.
aic7xxx.seq: Only attempt to clear SCSIBUSL on Ultra2 controllers. The clearing is workaround for a selection timeout bug on U2/U160 controllers and happens to be illegal on aic7770 (EISA/VL) controllers.
|
68579 |
10-Nov-2000 |
gibbs |
Sync Perforce IDs, add tranceiver state change support, and correct numerous error recovery buglets.
Many thanks to Tor Egge for his assistance in diagnosing problems with the error recovery code.
aic7xxx.c: Report missed bus free events using their own sequencer interrupt code to avoid confusion with other "bad phase" interrupts.
Remove a delay used in debugging. This delay could only be hit in certain, very extreme, error recovery scenarios.
Handle transceiver state changes correctly. You can now plug an SE device into a hot-plug LVD bus without hanging the controller.
When stepping through a critical section, panic if we step more than a reasonable number of times.
After a bus reset, disable bus reset interupts until we either our first attempt to (re)select another device, or another device attemps to select us. This removes the need to busy wait in kernel for the scsi reset line to fall yet still ensures we see any reset events that impact the state of either our initiator or target roles. Before this change, we had the potential of servicing a "storm" of reset interrupts if the reset line was held for a significant amount of time.
Indicate the current sequencer address whenever we dump the card's state.
aic7xxx.reg: Transceiver state change register definitions.
Add the missed bussfree sequencer interrupt code.
Re-enable the scsi reset interrupt if it has been disabled before every attempt to (re)select a device and when we have been selected as a target.
When being (re)selected, check to see if the selection dissappeared just after we enabled our bus free interrupt. If the bus has gone free again, go back to the idle loop and wait for another selection.
Note two locations where we should change our behavior if ATN is still raised. If ATN is raised during the presentation of a command complete or disconnect message, we should ignore the message and expect the target to put us in msgout phase. We don't currently do this as it requires some code re-arrangement so that critical sections can be properly placed around our handling of these two events. Otherwise, we cannot guarantee that the check of ATN is atomic relative to our acking of the message in byte (the kernel could assert ATN).
Only set the IDENTIFY_SEEN flag after we have settled on the SCB for this transaction. The kernel looks at this flag before assuming that SCB_TAG is valid. This avoids confusion during certain types of error recovery.
Add a critical section around findSCB. We cannot allow the kernel to remove an entry from the disconnected list while we are traversing it. Ditto for get_free_or_disc_scb.
aic7xxx_freebsd.c: Only assume that SCB_TAG is accurate if IDENTIFY_SEEN is set in SEQ_FLAGS.
Fix a typo that caused us to execute some code for the non-SCB paging case when paging SCBs. This only occurred during error recovery.
|
68578 |
10-Nov-2000 |
gibbs |
Sync perforce IDs.
|
68402 |
06-Nov-2000 |
gibbs |
aic7xxx.c: When restarting the sequencer, ensure that the SCBCNT register is 0. A non-zero count will prevent the setting of the CCSCBDIR bit in any future dma operations. The only time CCSCBCNT would be non-zero is if we happened to halt the dma during a reset, but even that should never happen. Better safe than sorry.
When a command completes before the target responds to an ATN for a recovery command, we now notify the kernel so that any recovery operation requeued in the qinfifo can be removed safely. In the past, we did this in ahc_done(), but ahc_done() may be called without the card paused. This also avoids a recursive call to ahc_search_qinifo() which could have occurred if ahc_search_qinififo() happened to be the routine to complete a recovery action.
Fix 8bit math used for adjusting the qinfifo. The index must be wrapped properly within the 256 entry array. We rely on the fact that qinfifonext is a uint8_t in most cases to handle this wrap, but we missed a few spots where the resultant calculation was promoted to an int.
Change the way that we deal with aborting the first or second entry from the qinfifo. We now swap the first entry in the qinfifo with the "next queued scb" to force the sequencer to see an abort collision if we ever touch the qinififo while the sequencer is mid SCB dma.
aic7xxx.reg: Add new MKMSG_FAILED sequencer interrupt. This displaced the BOGUS_TAG interrupt used in some previous sequencer code debugging.
aic7xxx.seq: Increment our position in the qinfifo only once the dma is complete and we have verified that the queue has not been changed during our DMA. This simplifies code in the kernel.
Protect against "instruction creep" when issuing a pausing sequencer interrupt. On at least the 7890/91/96/97, the sequencer will coast after issuing the interrupt for up to two instructions. In the past we delt with this by using carefully placed nops. Now we call a routine to issue the interrupt followed by a nop and a ret.
Tell the kernel should an SCB complete with the MK_MESSAGE flag still set. This means the target ignored our ATN request.
Clear the channel twice as we exit the data phase. On the aic7890/91, the S/G preload logic may require the second clearing to get the last S/G out of the FIFO.
aic7xxx_freebsd.c: Don't bother searching the qinfifo for a doubly queued recovery scb in ahc_done. This case is handled by the core driver now.
Free the path used to issue async callbacks after the callback is complete.
aic7xxx_inline.h: Split the SCB queue routine into a routine that swaps the SCB with the "next queued SCB" and a routine that calls the swapping routine and notifies the card of the new SCB. The swapping routine is now also used by ahc_search_qinfifo.
|
68088 |
31-Oct-2000 |
gibbs |
Generate bmov instructions for all move requests. The driver converts these to an equivalent 'and' operation on chips that don't support this opcode.
|
68087 |
31-Oct-2000 |
gibbs |
aic7xxx.c: Filter incoming transfer negotiation requests to ensure they never exceed the settings specified by the user.
In restart sequencer attempt to deal with a bug in the aic7895. If a third party reset occurs at just the right time, the stack register can lock up. When restarting the sequencer after handling the SCSI reset, poke SEQADDR1 before resting the sequencers program counter.
When something strange happens, dump the card's transaction state via ahc_dump_card_state(). This should aid in debugging.
Handle request sense transactions via the QINFIFO instead of attaching them to the waiting queue directly. The waiting queue consumes card SCB resources and, in the pathological case of every target on the bus beating our selection attemps and issuing a check condition, could have caused us to run out of SCBs. I have never seen this happen, and only early cards with 3 or 4 SCBs had any real chance of ever getting into this state.
Add additional sequencer interrupt codes to support firmware diagnostics. The diagnostic code is enabled with the AHC_DEBUG_SEQUENCER kernel option.
Make it possible to switch into and out of target mode on the fly. The card comes up by default as an initiator but will switch into target mode as soon as an enable lun operation is performed. As always, target mode behavior is gated by the AHC_TMODE_ENABLE kernel option so most users will not be affected by this change.
In ahc_update_target_msg_request(), also issue a new request if the ppr_options have changed.
Never issue a PPR as a target. It is forbidden by the spec.
Correct a bug in ahc_parse_msg() that prevented us from responding to PPR messages as a target.
Mark SCBs that are on the untagged queue with a flag instead of checking several fields in the SCB to see if the SCB should be on the queue. This makes it easier for things like automatic request sense requests to be queued without touching the untagged queues even though they are untagged requests.
When dealing with ignore wide residue messages that occur in the middle of a transfer, reset HADDR, not SHADDR for non-ultra2 chips. Although SHADDR is where the firmware fetches the ending transfer address for a save data pointers request, it is readonly. Setting HADDR has the side effect of also updating SHADDR.
Cleanup the output of ahc_dump_card_state() by nulling out the free scb list in the non-paging case. The free list is only used if we must page SCBs.
Correct the transmission of cdbs > 12 bytes in length. When swapping HSCBs prior to notifing the sequencer of the new transaction, the bus address pointer for the cdb must also be recalculated to reflect its new location. We now defer the calculation of the cdb address until just before queing it to the card.
When pulling transfer negotiation settings out of scratch ram, convert 5MHz/clock doubled settings to 10MHz.
Add a new function ahc_qinfifo_requeue_tail() for use by error recovery actions and auto-request sense operations. These operations always occur when the sequencer is paused, so we can avoid the extra expense incurred in the normal SCB queue method.
Use the BMOV instruction for all single byte moves on controllers that support it. The bmov instruction is twice as fast as an AND with an immediate of 0xFF as is used on older controllers.
Correct a few bugs in ahc_dump_card_state(). If we have hardware assisted queue registers, use them to get the sequencer's idea of the head of the queue. When enumerating the untagged queue, it helps to use the correct index for the queue.
aic7xxx.h:
Indicate via a feature flag, which controllers can take on both the target and the initiator role at the same time.
Add the AHC_SEQUENCER_DEBUG flag.
Add the SCB_CDB32_PTR flag used for dealing with cdbs with lengths between 13 and 32 bytes.
Add new prototypes.
aic7xxx.reg: Allow the SCSIBUSL register to be written to. This is required to fix a selection timeout problem on the 7892/99.
Cleanup the sequencer interrupt codes so that all debugging codes are grouped at the end of the list.
Correct the definition of the ULTRA_ENB and DISC_DSB locations in scratch ram. This prevented the driver from properly honoring these settings when no serial eeprom was available.
Remove an unused sequencer flag.
aic7xxx.seq: Just before a potential select-out, clear the SCSIBUSL register. Occasionally, during a selection timeout, the contents of the register may be presented on the bus, causing much confusion.
Add sequencer diagnostic code to detect software and or hardware bugs. The code attempts to verify most list operations so any corruption is caught before it occurs. We also track information about why a particular reconnection request was rejected.
Don't clobber the digital REQ/ACK filter setting in SXFRCTL0 when clearing the channel.
Fix a target mode bug that would cause us to return busy status instead of queue full in respnse to a tagged transaction.
Cleanup the overrun case. It turns out that by simply butting the chip in bitbucket mode, it will ack any bytes until the phase changes. This drasticaly simplifies things.
Prior to leaving the data phase, make sure that the S/G preload queue is empty.
Remove code to place a request sense request on the waiting queue. This is all handled by the kernel now.
Change the semantics of "findSCB". In the past, findSCB ensured that a freshly paged in SCB appeared on the disconnected list. The problem with this is that there is no guarantee that the paged in SCB is for a disconnected transation. We now defer any list manipulation to the caller who usually discards the SCB via the free list.
Inline some busy target table operations.
Add a critical section to protect adding an SCB to the disconnected list.
aic7xxx_freebsd.c: Handle changes in the transfer negotiation setting API to filter incoming requests. No filtering is necessary for "goal" requests from the XPT.
Set the SCB_CDB32_PTR flag when queing a transaction with a large cdb.
In ahc_timeout, only take action if the active SCB is the timedout SCB. This deals with the case of two transactions to the same device with different timeout values.
Use ahc_qinfifo_requeu_tail() instead of home grown version.
aic7xxx_inline.h: Honor SCB_CDB32_PTR when queuing a new request.
aic7xxx_pci.c: Use the maximum data fifo threshold for all chips.
|
67899 |
29-Oct-2000 |
phk |
Remove unneeded <stddef.h> #includes.
|
67888 |
29-Oct-2000 |
dwmalone |
Add the use of M_ZERO to some malloc calls.
Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Approved by: gibbs
|
67019 |
12-Oct-2000 |
gibbs |
Bring back the ability to send cdbs of length 13->32 bytes. This was lost during the qinfifo optimization. When swapping HSCBs, we were only copying the first 32 bytes, the amount used in the common case of a cdb <= 12 bytes. Larger cdbs are stored in the second 32 bytes of the cdb.
Noticed by: Marc Frajola <marc@terasolutions.com>
|
66986 |
11-Oct-2000 |
gibbs |
Store a pointer to our softc in the kernel's SCB structure. In the past we stored this data in the CCB and attained the CCB via a pointer in the SCB. In ahc_timeout(), however, the timedout SCB may have already been completed (inherent race), meaning that the CCB could have been recycled, and the ahc pointer reset.
Clean up the logic in ahc_search_qinfifo that deals with the busy device table. For some reason it assumed that the only valid time to search to see if additional lun entries should be checked was if lun 0 matched. Now we properly itterate through the necessary luns. The busy device table is used to detect invalid reselections, so a device would have had to perform an unexpected reselection for this to cause problems. Further, all luns are collapsed to a single entry unless we have external ram with large SCBs (3940AU models) so the chance of this happening was rather remote.
Clean up the logic for dealing with the untagged queues. We now set a flag in the SCB that indicates that it is on the untagged queue instead of inferring this from the type and setup of the CCB pased into us by CAM.
In ahc_timeout(), don't print the path of the SCB until the controller is paused and we are sure that it has not completed yet. This, in conjunction with referencing the ahc pointer in the SCB rather than the CCB in the SCB avoids panics in the case of a timedout scb completing just before the timeout handler runs. This turns out to be guaranteed if interrupt delivery is failing, as we run our interrupt handler to flush any "just missed events" when a timeout occurs. Mention the likelyhood of broken interrupts if a timedout SCB is completed by our call to ahc_intr().
|
66891 |
09-Oct-2000 |
gibbs |
Close a race condition that doesn't really exist in -current. When a resource shortage occurs, freeze our queue and then set the resource shortage flag while the controller data structure is locked. The old code did these in the wrong order potentially allowing our interrupt handler to release the queue and clear the flag before the freeze ever occurred.
|
66845 |
09-Oct-2000 |
gibbs |
Clean up error recovery code:
aic7xxx.c: In target mode, reset the TQINPOS on every restart of the sequencer. In the past we did this only during a bus reset, but there are other reasons the sequencer might be reset.
In ahc_clear_critical_section(), disable pausing chip interrupts while we step the sequencer out of a critical section. This avoids the possibility of getting a pausing interrupt (unexpected bus free, bus reset, etc.) that would prevent the sequencer from stepping.
Send the correct async notifications in the case of a BDR or bus reset.
In ahc_loadseq(), correct the calculation of our critical sections. In some cases, the sections would be larger than needed.
aic7xxx.h: Remove an unused SCB flag.
aic7xxx.seq: MK_MESSAGE is cleared by the kernel, there is no need to waste a sequencer instruction clearing it.
aic7xxx_freebsd.c: Go through the host message loop instead of issuing a single byte message directly in the ahc_timeout() case where we are currently on the bus to the device. The effect is the same, but this way we get a nice printf saying that an expected BDR was delivered instead of an unexpected bus free.
If we are requeuing an SCB for an error recovery action, be sure to set the DISCONNECTED flag in the in-core version of the SCB. This ensures that, in the SCB-paging case, the sequencer will still recognize the reselection as valid even if the version of the SCB with this flag set was never previously paged out to system memory. In the non-paging case, set the MK_MESSAGE flag in SCB_CONTROL directly.
aic7xxx_pci.c: Enable the Memeory Write and Invalidate bug workaround for all aic7880 chips with revs < 1. This bug is rarely triggered in FreeBSD as most transfers end on cache-aligned boundaries, but a recheck of my references indicates that these chips are affected.
|
66800 |
08-Oct-2000 |
gibbs |
Correct corruption of the qinfifo in ahc_search_qinififo() for all non-LVD controllers. We only need to take special action on the qinfifo if we have dectected the case of an SCB that has been removed from the qinfifo but has not been fully DMAed to the controller. A missing conditional caused this code to be executed every time an SCB was aborted from the queue
Don't attempt to print the path of an SCB that has been freed.
Clean up the traversal of the pending scb list in ahc_update_pending_syncrates(). This has no functional change.
Correct ahc_timeout()'s requeing of a timedout SCB to effect a recovery action. We now use ahc_qinfifo_requeue() and a new function ahc_qinfifo_count() instead of performing the requeue inline. The old code did not conform to the new qinfifo method.
Clear the timedout SCB from the disconnected list. This ensures that the SCB_NEXT field is free to be used for queuing us to the qinfifo.
|
66760 |
06-Oct-2000 |
gibbs |
Fix single character typo in legacy transfer settings function thereby re-enable tagged queuing.
|
66717 |
06-Oct-2000 |
gibbs |
Bring in a slew of fixes that were supposed to be in the last commit.
In ahc_search_qinfifo, the SEARCH_REMOVE case must also handle an SCB that has been removed from the QINFIFO but not yet been fully dmaed to the card.
Correct locking for ahc_get_scb() calls.
Set SCB syncrate settings in ahc_execute_scb() to avoid a race condition that could allow a newly queued SCB to be missed by ahc_update_pending_syncrates().
When notifying the system of transfer negotiation updates, only set the valid bits for tagged queuing and disconnection if the path is fully qualified. Sync/Wide settins apply to all luns of a target, but tagged queuing and disconnection may change on a per-lun basis.
Add missing ahc_unlock() calls in ahc_timeout() for the target mode case.
|
66648 |
05-Oct-2000 |
gibbs |
Correct pedantic errors in arrays generated by the assembler (trailing comma in array declarations).
Output a constant indicating the number of critical section entries in the firmware.
|
66647 |
05-Oct-2000 |
gibbs |
Convert the driver to use a single DMA for fetching new commands instead of two (one to access the circular input fifo, the other to get the SCB). This costs us a command slot so the driver can now only queue 254 simultaneous commands.
Have the kernel driver honor critical sections in sequencer code.
When prefetching S/G segments only pull a cacheline's worth but never less than two elements. This reduces the impact of the prefetch on the main data transfer when compared to the 128 byte fetches the driver used to do.
Add "bootverbose" logging for transfer negotiations.
Correct a bug in ahc_set_syncrate() that would prevent an update of the sync parameters if only the ppr_options had changed.
Correct locking for calls to ahc_free_scb(). ahc_free_scb() is no longer protected internally to simplify ports to other platforms.
Make sure we unfreeze our SIMQ if a resource shortage has occurred and an SCB is been freed.
ahc_pci.c: Turn on cacheline streaming for all controllers that support it.
Clarify diagnostic messages about PCI interrupts.
|
66510 |
01-Oct-2000 |
gibbs |
ahc_set_transaction_status() takes an SCB. This makes it difficult to use this helper function to report an error when SCB allocation fails.
|
66371 |
25-Sep-2000 |
gibbs |
Correct a logic mistake introduced in a recent cleanup of ahc_build_transfer_msg() that would cause use to fail to send the DT_REQ ppr_option in a PPR message for periods where DT transfers are required.
|
66270 |
22-Sep-2000 |
gibbs |
Add Perforce RCSIDs for easy revision correlation to my local tree.
Add support for constructing a table of critical section regions in the firmware image. The kernel driver will soon have support for single stepping the sequencer outside of a critical region prior to starting exception handling.
|
66269 |
22-Sep-2000 |
gibbs |
Add Perforce RCSIDs for easy revision correlation to my local tree.
ahc_pci.c: Bring back the AHC_ALLOW_MEMIO option at least until the memory mapped I/O problem on the SuperMicro 370DR3 is better understood.
aic7xxx.c: If we see a spurious SCSI interrupt, attempt to clear it and continue by unpausing the sequencer.
Change the interface to ahc_send_async(). Some async messages need to be broadcast to all the luns of a target or all the targets of a bus. This is easier to achieve by passing explicit channel, target, and lun parameters instead of attempting to construct a device info struct to match.
Filter the sync parameters for the PPR message in exactly the same way we do for an old fashioned SDTR message.
Correct some typos and correct a panic message.
Handle rejected PPR messages.
In ahc_handle_msg_reject(), let ahc_build_transfer_msg() build any additional transfer messages instead of doing this inline.
aic7xxx.h: Increase the size of both msgout_buf and msgin_buf to better accomodate PPR messages.
aic7xxx_freebsd.c: Update for change in ahc_send_async() parameters.
aic7xxx_freebsd.h Update for change in ahc_send_async() parameters.
Honor AHC_ALLOW_MEMIO.
aic7xxx_pci.c: Check the error register before going into full blown PCI interrupt handling. This avoids a few costly PCI configuration space reads when we run our PCI interrupt handler because another device sharing our interrupt line is more active than we are.
Also unpause the sequencer after processing a PCI interrupt.
|
66268 |
22-Sep-2000 |
gibbs |
Use quoted includes instead of full path references inside the aic7xxx sequencer files. Different platforms place the included files in different locations and it is easier to modify the include path passed as arguments to the assembler than adding #ifdef support to the assembler.
Remove a spurious 'nop' instruction.
|
66104 |
20-Sep-2000 |
gibbs |
Remove the last two uses of ahc->unit in the FreeBSD version of the driver. ahc->unit is depricated and will be going away as soon as the Linux driver catches up. In the FreeBSD case, it is always initialized to 0 and this caused some strangeness in registering multiple ahc controllers with CAM.
Noticed by: Tor.Egge@fast.no
|
65953 |
16-Sep-2000 |
gibbs |
Today is just not my day. Really get the right file.
|
65948 |
16-Sep-2000 |
gibbs |
Pull the correct file over to freefall.
|
65943 |
16-Sep-2000 |
gibbs |
Move aicasm to its own subdirectory.
|
65942 |
16-Sep-2000 |
gibbs |
Move aicasm to its own subdirectory.
Separate our platform independent hooks from core driver functionality shared between platforms (FreeBSD and Linux at this time).
Add sequencer workarounds for several chip->chipset interactions.
Correct external SCB corruption problem on aic7895 based cards (3940AUW).
Lots of cleanups resulting from the port to another OS.
|
65176 |
28-Aug-2000 |
dfr |
* Completely rewrite the alpha busspace to hide the implementation from the drivers. * Remove legacy inx/outx support from chipset and replace with macros which call busspace. * Rework pci config accesses to route through the pcib device instead of calling a MD function directly.
With these changes it is possible to cleanly support machines which have more than one independantly numbered PCI busses. As a bonus, the new busspace implementation should be measurably faster than the old one.
|
64248 |
04-Aug-2000 |
wpaul |
*smack* #if 0, not #ifdef 0.
|
64247 |
04-Aug-2000 |
wpaul |
The check_extport() function appears to have some new code in it that checks the scratch RAM for data normally found in the SEEPROM (presumably in the event that the SEEPROM is unavailable or can't be read). This code causes a spontaneous reboot on monster.osd.bsdi.com, which has an embedded aic7880 controller. The problem appears to happen either when it writes to the SCBPTR port and then reads from the SCB_CONTROL port. Somewhere during the inb/outb operations, the system has a heart attack and restarts.
This code looks very suspicious, particularly since it has unconditionalized debug mesages such as "Got here!" and "And it even worked!". With this block #ifdef'ed out, the machine boots and runs properly. I stronly suggest that it stay #ifdef'ed out until it's properly tested.
|
63944 |
27-Jul-2000 |
gibbs |
ahc_pci.c: Disable "cache line streaming" for aic7890/91 Rev A chips. I have never seen these chips fail using this feature, but some of Adaptec's regression tests have.
Explicitly set "cache line streaming" to on for aic7896/97 chips. This was happening before, but this documents the fact that these chips will not function correctly without CACHETHEEN set.
aic7xxx.h: Add new bug types.
Fix a typo in a comment.
aic7xxx.reg: Add a definition for the SHVALID bit in SSTAT3 for Ultra2/3 chips. This bit inicates whether the bottom most (current) element in the S/G fifo has exhausted its data count.
aic7xxx.seq: Be more careful in how we turn off the secondary DMA channel. Being less careful may hang the PCI bus arbitor that negotiates between the two DMA engines.
Remove an unecessary and incorrect flag set operation in the overrun case.
On Ultra2/3 controllers, clear the dma FIFO before starting to handle an overrun. We don't want any residual bytes from the beginning of the overrun to cause the code that shuts down the DMA engine from hanging because the FIFO is not (and never will be) empty.
If the data fifo is empty by the time we notice that a read transaction has completed, there is no need to hit the flush bit on aic7890/91 hardware that will not perform an auto-flush. Skip some cycles by short circuiting the manual flush code in this case.
When transitioning out of data phase, make sure that we have the next S/G element loaded for the following reconnect if there is more work to do. The code would do this in most cases before, but there was a small window where the current S/G element could be exhausted before our fetch of the next S/G element completed. Since the S/G fetch is already initiated at this point, it makes sense to just wait for the segment to arrive instead of incuring even more latency by canceling the fetch and initiating it later.
Fast path the end of data phase handling for the last S/G segment. In the general case, we might have worked ahead a bit by stuffing the S/G FIFO with additional segments. If we stop before using them all, we need to fixup our location in the S/G stream. Since we can't work past the last S/G segment, no fixups are ever required if we stop somewhere in that final segment.
Fix a little buglet in the target mode dma bug handler. We were employing the workaround in all cases instead of only for the chips that require it.
Fix the cause of SCB timeouts and possible "lost data" during read operations on the aic7890. When sending a data on any Ultra2/3 controller, the final segment must be marked as such so the FIFO will be flushed and cleaned up correctly when the transfer is ended. We failed to do this for the CDB transfer and so, if the target immediately transfered from command to data phase without an intervening disconnection, the first segment transferred would be any residual bytes from the cdb transfer. The Ultra160 controllers for some reason were not affected by this problem.
Many Thanks to Tor Egge for bringing the aic7890 problem to my attention, providing analysis, as well as a mechanism to reproduce the problem.
|
63854 |
25-Jul-2000 |
gibbs |
Properly handle the case where the residual is 0, but, as the target didn't bother to send a saved data pointers after the last transfer, is not recorded in sgptr. This was only a problem if the target reported non-zero status as we always check the residual in that case.
|
63821 |
24-Jul-2000 |
gibbs |
aic7xxx.c: Correct the BUILD_TCL macro. It was placing the target id in the wrong bits. This was only an issue for adapters that do not perform SCB paging (aha-3940AUW for instance).
Don't bother inlining ahc_index_busy_tcl. It is never used in a performance critical path and is a bit chunky.
Correct ahc_index_busy_tcl to deal with "busy target tables" embedded in the latter half of 64byte SCBs.
Don't initialize the busy target table to its empty state until after we have finished extracting configuration information from chip SRAM. In the common case of using 16 bytes of chip SRAM to do untagged target lookups, we were trashing the last 8 targets configuration data. (actually only target 8 because of the bug in the BUILD_TCL macro).
Cram the "bus reset delivered" message back under bootverbose.
Fix the cleanup of the SCB busy target table when aborting commands. If the lun is wildcarded, we must loop through all possible luns.
aic7xxx.h: Only bother supporting 64 luns right now. It doesn't seem like either this driver or any peripherals will be doing information unit transfers (where the lun number is a 32 bit integer) any time soon.
aic7xxx.seq: Fix support for the aic7895. We must flush the data FIFO if performing a manual transfer that is not a multiple of 8 bytes. We were doing this quite regularly for embedded cdbs.
Manaually flush the fifo on earlier adapters when dealing with embedded cdbs too. We were stuffing the FIFO with 16 bytes instead, but triggering the flush is more efficient and allows us to remove two instructions from the "copy_to_fifo" routine.
|
63457 |
18-Jul-2000 |
gibbs |
o Convert to <inttypes.h> style fixed sized types to facilitate porting to other systems.
o Normalize copyright text.
o Clean up probe code function interfaces by passing around a single structure of common arguments instead of passing "too many" args in each function call.
o Add support for the AAA-131 as a SCSI adapter.
o Add support for the AHA-4944 courtesy of "Matthew N. Dodd" <winter@jurai.net
o Correct manual termination support for PCI cards. The bit definitions for manual termination control in the SEEPROM were incorrect.
o Add support for extracting NVRAM information from SCB 2 for BIOSen that use this mechanism to pass this data to OS drivers.
o Properly set the STPWLEVEL bit in PCI config space based on the setting in an SEEPROM.
o Go back to useing 32byte SCBs for all controllers. The current firmware allows us to embed 12byte cdbs on all controllers in a 32byte SCB, and larger cdbs are rarely used, so it is a better use of this space to offer more SCBs (32).
o Add support for U160 transfers.
o Add an idle loop executed during data transfers that prefetches S/G segments on controllers that have a secondary DMA engine (aic789X).
o Improve the performance of reselections by avoiding an extra one byte DMA in the case of an SCB lookup miss for the reselecting target. We now keep a 16byte "untagged target" array on the card for dealing with untagged reselections. If the controller has external SCB ram and can support 64byte SCBs, then we use an "untagged target/lun" array to maximize concurrency. Without external SCB ram, the controller is limited to one untagged transaction per target, auto-request sense operations excluded.
o Correct the setup of the STPWEN bit in SXFRCTL1. This control line is tri-stated until set to one, so set it to one and then set it to the desired value.
o Add tagged queuing support to our target role implementation.
o Handle the common cases of the ignore wide residue message in firmware.
o Add preliminary support for 39bit addressing.
o Add support for assembling on big-endian machines. Big-endian support is not complete in the driver.
o Correctly remove SCBs in the waiting for selection queue when freezing a device queue.
o Now that we understand more about the autoflush bug on the aic7890, only use the workaround on devices that need it.
o Add a workaround for the "aic7890 hangs the system when you attempt to pause it" problem. We can now pause the aic7890 safely regardless of what instruction it is executing.
|
61686 |
14-Jun-2000 |
alex |
Fix typo (accessable --> accessible).
PR: 18588 Submitted by: Anatoly Vorobey <mellon@pobox.com> Reviewed by: asmodai
|
61486 |
10-Jun-2000 |
peter |
Unused include: #include "ahc.h"
|
61034 |
28-May-2000 |
peter |
Use the correct register names, not the FreeBSD 2.2 compatability ones.
|
60983 |
27-May-2000 |
obrien |
Use /sys/sys/*.h over /usr/include/sys.
No repsonce from: Maintainer
|
60938 |
26-May-2000 |
jake |
Back out the previous change to the queue(3) interface. It was not discussed and should probably not happen.
Requested by: msmith and others
|
60833 |
23-May-2000 |
jake |
Change the way that the queue(3) structures are declared; don't assume that the type argument to *_HEAD and *_ENTRY is a struct.
Suggested by: phk Reviewed by: phk Approved by: mdodd
|
59368 |
18-Apr-2000 |
phk |
Remove unneeded <sys/buf.h> includes.
Due to some interesting cpp tricks in lockmgr, the LINT kernel shrinks by 924 bytes.
|
58258 |
18-Mar-2000 |
gibbs |
o Correct the offsets into the syncrate table for paritcular negotiation features (DT, ULTRA2, ULTRA, FAST). The offsets where not properly updated when the DT entry was added and so the driver could attempt to negotiate a speed faster than that supported by the target device or even requested by the user via SCSI-Select settings. *
o Update the target mode incoming command queue kernel index value ever 128 commands instead of 32. This means that the kernel will always try to keep its index (as seen on the card - the kernel may actually have cleared more space) 128 commands ahead of where the sequencer is adding entries.
o Use the HS_MAILBOX register instead of the KERNEL_TQINPOS location in SRAM to indicate the kernel's target queue possition on Ultra2 cards. This avoids the "pause bug" on these cards and also turns out to be much more efficient.
o When enabling or disabling a particular target id for target mode, make sure that the taret id in the SCSIID register does not reference an ID that is not to receive target selections. This is only an issue on chips that support the multiple target id feature where the value in SCSIID will still affect selection behavior regardless of the values in the target id bit field registers.
o Remove some target mode debugging printfs.
o Make sure that the sense length reported in ATIO commands is always zero. This driver does not, yet, report HBA generated sense information for accepted commands.
o Honor the CAM_TIME_INFINITY and CAM_TIME_DEFAULT values for the CCB timeout field.
o Make the driver compile with AHC_DEBUG again.
* Noticed by: Andrew Gallatin<gallatin@cs.duke.edu>
|
58253 |
18-Mar-2000 |
gibbs |
KNR -> ANSI function definition in two places. This matches the rest of the code in this driver.
|
57259 |
16-Feb-2000 |
gibbs |
Remove a diagnostic printf.
Noticed by: imp@FreeBSD.org
|
57099 |
09-Feb-2000 |
gibbs |
Kill the "unpause_always" argument to unpause_sequencer(). The reasons for optimizing the unpause operation no-longer exist, and this is much safer.
When restarting the sequencer, reconstitute the free SCB list on the card. This deals with a single instruction gap between marking the SCB as free and actually getting it onto the free list.
Reduce the number of transfer negotiations that occur. In the past, we renegotiated after every reported check condition status. This ensures that we catch devices that have unexpectidly reset. In this situation, the target will always report the check condition before performing a data-phase. The new behavior is to renegotiate for any check-condition where the residual matches the orginal data-length of the command (including 0 length transffers). This avoids renegotiations during things like variable tape block reads, where the check condition is reported only to indicate the residual of the read.
Revamp the parity error detection logic. We now properly report and handle injected parity errors in all phases. The old code used to hang on message-in parity errors.
Correct the reporting of selection timeout errors to the XPT. When a selection timeout occurs, only the currently selecting command is flagged with SELTO status instead of aborting all currently active commands to that target.
Fix flipped arguments in ahc_match_scb and in some of the callers of this routine. I wish that gcc allowed you to request warnings for enums passed as ints.
Make ahc_find_msg generically handle all message types.
Work around the target mode data-in wideodd bug in all non-U2 chips. We can now do sync-wide target mode transfers in target mode across the hole product line.
Use lastphase exclusively for handling timeouts. The current phase doesn't take the bus free state into account.
Fix a bug in the timeout handler that could cause corruption of the disconnected list.
When sending an embedded cdb to a target, ensure that we start on a quad word boundary in the data-fifo. It seems that unaligned stores do not work correctly.
|
57097 |
09-Feb-2000 |
gibbs |
Fix parity error detection logic for aic7880 and aic7895 chips during the probe of external SRAM.
Approved by: jkh@FreeBSD.org
|
56980 |
03-Feb-2000 |
gibbs |
Update copyright license terms to match the reset of the aic7xxx dirver.
|
56823 |
29-Jan-2000 |
peter |
remove #include "eisa.h" and #if NEISA > 0 - this is guaranteed by config since ahc_eisa.c is "optional ahc eisa" meaning "only compile ahc_eisa if ahc and eisa are defined"
|
55953 |
14-Jan-2000 |
peter |
Pre 4.0 tidy up.
Collect together the components of several drivers and export eisa from the i386-only area (It's not, it's on some alphas too). The code hasn't been updated to work on the Alpha yet, but that can come later.
Repository copies were done a while ago. Moving these now keeps them in consistant place across the 4.x series as the newbusification progresses.
Submitted by: mdodd
|
55699 |
10-Jan-2000 |
gibbs |
Avoid setting DPARCKEN until I can figure out why it causes spurious parity errors on some controllers.
|
55587 |
08-Jan-2000 |
gibbs |
Turn on parity error reporting before configuring external sram. This makes it a little easier to notice that parity checking an 8bit sram isn't working.
Turn on scb and internal data-path parity checking for all pci chips types. We were only doing this for ultra2 chips.
After clearing the parity interrupt status, clear the BRKADRINT. This avoids seeing a bogus BRKADRINT interrupt after external SCB probing once normal interrupts are enabled.
|
55582 |
08-Jan-2000 |
gibbs |
Really enable external SCB ram on Ultra2 capable controllers.
Don't even bother to look for SCB ram on controllers < aic7870.
Clear any parity errors generated by looking at external SCB ram.
|
55581 |
07-Jan-2000 |
gibbs |
Update copyrights to Y2K.
93cx6.c: Make the SRAM dump output a little prettier.
aic7xxx.c: Store all SG entries into our SG array in kernel space. This makes data-overrun and other error reporting more useful as we can dump all SG entries. In the past, we only stored the SG entries that the sequencer might need to access, which meant we skipped the first element that is embedded into the SCB.
Add a table of chip strings and replace ugly switch statements with table lookups.
Add a table with bus phase strings and message reponses to parity errors in those phases. Use the table to pretty print bus phase messages as well as collapse another switch statement.
Fix a bug in target mode that could cause us to unpause the sequencer early in bus reset processing.
Add the 80MHz/DT mode into our syncrate table. This rate is not yet used or enabled.
Correct some comments, clean up some code...
aic7xxx.h: Add U160 controller feature information.
Add some more bit fields for various SEEPROM formats.
aic7xxx.reg: Add U160 register and register bit definitions.
aic7xxx.seq: Make phasemis state tracking more straight forward. This avoids the consumption of SINDEX which is a very useful register.
For the U160 chips, you must use the 'mov' instruction to update DFCNTRL. Using 'or' to set the PRELOADED bit is completely ineffective.
At the end of the command phase, wair for our ACK signal to de-assert before disabling the SCSI dma engine. For slow devices, this avoids clearing the ACK before the other end has had a chance to see it and lower REQ.
|
55580 |
07-Jan-2000 |
gibbs |
Add detection logic for the U160 family of adaptec controllers. These controllers will run at U2 speeds until I can complete the U160 support for this driver.
Correct a termination buglet for the 2940UW-Pro.
Be more paranoid in how we probe and enable external ram, fast external ram timing and external ram parity checking. We should now work on 20ns and 8bit SRAM parts.
Perform initial setup for the DT feature on cards that support it.
Factorize and clean up code. Use tables where it makes sense, etc.
Add some delays in dealing with the board control logic. I've never seen this code fail, but with the ever increasing speed of processors, its better to insert deterministic delays just to be safe. This stuff is only touched during probe and attach, so the extra delay is of no concern.
|
55205 |
29-Dec-1999 |
peter |
Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come.
|
54922 |
20-Dec-1999 |
gibbs |
Correct an "argument reversal" bug that could cause commands requed from the input fifo to be returned as successful and frozen. Most, if not all, peripheral drivers do not check the qfrozen bit for successfully completed commands, so the result would not only be lost commands, but devices locked out from receiving commands. This was a bad bug that crept in two or three months ago during some target mode work.
|
54472 |
12-Dec-1999 |
gibbs |
When booting verbose, indicate if we are using manual termination settings for U2 cards.
Don't assume that all aic7859 cards are 2930CUs.
|
54213 |
06-Dec-1999 |
gibbs |
Simplify my license.
Don't arbitrarily limit the initiator ID of the card to something <= 7.
Fix a bug in the checksum code that would incorrectly prevent a valid checksum of zero. (cp)
Don't touch rely on seeprom data when configuring termination. We may not have seeprom data. (cp)
Treat all ULTRA2 capable adapters the same way when reading or writing the BRDCTL register. We previously only did this correctly for aic7890/91 chips. This should correct some problems with termination settings on aic7896/97 adapters. (cp)
Changes marked with "(cp)" Pointed out by: Chuck Paterson <cp@bsdi.com>
|
54211 |
06-Dec-1999 |
gibbs |
Simplify my copyright license terms.
aic7xxx.c: Add a function for sucking firmware out of the controller prior to reset.
Remove some inline bloat from functions that should not have been inlined.
During initialization, wait 1ms after the chip reset before touching any registers. You can get machine checks on certain architectures (Atari I think?) without the delay.
Return CAM_REQ_CMP for external BDR requests instead of CAM_BDR_SENT.
Bump some messages to bootverbose levels above 1.
Don't clear any negotiated sync rate if the target rejects a WDTR message. The sync rate is only cleared if the target accepts a WDTR message.
Fix a small bug in the mesgin handling code that could cause us to believe that we had recieved a message that was actually received by another target. This could only confuse us in some very rare transmission negotiation scenarios.
Remove some unecessary cleanup of residual information after a residual is reported. The sequencer does this when the command is queued now.
|
51472 |
20-Sep-1999 |
gibbs |
Clear the SELINGO bit after a selection timeout occurs. SELINGO is usually cleared by a successful selection, but there is no guarantee that a future successful selection will ever occur (e.g. empty bus). The driver never looks at SELINGO, but the busy LED does, so this change has the cosmetic effect of fixing the rare instance where the busy LED was left on, confusing the user.
|
51471 |
20-Sep-1999 |
gibbs |
Work around a defect in the FIFOEMP status bit of Ultra2 class aic7xxx parts. This problem could result in data corruption during periods of my PCI bus load by busmasters other than the aic7xxx.
Many thanks to Andrew Gallatin <gallatin@cs.duke.edu> for characterizing the symptoms of this problem and testing this fix.
|
51235 |
13-Sep-1999 |
ken |
Get rid of a stray printf on boot. (BRDCTL = ...)
Approved by: gibbs
|
50662 |
30-Aug-1999 |
gibbs |
aic7xxx.c: Clean out some #if 0'ed debugging cruft.
aic7xxx.h: Definitions for the aic7855 and aic7859.
|
50661 |
30-Aug-1999 |
gibbs |
Add support for the aic7859 which is found on the 2930CU.
Break out the detection logic for the aic7855 and properly report these chips as 7855s instead of 7850s.
The 2940AU_CN is an aic7860 based card, not aic7860.
Not setting CACHETHEN turned out to be a bad idea. It can cause spurious corruption under heavy PCI load with multiple masters.
|
50477 |
28-Aug-1999 |
peter |
$Id$ -> $FreeBSD$
|
50221 |
23-Aug-1999 |
peter |
Disable some apparently stray debug printfs: ahc0: <Adaptec 274X SCSI host adapter> at 0x1c00-0x1cff, irq 11 (edge) ahc0: on eisa0 slot 1 ahc0: aic7770 >= Rev E, SBLKCTL = 0x8 SSTAT0 = 0x0 SFUNCT = 0x0 Twin Channel, A SCSI Id=7, B SCSI Id=7, primary A, 4/255 SCBs
Not objected to by: gibbs
|
50107 |
21-Aug-1999 |
msmith |
Implement a new generic mechanism for attaching handler functions to events, in order to pave the way for removing a number of the ad-hoc implementations currently in use.
Retire the at_shutdown family of functions and replace them with new event handler lists.
Rework kern_shutdown.c to take greater advantage of the use of event handlers.
Reviewed by: green
|
49934 |
16-Aug-1999 |
gibbs |
Differentiate between aic7895C chips and their earlier brethren via the PCI revid register.
|
49933 |
16-Aug-1999 |
gibbs |
Add support for issuing immediate notify event ccbs for bus resets, bdr messages, abort messages, and abort tag messages.
Fix a bug in how default transfer negotiations are handled if the user had disabled initial bus resets.
Support multi-targetid on the aic7895C.
|
49932 |
16-Aug-1999 |
gibbs |
Kill an unused INTSTAT type.
|
49931 |
16-Aug-1999 |
gibbs |
Fix a few compiler nits.
Submitted by: Bill Fumerola <billf@jade.chc-chimes.com>
|
49863 |
16-Aug-1999 |
gibbs |
Fix a long standing bug in the auto-termination control settings for the aic7890/91/96/97 cards. This could cause the system to go into a long retry/recovery loop during probe.
Fix the alignment argument to bus_dma_tag_create().
Don't set the CACHETHEN bit in dscommand0 for Ultra2 controllers until we know more about its behavior. The description for this bit makes it sound like it could cause problems with certain PCI chipsets.
|
49860 |
16-Aug-1999 |
gibbs |
Properly set the alignment argument to bus_dma_tag_create(). If we don't care about the alignment, set it to 1, meaning single byte alignment.
|
49360 |
01-Aug-1999 |
mdodd |
Move the specification of EDGE/LEVEL triggered interrupts to eisa_add_intr() which now takes an additional arguement (one of EISA_TRIGGER_LEVEL or EISA_TRIGGER_EDGE).
The flag RR_SHAREABLE has no effect when passed to bus_alloc_resource(dev, SYS_RES_IRQ, ...) in an EISA device context as the eisa_alloc_resource() call (bus_alloc_resource method) now deals with this flag directly, depending on the device ivars.
This change does nothing more than move all the 'shared = inb(foo + iobsse)' nonesense to the device probe methods rather than the device attach.
Also, print out 'edge' or 'level' in the IRQ announcement message.
Reviewed by: dfr
|
48528 |
03-Jul-1999 |
peter |
Eliminate a bunch of #include "pci.h" and #if NPCI > 0 around entire files. config will leave the whole file out if configured to do so.
|
47525 |
26-May-1999 |
gibbs |
Ignore subvendor and subdevice ids for all ai7880 parts. These chips only support 'mirroring' the vendor and device ids, so we don't lose any information. Certain revisions of the aic7880 will not perform the mirroring so to match all possiblities would double the number of table entries. This change also allows us to match things like the 2944B which I missed in the original table.
|
47507 |
25-May-1999 |
gibbs |
Turn the 'dump eeprom' flag into a real option.
|
47505 |
25-May-1999 |
gibbs |
All cards using aic789X chips use the new eeprom format. Corrects bogus negotiation values on aic7890 based controllers.
PR: 11872
|
47433 |
23-May-1999 |
gibbs |
Don't reference our SCB until we have validated that the firmware has returned an SCB that is in range.
|
47414 |
22-May-1999 |
gibbs |
aic7xxx.c: Honor the 'bus reset at startup' option now that the XPT properly handles transfer negotiation in this scenario.
Honor the sync rate settings on Ultra2 controllers. We would always negotiate at the fastest speed. Oops.
aic7xxx.h: Whitespace.
aic7xxx.seq: Fix a minor nit that would cause the controller to miss the update of the negotiation required bitmask causing the negotiation to be delayed by a command.
|
47287 |
18-May-1999 |
gibbs |
Correct a bug where the chip could be unpaused in the middle of a bus or device reset error recovery operation.
|
47277 |
17-May-1999 |
gibbs |
Correct the comment for the last commit.
Clean up the handling of failure modes in our attach so we don't free resources twice. ahc_free() will do all of the work for us (as would be required by an unload event) so we only need to handle resources that the softc has not taken ownership of.
|
47276 |
17-May-1999 |
gibbs |
Update copyright. Correct some whitespace.
|
47275 |
17-May-1999 |
gibbs |
Add a masking scheme to allow for detection of unknown cards using a chip we think we understand.
Correct identification entry for the AHA2950U2.
|
47274 |
17-May-1999 |
gibbs |
Fix whitespace. Correct a comment.
|
47192 |
14-May-1999 |
gibbs |
Use a lookup table for device matching instead of a switch on a 64bit value. EGCS generates poor code for sparse switch statements on 64bit values.
Requested by: bde
|
47159 |
14-May-1999 |
gibbs |
Take the subvendor and subdevice ids into account during device probe. Sync up device Ids with the master Adaptec list.
Add probe support for the 2940 Pro although it isn't obvious that all of the termination support is correct for this adapter yet.
|
47158 |
14-May-1999 |
gibbs |
Better workaround for aic7890 chip bug. Use the HS_MAILBOX register to tell the sequencer to pause itself for a target msg variable update. This avoids the pause race entirely as HS_MAILBOX can be accessed without pausing the chip.
3.2 Merge candidate.
|
46743 |
08-May-1999 |
dfr |
Move the declaration of the interrupt type from the driver structure to the BUS_SETUP_INTR call.
|
46581 |
06-May-1999 |
ken |
Add a number of interrelated CAM feature enhancements and bug fixes.
NOTE: These changes will require recompilation of any userland applications, like cdrecord, xmcd, etc., that use the CAM passthrough interface. A make world is recommended.
camcontrol.[c8]: - We now support two new commands, "tags" and "negotiate".
- The tags commands allows users to view the number of tagged openings for a device as well as a number of other related parameters, and it allows users to set tagged openings for a device.
- The negotiate command allows users to enable and disable disconnection and tagged queueing, set sync rates, offsets and bus width. Note that not all of those features are available for all controllers. Only the adv, ahc, and ncr drivers fully support all of the features at this point. Some cards do not allow the setting of sync rates, offsets and the like, and some of the drivers don't have any facilities to do so. Some drivers, like the adw driver, only support enabling or disabling sync negotiation, but do not support setting sync rates.
- new description in the camcontrol man page of how to format a disk - cleanup of the camcontrol inquiry command - add support in the 'devlist' command for skipping unconfigured devices if -v was not specified on the command line. - make use of the new base_transfer_speed in the path inquiry CCB. - fix CCB bzero cases
cam_xpt.c, cam_sim.[ch], cam_ccb.h:
- new flags on many CCB function codes to designate whether they're non-immediate, use a user-supplied CCB, and can only be passed from userland programs via the xpt device. Use these flags in the transport layer and pass driver to categorize CCBs.
- new flag in the transport layer device matching code for device nodes that indicates whether a device is unconfigured
- bump the CAM version from 0x10 to 0x11
- Change the CAM ioctls to use the version as their group code, so we can force users to recompile code even when the CCB size doesn't change.
- add + fill in a new value in the path inquiry CCB, base_transfer_speed. Remove a corresponding field from the cam_sim structure, and add code to every SIM to set this field to the proper value.
- Fix the set transfer settings code in the transport layer.
scsi_cd.c:
- make some variables volatile instead of just casting them in various places - fix a race condition in the changer code - attach unless we get a "logical unit not supported" error. This should fix all of the cases where people have devices that return weird errors when they don't have media in the drive.
scsi_da.c:
- attach unless we get a "logical unit not supported" error
scsi_pass.c:
- for immediate CCBs, just malloc a CCB to send the user request in. This gets rid of the 'held' count problem in camcontrol tags.
scsi_pass.h:
- change the CAM ioctls to use the CAM version as their group code.
adv driver:
- Allow changing the sync rate and offset separately.
adw driver
- Allow changing the sync rate and offset separately.
aha driver:
- Don't return CAM_REQ_CMP for SET_TRAN_SETTINGS CCBs.
ahc driver:
- Allow setting offset and sync rate separately
bt driver:
- Don't return CAM_REQ_CMP for SET_TRAN_SETTINGS CCBs.
NCR driver:
- Fix the ultra/ultra 2 negotiation bug - allow setting both the sync rate and offset separately
Other HBA drivers: - Put code in to set the base_transfer_speed field for XPT_GET_TRAN_SETTINGS CCBs.
Reviewed by: gibbs, mjacob (isp), imp (aha)
|
46099 |
26-Apr-1999 |
ken |
Fix from Justin for transfer negotiations for targets up to target ID 7.
|
45969 |
23-Apr-1999 |
gibbs |
ahc_pci.c: Convert to new bus and bus dma. Use latest PCI API.
bt_pci.c: Fix a few bugs in how resourses are released left over from when this driver was converted to new bus.
|
45967 |
23-Apr-1999 |
gibbs |
ahb.c: Synchronize malloc types for our softc.
ahc_eisa.c: Sync to aic7xxx driver bus dma and new bus changes.
|
45965 |
23-Apr-1999 |
gibbs |
Complete conversion to bus dma. This driver now works on the alpha.
aicasm_symbol.c: Correct an unaligned access problem. You can't rely on DB to store your data in an aligned fashion.
|
45847 |
19-Apr-1999 |
gibbs |
Preserve termination settings across the card reset in our shutdown hook.
|
45791 |
18-Apr-1999 |
peter |
Implement an EISA new-bus framework. The old driver probe mechanism had a quirk that made a shim rather hard to implement properly and it was just easier to convert the drivers in one go. The changes to the buslogic driver go beyond just this - the whole driver was new-bus'ed including pci and isa. I have only tested the EISA part of this so far.
Submitted by: Doug Rabson <dfr@nlsystems.com>
|
45445 |
07-Apr-1999 |
gibbs |
Correct an invalid (and unused) #define in 93cx6.c
Freeze the transaction queue for any type of scsi status other than "okay".
|
44967 |
23-Mar-1999 |
gibbs |
Add support for the 3950U2B controller.
Recognize aic7895 controllers that have been "acquired" by a RAIDPort card as normal aic7895s.
Recognize the aic7815 Raid Parity/Memory controller chip and notify the user that it's RAID functionality will be ignored.
|
44966 |
23-Mar-1999 |
gibbs |
Use TCL_CHANNEL/SCSI_ID/etc. macros in more locations.
Don't mess with the IRQMS bit in the host control register unless we are an aic7770 chip.
Use calling context to determine if the card is already paused when we update the target message request bit field in controller scratch ram. Looking at the paused bit in the HCNTRL register opened up a race condition.
Insert delays in the target message request update routine as a temporary work around for what looks like a chip bug. I'm still investigating this one.
Fix the Abort/Abort Tag/BDR handler to pull its message from the message buffer in our softc instead of attempting to get it from a register on the controller. The message is never recorded by the controller in the new message scheme.
Don't rely on having an SCB when a BDR occurs. We can issue these during invalid reconnects to.
Fix a few cases where we were restarting the sequencer but then still falling out of a switch statement to unpause the sequencer again. This could cause us to mess up sequencer state if it generated another pausing interrupt between the time of the restart and unpause.
Kill the 'transceiver settle' loop during card initialization. I failed to realize that a controller that is not connected to any cables will never settle or enable the SCSI transceivers at all. The correct solution is to monitor the IOERR interrupt which indicates that the transceiver state has changed (UW<->LVD).
Modify the aic7xxx assembler to properly echo input when stdin is not a tty.
|
44590 |
08-Mar-1999 |
gibbs |
Clean up and order register definitions.
|
44589 |
08-Mar-1999 |
gibbs |
Add necessary splcam() protection around target mode setup and teardown routines as well as card access that occurs for the AC_LOST_DEVICE async event.
|
44507 |
05-Mar-1999 |
gibbs |
Keep track of negotiated transfer parameters for each initiator<->target connection.
Clean up support for devices featuring the multiple target SCSI ID feature. On aic7890/91/96/97 chips, we can now assume the target role on multiple target ids simultaneously. Although these chips also have sufficient instruction space to hold to support the initiator and target role at the same time, the initiator role is currently disabled as it will conflict (chip design restriction) with the multi-tid feature. I'll probably add a nob to enable the initiator (there-by disabling multi-tid) some time in the future.
Return queue full or busy, depending on the tagged nature of the incoming request, if our command input queue fills up in host memeory.
Deal with accept target I/O resource shortages.
If we get an underrun on a transaction that wasn't supposed to transmit any data, don't attempt to print out the S/G list. The code would run until hitting a non-present page. (oops)
|
44506 |
05-Mar-1999 |
gibbs |
Modify to deal with changes in the storage of user negotiation settings.
|
44505 |
05-Mar-1999 |
gibbs |
Add untested code to support the aha2930U2W.
Modify to deal with changes in the storage of user negotiation settings.
|
43882 |
11-Feb-1999 |
gibbs |
Set the ultra enable bits in the adaptor's scratch ram area only after we finish modifying our in kernel version during seeprom configuration.
|
43880 |
11-Feb-1999 |
gibbs |
Ensure that the ACK from the last information transfer phase has been de-asserted by the initiator before changing phase or releasing the bus. Corrects a SCSI specification violation in target mode.
|
43878 |
11-Feb-1999 |
gibbs |
Correct a race condition where a target mode SCB dma could occur before we finished setting the pending phase information.
Use the ALL_TARGETS_MASK #define instead of 0xffff for the default ultraenb mask.
|
42762 |
17-Jan-1999 |
peter |
"fix" long standing aicasm build glitch. The problem was the reorganization in rev 1.16 of i386/include/types.h which changed stdlib.h's use of <machine/types.h>. The problem was the -I. was causing machine/types.h to come from the current kernel source, while stdlib.h was coming from /usr/include. /usr/include/stdlib.h is as old as the last 'make world', the machine/types.h was as new as the current source.
|
42708 |
15-Jan-1999 |
gibbs |
Add two missing break statements.
|
42652 |
14-Jan-1999 |
gibbs |
Add support for routing initiator transactions to disabled luns to the black hole device. The controller will now only accept selections if the black hole device is present and some other target/lun is enabled for target mode.
Handle the IGNORE WIDE RESIDUE message. This support has not been tested.
Checkpoint work on handling ABORT, BUS DEVICE RESET, TERMINATE I/O PROCESS, and CLEAR QUEUE messages as a target.
Fix a few problems with tagged command handling in target mode.
Wait until the sync offset counter falls to 0 before changing phase after a data-in transfer completes as the DMA logic seems to indicate transfer complete as soon as our last REQ is issued.
Simplify some of the target mode message handling code in the sequencer.
|
41887 |
17-Dec-1998 |
gibbs |
Fix a few problems with handling rejected transfer negotiation messages.
Use the host message loop for any unknown message types instead of performing a reject message in the sequencer. Pass reject messages to the host message loop too which frees up a sequencer interrupt type slot.
Default to issuing a bus reset if initiator mode is enabled. It seems that the reset scsi bus bit is not defined in the same location for all aic78xx BIOSes, so attempting to honor this setting will have to wait until I get more information on how to detect it.
Nuke some unused variables.
|
41817 |
15-Dec-1998 |
gibbs |
Pull in new ccb_hdr list types.
|
41816 |
15-Dec-1998 |
gibbs |
Perform a save data pointers operation if a data transfer was performed in target mode, but we are not completing the command.
Use a template of allowed bus arbitration phases to selectively and dynamically enable/disable initiator or target (re)selection.
Properly handle timeouts for target role transactions - just go to the bus free state and report the error to the peripheral driver.
Checkpoint support for the XPT_ABORT_CCB function code. This currently handles the accept tio and immediate notify ccb types, but does not handle the continue target I/O or SCSI I/O ccb types. This is enough to handle dynamic target enable/disable events.
Clean up the SCSI reset code so that we perform at most 1 SCSI bus reset at initialization, the reset requested by the XPT layer.
|
41766 |
14-Dec-1998 |
dillon |
pci_device pd_probe function changed from returning char * to returning const char *. Originally I was going to add casts from const char * to char * in some of the pci device drivers, but the reality is that the pci device probes return constant quoted strings.
|
41646 |
10-Dec-1998 |
gibbs |
Revamp the way that exceptional message handling is performed so that it is more robust and common code can be used for both the target and iniator roles. The mechanism for tracking negotiation state has also been simplified.
Add support for sync/wide negotiation in target mode and fix many of the target mode bugs running at higher speeds uncovered. Make a first stab at getting all of the bus skew delays correct. Sync+Wide dataout transfers still cause problems, but this may be an initiator problem.
Ensure that we exit BITBUCKET mode if the controller is restarted.
Add support for target mode only firmware downloads. This has been tested on the aic7880, but should mean that we can perform target mode on any aic7xxx controller. Mixed mode (initiator and target roles in the same firmware load) is currently only supported on the aic7890, but with optimization, may fit on chips with less instruction space.
|
41591 |
07-Dec-1998 |
archie |
The "easy" fixes for compiling the kernel -Wunused: remove unreferenced static and local variables, goto labels, and functions declared but not defined.
|
41514 |
04-Dec-1998 |
archie |
Examine all occurrences of sprintf(), strcat(), and str[n]cpy() for possible buffer overflow problems. Replaced most sprintf()'s with snprintf(); for others cases, added terminating NUL bytes where appropriate, replaced constants like "16" with sizeof(), etc.
These changes include several bug fixes, but most changes are for maintainability's sake. Any instance where it wasn't "immediately obvious" that a buffer overflow could not occur was made safer.
Reviewed by: Bruce Evans <bde@zeta.org.au> Reviewed by: Matthew Dillon <dillon@apollo.backplane.com> Reviewed by: Mike Spengler <mks@networkcs.com>
|
41299 |
23-Nov-1998 |
gibbs |
Change the delivery mechanism for incoming target commands. We now use a 256 entry ring buffer of descriptersfor this purpose. This allows the use of a simple 8bit counter in the sequencer code for tracking start location.
Entries in the ring buffer now contain a "cmd_valid" byte at their tail. As an entry is serviced, this byte is cleared by the kernel and set by the sequencer during its dma of a new entry. Since this byte is the last portion of the command touched during a dma, the kernel can use this byte to ensure the command it processes is completely valid.
The new command format requires a fixed sized DMA from the controller to deliver which allowed for additional simplification of the sequencer code. The hack that required 1 SCB slot to be stolen for incoming command delivery notification is also gone.
|
40421 |
15-Oct-1998 |
gibbs |
-Wunused cleanup.
Correct a problem where an external bus reset on the 'background' channel of a Twin Channel EISA controller could put the driver into an infinite loop.
Noticed by: Twin Channel bug, Joerg Wunsch <joerg@FreeBSD.org> Submitted by: -Wunused, Poul-Henning Kamp <phk@freebsd.org>
|
40399 |
15-Oct-1998 |
gibbs |
Bring back support for honoring the primary channel setting for twin channel EISA adapters. This could have caused the system to find the wrong root disk.
Reviewed by: J Wunsch <j@ida.interface-business.de>
|
40126 |
09-Oct-1998 |
gibbs |
Pass termination information via softc flags to the core driver. The EISA probe missed out on this change in attach->core API.
|
40125 |
09-Oct-1998 |
gibbs |
When 'using defaults' ensure that termination is enabled.
Removed some unused code.
|
40030 |
07-Oct-1998 |
gibbs |
ahc_pci.c: Disable DPARCKEN in the DSCOMMAND0 register on the aic7890/91/96/97. Parity checking is broken for some chip/MB combinations and this is the work around recommended by Adaptec.
dpt_pci.c: Remove a superflous '{' that prevented DPT_ALLOW_MEMIO from working.
pcireg.h: Add a definition for Parity Error Reponse bit in the PCI Space command register.
|
40028 |
07-Oct-1998 |
gibbs |
Add a missing newline.
|
39545 |
21-Sep-1998 |
gibbs |
Correct twin channel operation.
|
39533 |
20-Sep-1998 |
gibbs |
Remove unused variables and functions.
In the rejected message handler, it was possible for us to confuse a rejected SDTR or WDTR for a rejected tag.
|
39506 |
20-Sep-1998 |
gibbs |
Correct a bug in the timeout handler. When queuing a BDR response to a timeout, we must remove the pending SCB from the disconnected list or risk list corruption when our BDR request using the same SCB is placed on the waiting list.
Eradicate some silly uses of u_int8_t that just serve to slow the code down.
|
39452 |
18-Sep-1998 |
gibbs |
Don't interpret SCB index 254 as a target mode completion when not in target mode. This hack of using the normal command complete mechanism for target cdb completion will go away soon.
Submitted by: Tor.Egge@fast.no
|
39323 |
16-Sep-1998 |
mjacob |
Fix compile warnings.
|
39222 |
15-Sep-1998 |
gibbs |
Move to new name, convert to CAM, add support for new chips, and correct lots of eeprom/auto-termination bugs.
|
39221 |
15-Sep-1998 |
gibbs |
Move to new name and convert to CAM.
|
39220 |
15-Sep-1998 |
gibbs |
Massive overhaul of the aic7xxx driver: - Convert to CAM - Use a new DMA based queuing and paging scheme - Add preliminary target mode support - Add support for the aic789X chips - Take advantage of external SRAM on more controllers. - Numerous bug fixes and performance improvements.
|
37223 |
28-Jun-1998 |
gibbs |
Some revisions of the aic7880 have a problem where, if the data fifo is full, but the PCI input latch is not empty, HDMAEN cannot be cleared. The fix used here is to attempt to drain the data fifo until there is space for the input latch to drain and HDMAEN de-asserts.
This is a 1 instruction fix, so it should have no performance impact.
|
29897 |
27-Sep-1997 |
gibbs |
Add support to aicasm for "downloaded constants". These are immediate operands that are set during seqeuncer program download instead of at assembly time.
Convert the sequencer code to use" downloaded constants" for four run time constants that vary depending on the board type. This frees up 4 bytes of sequencer scratch ram space where these constants used to be stored and also removes the additional instructions required to load their values into the accumulator prior to using them.
Remove the REJBYTE sram variable. The host driver can just as easly read the accumulator to get this value.
The scratch ram savings is important as the old code used to clober the SCSICONF register on 274X cards which sits near the top of scratch ram space. The SCSICONF register controls bus termination, and clobbering it is not a good thing. Now we have 4 bytes to spare.
This should fix the reported problems with cards that don't have devices attached to them failing with a stream of "Somone reset bus X" messages.
Doug Ledford determined the cause of the problem, fixes by me.
|
29050 |
03-Sep-1997 |
gibbs |
Make the aic7xxx sequencer assembler compile in the kernel's object directory. Rename (via repository copy) some files so that the potential for future conflicts is minimized.
PR: conf/4363
|
28169 |
13-Aug-1997 |
gibbs |
Add a spin lock that prevents the sequencer from attempting to add an entry to the QOUTFIFO when it is full. This should eliminate the "Timed out while idle" problems that many have reported.
In truth, this is somewhat of a hack. Although are interrupt latency is low enough that we should be able to always service the queue in time, since each entry must be passed up to the higher SCSI layer for what can be a large amount of processing (perhaps even resulting in a new command being queued) with interrupts disabled, we need this mechanism to avoid overflow. In the future, these additional tasks will be offloaded to a software interrupt handler which should make this hack unnecessary.
|
26997 |
27-Jun-1997 |
gibbs |
Modify my copyright notice to allow the sequencer to be used with GPLed software (aka Linux).
Fix a few bugs in the sequencer assembler.
Make it easy to compiler the assembler with debugging turned on.
|
25123 |
24-Apr-1997 |
gibbs |
The following scenario would result in a bogus residual being reported if SCB Paging was enabled:
disconnect with more data to transfer disconnected SCB gets paged out target reconnects so we page SCB back in target completes transfer so residual is 0 target disconnects SCB gets reused but not paged out since the residual is 0 (optimization) target reconnects so we page the SCB back in we report a residual because of stale residual information.
The fix for this is to set a flag that forces the SCB to be paged back up to the host if we page in an SCB with a residual
Pointed out by: Doug Ledford <dledford@dialnet.net>
|
25005 |
18-Apr-1997 |
gibbs |
Revert some changes to the selection and reselection code that were thought to fix a selection timeout problem.
If we can't find an SCB for the reconnecting target, issue a bus device reset as the SCSI2 spec suggests.
Add a missing call to "add_scb_to_free_list" in the non paging case. In the non-paging case, the SCBs don't really need to be on the free list, but putting them there clears the tag field which is something the recovery code depends on.
|
24914 |
14-Apr-1997 |
gibbs |
Re-arange the selection and reselection code to hopefully kill the spurious selection timeouts that have been reported.
|
24794 |
10-Apr-1997 |
gibbs |
aic7xxx.seq: Be consistant about testing for parity errors after waiting for a REQ on the bus.
Don't ack the last byte in a transaction until after we've cleared all target state.
aic7xxx_asm.c: Test the return value of getopt against -1 not EOF. (Yet another shameless victum of the style guide being wrong).
|
24662 |
05-Apr-1997 |
gibbs |
Instead of testing for both SELDI and SELDO in SSTAT0 in the poll for work loop, test for them separately. The bug report from David Malone showed that even though we had been reselected (SELDI was true), we sat in the poll for work loop until the selection timeout timer expired. It may be that the SSTAT0 register doesn't like to have more than one bit tested at a time. I've seen stranger things than this on these parts.
|
24634 |
04-Apr-1997 |
gibbs |
Add missing Id that was lost when the sequencer file format changed.
|
24608 |
04-Apr-1997 |
gibbs |
When not using SCB paging, we can always directly index the SCB of interest either by looking it up in the array of pending, per target, untagged transactions, or by using the tag value passed in during the identify. The old code only direct indexed for tagged transactions. This makes the "findSCB" routine only necessary when SCB paging is enabled, so appropriately conditionalize it. This greatly simplifies the non SCB paging code flow.
|
24571 |
03-Apr-1997 |
gibbs |
CFLAGS += -I. so that building in an obj directory works.
|
24175 |
24-Mar-1997 |
gibbs |
Re-arrange the code to upload an SCB to ensure that there is at least on instruction between the last load into the DFIFO and enabling the DMA. During back to back SCB DMA, it was possible to hang the card.
|
23991 |
18-Mar-1997 |
gibbs |
aic7xxx.seq: Stick 4 more, twin channel only, instructions behind .if ( TWIN_CHANNEL)
aic7xxx_asm.c: Add the -O options which allows the specification of which options to include in a program listing. This makes it possible to easily determine the address of any instruction in the program across different hardware/option configurations. Updated usage() as well.
|
23942 |
16-Mar-1997 |
bde |
Don't depend on <sys/types.h> being (bogusly) included by <stdio.h>.
|
23934 |
16-Mar-1997 |
gibbs |
Missed one.
|
23925 |
16-Mar-1997 |
gibbs |
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c: New sequencer assembler for the aic7xxx adapters. This assembler performs some amount of register type checking, allows bit manipulation of symbolic constants, and generates "patch tables" for conditionalized downloading of portions of the program. This makes it easier to take full advantage of the different features of the aic7xxx cards without imposing run time penalies or being bound to the small memory footprints of the low end cards for features like target mode.
aic7xxx.reg: New, assembler parsed, register definitions fo the aic7xxx cards. This was done primarily in anticipation of 7810 support which will have a different register layout, but should be able to use the same assembler. The kernel aic7xxx driver consumes a generated file in the compile directory to get the definitions of the register locations.
aic7xxx.seq: Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects that win bus arbitration. This ensures that we will rearbitrate as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup associated with that event "up front" and enter a loop awaiting bus free. If we see a REQ first, complain, but attempt to continue. This will hopefully address, or at least help diagnose, the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
|
23168 |
28-Feb-1997 |
gibbs |
No longer clear all interrupt status when the sequencer is reset. The only time that we really want to do this is when a bus reset causes the sequencer to be reset and the kernel driver now handles this case.
Remove some reordering in the select2 routine that wasn't necessary. It was an experimental fix for a race condition I fixed elsewhere, and confused the code flow.
Don't bother looping on a parity error in the mesgout loop since we can't see parity errors on out phases.
Clean up the mesgin_identify code. In the old days, we "snooped" for tag messages and used this as an indicator of whether or not the target was using tagged transactions. This forced the sequencer to ack the identify before determining if a valid SCB matched the target meaning that an abort message to handle this case might not be seen before the target entered a data phase. Since we can determin the "tagged-ness" of a target by looking it up in the array of busy targets (recently introduced), we can determine this up front simplifying the search code as well as ensuring we can follow the SCSI specs method for rejecting a reselection.
When an SCB is placed on the free list, set its SCB_TAG to SCB_LIST_NULL. This makes it much easier for the kernel driver to find active SCBs on the card during error recovery.
|
23098 |
25-Feb-1997 |
gibbs |
Leave reselections on all the time. If we are aborting an SCB from findSCB, don't add it back to the free list - the kernel driver will do this for us.
|
22975 |
22-Feb-1997 |
peter |
Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not ready for it yet.
|
22895 |
18-Feb-1997 |
gibbs |
Enlarge the message out buffer from 6 to 8 bytes. Now that sync and wide negotiation messages may be tagged, we were overrunning the old buffer. The variable that was getting squashed is updated before the message goes out, causing corrupted SDTR or WDTR messages. Depending on the phases traversed before message out, this could cause the wrong offset to be negotiated allowing data overruns to occur. The problem is easier to detect with wide targets on the chain since the allowed offset is smaller.
Also removed the unnecessary clearing of SPIORDY during the message out phase. We don't rely on SPIORDY any more.
|
22568 |
11-Feb-1997 |
gibbs |
Clear the DFCNTRL register after every busfree.
When setting the HCNT registers, do so in ascending order.
When performing tagged queueing in non-paging mode, also check the disconnected bit in the SCB as extra sanity during a reconection.
Make the labels in the DMA routine more sane.
When doing a DMA, if we see the DMADONE condition come true, we can simply turn of the DMA enable bits in DFCNTRL without testing the FIFO state as HDONE is true when DMADONE is true and this emplies the FIFO is empty.
These changes clear up the data overrun error messages and seem to prevent the "timed out in data-in phase" problems.
|
22451 |
09-Feb-1997 |
gibbs |
Clear the channel after (re)selection instead of once we see the bus go free.
When we clear SCSIRATE, also clear the FAST20 bit in SXFRCTL0. This also allowed me to clean up some of the ULTRA code.
ULTRAENB->FAST20 to follow the convention in the Adaptec data books.
Fix the data-overrun code to set both stcnt and hcnt otherwise, the transfer will just hang until we get a timeout.
Add implicit support for the NOOP message. I've never heard of the driver issueing a reject for one, but its silly to reject NOOP and who knows how a device might react.
In the dma routine, check SDONE before cleaing SDMAEN. The data books mention SDONE possibly being cleared when SDMAEN is reset. Clients of dma now need to check if SINDEX is cleared to know if a phasemis occured.
Fix some comments to be correct.
|
22234 |
03-Feb-1997 |
gibbs |
In dma_finish, don't disturb the direction bit in DFCNTRL when turning off host DMAs. The additional test to ensure that the DMA has stopped is also unnecessary since we've already waited for the DMA to complete.
Update my copyright for the new year.
|
22078 |
29-Jan-1997 |
gibbs |
Add 1997 to my copyright.
Expand the boundaries of a pause disabled region to close of possible race condition.
Revert a portion of the DMA code to fix false overruns.
Add a missing "add_scb_to_free_list" so we don't leak SCBs.
|
21982 |
24-Jan-1997 |
gibbs |
Change the way DMA is handled during the command phase. Only test on SDONE, not HDONE.
In the data phase dma handler, mask off just the enable bits instead of clearing the whole register. Clearing the direction bit could be bad. Also don't stop a DMA until MREQPEND goes false. Doing this may cause an ABORT on the PCI bus although I have yet to see this happen.
Add definitions for MREQPEND and the BRDCTL register. The BRDCTL register is used to handle high byte termination and automatic termination testing.
|
21947 |
22-Jan-1997 |
gibbs |
Clear the SCSI channel after we go to busfree instead of after re/selection.
Only enable reselections once the channel and SCSIRATE have been cleared.
Add a pause block around the test busy code in the non-tagged case to simplify error recovery in the corner case of aborting an SCB that just got started.
Simplify reselection processing by removing the call to initialize_scsiid.
Clear the scsiseq re/select control bits and setup for catching bogus busfrees earlier in the re/select process.
Improve the automatic PIO code. It turns out that SPIORDY is not a reliable hardware condition bit, so use REQINIT intstead. Don't rely on PHASEMIS either since it can take too long to come true. Use a brute force comparison instead.
Remove some unnecessary overhead in the command complete processing. It should be nearly impossible to overflow the QOUTFIFO (worst case 9 command have to complete with at least 6 of them requiring paging on an aic7850), so don't take the additional PIO hit to guard against this condition. If we don't see our interrupt in time, the system has bigger problems elsewhere. If this ever does happen, the timeout handler will notice and retry the command.
|
21673 |
14-Jan-1997 |
jkh |
Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long.
Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
|
20117 |
03-Dec-1996 |
gibbs |
Re-enable reselections as the first thing after we see a bus free. We seem to miss reselections from some devices and since the reselection response timeout is only 200ns, enabling reselections too late may be the cause of our problem.
|
19921 |
22-Nov-1996 |
gibbs |
Conditionally enable the busfree interrupt to catch unexpected busfrees. Immediate SCBs, since they always send messages that tell the target to transition to bus free now rely on the busfree interrupt instead of the IMMEDDONE sequencer interrupt that was generated before.
Rearrange some code in the message out loop to give ATN a little more time to drop before we ACK the last byte.
Use SPIORDY instead of REQINIT when snooping for a tag message on a reconnect. This is done for the same reasons we use SPIORDY in the inb functions.
When going into BITBUCKET mode, turn off HDMAEN in the DFCNTRL register so that we can "not care" what the value of HCNT is. If HCNT is 0, BITBUCKET mode won't transfer any data if HDMAEN is set. Seeing as we don't want the transfer to even think about touching the host, this seems more sane anyway. Thanks to "Dan Willis" <dan@plutotech.com> for pointing out that this was a problem.
|
19906 |
21-Nov-1996 |
gibbs |
Change the way Automatic PIO is performed in the mesgin and mesgout phases. SPIORDY should go active on any REQ of the bus, so testing for REQINIT is not necessary. It also seems that testing for SPIORDY is more robust then REQINIT since SPIORDY comes active after REQINIT and PHASEMIS seems to take some time to come true after REQ is asserted if the phase has changed. Of course, none of this is documented.
This should give the code savings of my original changes, without breaking the driver on fast peripherals.
|
19803 |
16-Nov-1996 |
gibbs |
Assert that we have seen an identify or have not disconneccted since the initial selection when entering the status phase. This is the same assertion we use for all the other data transfer phases.
Hopefully fix the hangs in the mesgin and mesgout phases that I introduced last week during some code cleanup. I need to get some of these 12MB/s drives so I can reproduce these hangs here...
Add a pause disable in the SCB paging case around our manipulation of the QOUTQCNT variable. This is simply extra sanity.
Set LASTPHASE to P_BUSFREE once we see a busfree so that the kernel driver can differentiate this from a data out phase.
|
19623 |
11-Nov-1996 |
gibbs |
Fix two problems with SCB Paging.
1) get_free_or_disc_scb was not being passed its argument correctly in one case
2) Add protection in the form of the QOUTQCNT variable to prevent overflowing the QOUTFIFO.
This should make SCB Paging work. Really, I mean it now. 8-)
|
19421 |
05-Nov-1996 |
gibbs |
index_untagged_scb should rely solely on the argument passed in SINDEX and not access SCB_TCL directly. This could have caused problems on twin channel adapters.
2.2 Candidate.
|
19231 |
28-Oct-1996 |
gibbs |
In data_phase_reinit when I converted the code to use bcopy, I should have used mvi instead of mov. Luckily this code is most likely never executed since it is only there for sanity should a target goes into the data phase twice during a single selection or reselection.
|
19218 |
28-Oct-1996 |
gibbs |
Fix problems dealing with non-tagged devices when SCB paging is enabled. Mostly this involved changing the semantics of the findSCB routine so that it could be used at times other than handling a reconnection.
|
19164 |
25-Oct-1996 |
gibbs |
Go back to using DMA to get SCBs down to the adapter.
SCB paging is now handled almost entirely by the sequencer and also uses DMA. This should make SCB paging at least an order of magnitude more efficient and vastly simplifies the implementation.
Add a few space optimizations so this code still fits on aic7770 chips.
Update comments.
|
18762 |
06-Oct-1996 |
gibbs |
Bring aic7xxx driver bug fixes from 'SCSI' into current.
|
16260 |
09-Jun-1996 |
gibbs |
Detect and report dataphase overruns. Put the adapter into 'Bit Bucket' mode when this occurs and allow the target to complete the transaction. Force a retry on overruns since they are usually caused by termination or cable problems.
|
16198 |
08-Jun-1996 |
gibbs |
Hopefully fix the parity problem and the hang on message reject for good.
|
16036 |
31-May-1996 |
gibbs |
Don't use the auto ATN on parity error feature. It may be the source of our parity handling problems.
|
16002 |
30-May-1996 |
gibbs |
Fix regression. It seems that you need at least one instruction between seeing SPIORDY and checking for PHASEMIS. My last change turned out to be less cosmetic then I thought.
Pointed out by: Satoshi Asami <asami@cs.berkeley.edu>, Faried Nawaz <fn@pain.csrv.uidaho.edu
|
15998 |
30-May-1996 |
gibbs |
Merge in changes for NetBSD/OpenBSD.
Cosmetic change to p_mesgout code so that it "looks" the same as what is done in the inb* routines. NetBSD/OpenBSD support Submitted by:Noriyuki Soda <soda@sra.co.jp>, Pete Bentley <pete@demon.net>, Charles M. Hannum <mycroft@mit.edu>, Theo de Raadt <deraadt@theos.com>
|
15951 |
27-May-1996 |
gibbs |
Fix a race condition in p_mesgout* and inb* code that could allow a phasemiss to sneak by without detection. This should fix the Wide/Narrow boot problems that have been reported since this bug caused the driver ignore a narrow target rejecting wide negotiation.
|
15881 |
23-May-1996 |
gibbs |
Correct a botched commit from yesturday. It helps to bring over the right patch file.<sigh>
|
15843 |
21-May-1996 |
gibbs |
Enable/Disable Ultra mode on a per target basis. This allows the driver to use the full range of settings from 3.6-20MHz on any target.
|
15713 |
10-May-1996 |
gibbs |
One more linux -> __linux__
|
15709 |
10-May-1996 |
gibbs |
aic7xxx.seq: Change #ifdef linux to #ifdef __linux__
aic7xxx_reg.h: Remove unneeded BOFF_60BCLOCKS define CHIPRSTACK to be the same as CHIPRST define RESET_SCSI and CHANNEL_B_PRIMARY bits All of these aer used during the setup of adapters.
|
15328 |
20-Apr-1996 |
gibbs |
Implement SCB paging. This allows up to 255 active commands on aic7770 >= Rev E, aic7850, aic7860, aic7870, and ai7880 based controllers.
Make findSCB safer for non-tagged commands when tagged commands are active on the controller. The symptoms of this problem were "Overlapped commands attempted" messages during error recovery attempts.
Compact scratch ram usage. This leaves 8 bytes free for future use.
Clean up some comments.
aic7xxx_reg.h: Update my copyright.
|
14934 |
31-Mar-1996 |
gibbs |
aic7xxx.seq: Fix support for the aic7850 by looking only at the relavent bits of the QINCNT. The 7850 puts random garbage in the high bits and all my attempts to determine the cause of this failed. This approach does seem to work around the problem.
Don't trust SCSIPERR to tell us when there is a parity error. On some revs of the 7870 and the 7880, this bit follows the parity of the current byte. Instead of using a SEQINT to tell the kernel, re-enable the standard parity error interrupt since it seems to pause the sequencer right at the time of the error which is the effect we were looking for anyway.
aic7xxx_reg.h: Remove PARITY_ERROR seqeuncer interrupt type, its no longer used.
Define QCOUNTMASK as the SRAM location for the mask to use on the QINCNT register. QCOUNTMASK is determined by the number of SCBs supported by the device we're working on.
aic7xxx_asm.c Properly check the return value of fopen, and define the arg list in getopt correctly. Submitted by: Pete Bentley <pete@demon.net>
|
14449 |
10-Mar-1996 |
gibbs |
Reset the DMA control register whenever we reset the sequencer. Clear LASTPHASE on busfree so the kernel driver can tell that the sequencer is idle. Fix some comments to reflect reality.
|
13690 |
29-Jan-1996 |
gibbs |
Performance optimizations. Unroll all bcopies. Use PIO to transfer SCBs since setting up the DMA is too costly. Restructure for efficiency.
Pause the sequencer when a parity error occurs so that the kernel driver knows during which phase the error was encountered.
|
13386 |
11-Jan-1996 |
gibbs |
Take a different approach to the SPIORDY race condition. Simply clear SPIORDY just before we ack on the bus so that there is no chance to see SPIORDY for the same byte twice.
Make some small modifications so that the Linux aic7xxx driver can use our sequencer and register definition files verbatum.
|
13360 |
09-Jan-1996 |
gibbs |
Change the inb and outb routines slightly. It seems that waiting for SPIORDY after polling REQINIT is a bad idea.
|
13313 |
07-Jan-1996 |
gibbs |
aic7xxx.seq: Add the same type of safeguards we use in the mesg_in phase to the mesg_out phase.
aic7xxx_reg.h: Add definitions for the DSCommand register for PCI adapters.
|
13251 |
05-Jan-1996 |
gibbs |
Bring back the more heavy-weight version of the mesgin inb routines. Davidg's testing made me think that some of the checks were superfluous, but wcarchive (and Amancio) know better.
|
13230 |
05-Jan-1996 |
gibbs |
Null terminate execl's argument list.
Submitted by: Ron Lenk <rlenk@widget.xmission.com>
|
13177 |
03-Jan-1996 |
gibbs |
The long awaited stability patch set for the aic7xxx driver:
1) Use cpp to preprocess the sequencer code.
2) Convert all "magic numbers" to #defines shared by the sequencer and kernel driver via the aic7xxx_reg.h file. (The assembler still needs to be re-written in lex/yacc to allow ~|& type constructions).
3) Raise ATN on parity errors for "in" phases and send an initiator detected error or message-in parity error message as appropriate.
4) Turn off the reselection hardware from the time or a (re)connection to busfree. It seems that some fast targets were able to reconnect before the sequencer was able to see busfree.
5) The message buffer is considered "in-use" when there is a positive length count. The ACTIVE_MSG flag was unnecesary.
6) Properly set SCB_NEXT_WAITING to SCB_LIST_HEAD in scbs being added to the waiting scb list. This is a change in how the list code works to facilitate some planned work in the reset code.
7) The fields in the SCB have be re-arranged to be quad-word aligned.
8) The inb code has been rewritten to catch phasemisses and be more efficient.
9) Go back to "snooping the bus" to determine if the incomming identify message will be followed by a simple queue message. Its much faster than doing a search through the SCBs.
10) Implement better tag range checking for incomming tags.
11) Make sdtr_to_rate more accurate (use 25 instead of 24 in calculations - must have been asleep that night).
12) Rearrange some routines to reduce code complexity and size.
13) Update comments and formatting.
14) Fixed bugs I've forgotten about??
Reviewed by: David Greenman <davidg@FreeBSD.org>
|
12137 |
07-Nov-1995 |
gibbs |
Fix the long dreaded Wide bug and enable WIDEODD for reads.
|
12088 |
05-Nov-1995 |
gibbs |
Move aic7xxx register definitions from i386/scsi/aic7xxx.c to this file. The hope is to make the sequencer and kernel code share this file, but some work on our sequencer assembler will be needed first.
|
11901 |
29-Oct-1995 |
gibbs |
Only or in CLRCHN in SXFRCTL0. All other bits in this register are initialized by the kernel driver now.
|
11829 |
26-Oct-1995 |
gibbs |
Set SCSIGO generically before we determine the phase instead of doing it in each phase routine. Saves a few instructions.
Be more careful in how we deal with SXFRCTL0. Or in the control bits of interest instead of using mvi. The kernel driver will set the ULTRAEN bit of SXFRCTL0 if we are using Ultra (20MHz) mode and we don't want to clobber it.
In sdtr_to_rate divide by two if we are in ultra mode to get the correct setting since its a 20MHz instead of 10MHz scale.
|
9954 |
06-Aug-1995 |
gibbs |
Clean up the mesgin code to make it easier to read with proceedure lables that are based on what mesage is being processed instead of just numbers.
Order the tests for incoming message type by level of occurance.
|
9928 |
05-Aug-1995 |
gibbs |
Total rewrite of the dataphase sections of the sequencer. This was done to replace the very poor, original implementation of Scatter/Gather operations.
Use a bit (that was freed up with the rewrite above) in the SCB control byte to designate commands that should allow disconnection. The kernel driver makes this decision now instead of the sequencer since the sequencer can't do the indexing very efficiently.
This commit drops the sequencer from 426 instructions to 390 most likely freeing enough space to do a target mode implementation.
|
9917 |
05-Aug-1995 |
gibbs |
Fix two race conditions.
The first could occur because the original code would continue to reset the SCSIID register while waiting for a selection. This could potentially conflict with a reconnect since a successfull reconnect will also set the SCSIID register. The fix is to use a separate wait loop after starting a selection (as was done a few revisions ago).
The second probably never happens, but it was possible for a target to reconnect while there was a pending SCB on the waiting list and not get noticed. The fix was to remove a supurflous check of the scb waiting list.
|
9810 |
31-Jul-1995 |
gibbs |
Pause the sequencer when message only requests complete. This allows the kernel driver to know the exact state of the sequencer after a BUS DEVICE RESET or ABORT completes so it can properly clean up the request.
|
9395 |
04-Jul-1995 |
gibbs |
Change SCB_LIST_NULL to 0xff from 0x10 to allow for 255 commands. This is needed for 3940 support.
Have tagged commands look to see if a target is "busy" with a non tagged command before executing. This prevents overlapped tagged and non tagged commands which can happen since request sense commands are not tagged.
|
8876 |
30-May-1995 |
rgrimes |
Remove trailing whitespace.
|
8567 |
17-May-1995 |
dg |
Fixes to the aic7xxx sequencer code and device driver from Justin Gibbs:
1) If a target initiated a sync negotiation with us and happened to chose a value above 15, the old code inadvertantly truncated it with an "& 0x0f". If the periferal picked something really bad like 0x32, you'd end up with an offset of 2 which would hang the drive since it didn't expect to ever get something so low. We now do a MIN(maxoffset, given_offset).
2) In the case of Wide cards, we were turning on sync transfers after a sucessfull wide negotiation. Now we leave the offset alone in the per target scratch space (which implies asyncronous transfers since we initialize it that way) until a syncronous negotation occurs.
3) We were advertizing a max offset of 15 instead of 8 for wide devices.
4) If the upper level SCSI code sent down a "SCSI_RESET", it would hang the system because we would end up sending a null command to the sequencer. Now we handle SCSI_RESET correctly by having the sequencer interrupt us when it is about to fill the message buffer so that we can fill it in ourselves. The sequencer will also "simulate" a command complete for these "message only" SCBs so that the kernel driver can finish up properly. The cdplay utility will send a "SCSI_REST" to the cdplayer if you use the reset command.
5) The code that handles SCSIINTs was broken in that if more than one type of error was true at once, we'd do outbs without the card being paused. The else clause after the busfree case was also an accident waiting to happen. I've now turned this into an if, else if, else type of thing, since in most cases when we handle one type of error, it should be okay to ignore the rest (ie if we have a SELTO, who cares if there was a parity error on the transaction?), but the section should really be rewritten after 2.0.5. This fix was the least obtrusive way to patch the problem.
6) Only tag either SDTR or WDTR negotiation on an SCB. The real problem is that I don't account for the case when an SCB that is tagged to do a particular type of negotiation completes or SELTOs (selection timeout) without the negotiation taking place, so the accounting of sdtrpending and wdtrpending gets screwed up. In the wide case, if we tag it to do both wdtr and sdtr, it only performs wdtr (since wdtr must occur first and we spread out the negotiation over two commands) so we always have sdtrpending set for that target and we never do a real SDTR. I fill properly fix the accounting after 2.0.5 goes out the door, but this works (as confirmed by Dan) on wide targets.
Other stuff that is also included:
1) Don't do a bzero when recycling SCBs. The only thing that must explicitly be set to zero is the scb control byte which is done in ahc_get_scb. We also need to set the SG_list_pointer and SG_list_count to 0 for commands that do not transfer data.
2) Mask the interrupt type printout for the aic7870 case. The bit we were using to determine interrupt type is only valid for the aic7770.
Submitted by: Justin Gibbs
|
8104 |
27-Apr-1995 |
gibbs |
Restructure the arbitration loop to allow for reselections that win out over the adapter's selections. Many fast periferals were getting upset when the sequencer decided to rearbitrate after the device had already won arbitration. This also forced the creation of a list threaded through the SCBs (since we don't have enough space anywhere else) of commands that are awaiting reselection. This list is run down before any new transactions from the input queue are allowed. The list is appened to whenever we begin a selection (simple case since the selecting device is always at the head) and by the kernel driver whenever a request sense occurs. In the common case, the list is only one element long, but when a reselection wins out over a selection and that reselection generates a request sense, the outstanding selection required for the retreval of the sense code grows the list. On machines with many targets, this might cause the list to grow large, so this solution, which will allow up to the maximum number of I/O requests capible of the card elements in the list, was chosen. The list manipulation is trivial and adds three sequencer instructions of overhead to the selection phase.
This fixes the "target busy" errors from micropolis drives and the bursty I/O problem when performing I/O between a Quantum Grand Prix and any other device. I anticipate that this will correct many of the problems that have been reported with this driver.
Reviewed by: Wcarchive and David Greenman
|
7857 |
15-Apr-1995 |
gibbs |
John Aycock's BSD copyrighted sequencer assembler and sequencer code. This is identical to the older version, just the copyright has changed. Many thanks go to Dean Gehnert of the Linux camp who went the extra mile to make this happen.
Other changes:
Update assembler man page to include the -v and -D options
Merge in Dean's latest changes to the assembler
Have the sequencer do a MSG_REJECT when the negotiated syncronous rate is lower than the adapter supports. This forces asyncronous mode which is faster at these rates anyway.
This code will be moved shortly to the non-gpld portion of the tree.
|
7700 |
09-Apr-1995 |
gibbs |
More code optimizations. Use a slightly different approach to decide whether a reconnecting target is a tagged device or not.
|
7562 |
01-Apr-1995 |
gibbs |
Off by one error in -MSG-START+0 was just Justin being tired -- revert to old value.
Remove unnecessary check for active messages in setup SCB. This same test would also jump to p_mesgin_done which would "ACK" an extra time possibly confusing the target.
Tell the kernel driver whenever we send an ABORT_TAG message.
|
7532 |
31-Mar-1995 |
gibbs |
Major overhaul of the aic7xxx driver: - Report valid residual byte counts. We actually pause the sequencer when the residual is non-zero. I thought about using DMA to do this, bus sequencer program space is tight.
- Fix embarassing off by one error in the computation of a 2's compliment variable. This was most likely the cause of the many problems reported with the tagged queuing code.
- Handle "MAX_SYNC" as a special case (ie we are the ones starting the sync negotiation sequence). This was done so that the target scratch area can be initialed to 0 offset (asyncronous transfers) safely. The initialization to 0 (was 15) is necessary since in some cases a Wide negotiation could run into problems if SCSIRATE was set wrong and we went into data(in/out).
- Trim the DMA routines a little by using some procedures. Net effect is more functionality with 3 less instructions after this update.
- Toggle the WIDEODD bit of the DFCNTRL whenever this is not the last SG block. It has no effect in the 8bit bus configuration, but in the Wide configuration ensures that the overlap byte is held in the SCSI block if the transfer is odd so it will end up in the next SG (the correct behavior).
|
7118 |
17-Mar-1995 |
gibbs |
Make the aic7xxx assembler take quoted strings as a single token. Make $Id the version variable which required the quoted string "feature".
|
6940 |
07-Mar-1995 |
gibbs |
Be careful to maintain the bits in SBLKCTL that are reserved.
|
6608 |
22-Feb-1995 |
gibbs |
Add tagged queueing support to the aic7xxx sequencer code.
|
6156 |
03-Feb-1995 |
gibbs |
Have version number track CSV version number. No other change.
|
5775 |
22-Jan-1995 |
gibbs |
aic7xxx.c: Print out the length of the compiled sequencer program.
aic7xxx.seq: More optimizations. Replace generic bcopy routine with bcopy_3 and bcopy_4 (ie unroll the loops) since these are the only two cases used. Initialize SIMODE1 and SXFRCTL1 from the kernel in ahc_init instead of at each selection/reselection since this is expensive and only needs to be done once. Condense function returns into previous instruction if possible. Reorder some sections to kill superflous jumps. These optimizations kill the ~150k/s penalty adding support for Twin/Wide cards was costing since the last place in the commaon path of execution where we had to do ugly, convoluted testing for the type of card in the sequencer has gone away. Next stop tagged queuing and target mode.
|
5647 |
16-Jan-1995 |
gibbs |
At $Ids to all files. Have the sequencer use DMA to tranfer its SCB (SCSI control block) instead of having the host PIO it down. Also reimplement WDTR and SDTR optimization to remove code in the sequencer and place the responsibility of knowing when to initiate SDTR or WDTR on the kernel driver. This vastly shortens the sequencer program yet yeilds the same performance.
|
5562 |
13-Jan-1995 |
gibbs |
Full support for 294x and Wide devices. Fixed month old bug in the SCSI sense retrieval code that messed up CDROM devices. This code will also responde correctly to SDTR and WDTR messages from devices that start a negotiation sequence.
|
5326 |
31-Dec-1994 |
gibbs |
Update the sequencer code to handle both channels of Twin channel devices. You can now sling 14 devices off of a 274xT. In the process of adding twin channel support, I removed all evident restrictions on supporting Wide channeled devices, but I do not have a Wide controller to test them on.
aic7770_seq.h, the pre-compiled header, is no longer needed since config handles this dependancy.
|
4866 |
29-Nov-1994 |
gibbs |
Merge in latest Linux sequencer code release with my changes. This should make the sequencer code fully compatible with the aic7870 (ie 294x adaptors). I've also added to my local mods putting the sequencer into "FASTMODE" clock. This gives upwards of 2M/sec write preformance improvement in some scenarios. There haven't been any reports of this causing problems, and I have been reaping the benifits of it for more than a week now.
This also includes a new version of the pre-generated file <ugh>
Obtained from: John Aycock (aycock@cpsc.ucalgary.ca) and myself
|
4614 |
18-Nov-1994 |
gibbs |
Previous changes to the sequencer compiler backed out. We go back to generating the .h file, and a pregenerated file is included.
|
4608 |
18-Nov-1994 |
jkh |
Make the compiler spit out a .c file instead of a .h file.
|
4568 |
17-Nov-1994 |
gibbs |
John Aycock's aic7770 sequencer code and assembler. There is currently a discussion going on about removing this code from the burden of the GPL, but it won't happen before Beta, and this code should be tested before release.
Supports 27/2842 class adaptec cards and is almost capable of supporting aic7870 based adapters (294X series cards). It does not support Wide controllers or the second channel on Twin boards although I have work in progress on getting both channels and running.
I have also added a few performance improvements to this version that give us approximately a 25% boost over the original driver. These patches have been submitted to the author.
Obtained from: Linux aic7770 driver (John Aycock - aycock@cpsc.ucalgary.ca)
|