Home | History | Annotate | Download | only in pci
History log of /src/sys/dev/pci/ahd_pci.c
RevisionDateAuthorComments
 1.40  28-May-2022  andvar fix various typos, mainly in comments.
 1.39  10-Nov-2019  chs in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.38  09-Dec-2018  jdolecek use pci_intr_establish_xname() everywhere
 1.37  23-Jun-2018  maxv branches: 1.37.2;
constify
 1.36  15-Jan-2018  maya branches: 1.36.2;
malloc+memset zero to malloc(, |M_ZERO);

ok rkujawa
 1.35  29-Mar-2014  christos make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.34  21-Apr-2013  msaitoh branches: 1.34.4;
Delete "PCI_" from PCIX and PICE capability registers.
 1.33  30-Dec-2011  christos branches: 1.33.6;
PR/45760: Henning Petersen: Add Adaptec29329LPE to ahd_pci.c
 1.32  21-Apr-2010  dyoung branches: 1.32.8; 1.32.12;
Don't printf bus_space_tag_t's in a MI driver.
 1.31  26-Sep-2009  tsutsui branches: 1.31.2; 1.31.4;
Split device_t/softc. Tested on aic7901A.
 1.30  05-Sep-2009  tsutsui Use device_t self arg to get a device name rather than through &ahd->sc_dev
which needs to be changed on future device_t/softc split.
 1.29  05-Sep-2009  tsutsui Wrap long lines.
 1.28  06-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.27  21-Mar-2008  dyoung branches: 1.27.4; 1.27.18;
Use aprint_*_dev(), and device_xname(). Constify a bit.
 1.26  21-Mar-2008  dyoung pci_activate() expects for its void * argument to be a device_t,
so change the type of the argument to device_t. Update each use
of pci_activate().

Use device_t and accessors. Use aprint_*_dev().
 1.25  16-Nov-2006  christos branches: 1.25.24; 1.25.44; 1.25.48;
__unused removal on arguments; approved by core.
 1.24  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.23  17-Jun-2006  christos branches: 1.23.4; 1.23.6;
re-factor the pci powestate api. reviewed by gimpy
 1.22  08-Mar-2006  lukem branches: 1.22.4; 1.22.6;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.21  24-Dec-2005  perry branches: 1.21.4; 1.21.6; 1.21.8; 1.21.10;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.20  11-Dec-2005  christos merge ktrace-lwp.
 1.19  28-Jun-2005  thorpej branches: 1.19.2;
Use ANSI function decls and static.
 1.18  30-May-2005  christos - const poisoning
- avoid variable shadowing.
 1.17  25-Apr-2005  bad Recognise the Dell OEM version of the ASR-29320B as found in recent
e.g. Dell SC1420 boxen. This adapter can't be put out of HostRaid mode,
so recognise it in that mode regardless.
 1.16  25-Apr-2005  bad Bring in some changes from rev. 1.17 of FreeBSD aic79xx_pci.c:
Fix the *_IROC_* masks so that the correct bits get masked out for the HostRaid
features.
The 29320 and 29320B really are 7902 based, not 7901A based. Use the approriate
chip setup routine.
Recognise generic 7901 based boards by matching against ID_9005_GENERIC_MASK.
 1.15  27-Feb-2005  perry branches: 1.15.2;
nuke trailing whitespace
 1.14  04-Feb-2005  perry de-__P
 1.13  24-Feb-2004  wiz branches: 1.13.6; 1.13.8; 1.13.10;
parameter with two es. From Peter Postma.
 1.12  18-Nov-2003  briggs Use aprint_* instead of printf.
 1.11  10-Oct-2003  fvdl Add a missing chip reset in attach. Makes things work for an on-board
7902B on a SuperMicro board.
 1.10  10-Oct-2003  fvdl Set some termination defaults correctly. Test register access like
in the original FreeBSD driver.
 1.9  10-Oct-2003  thorpej Fix some errors in device mapping and errata work-arounds, and generally
clean up mapping code.
 1.8  09-Oct-2003  fvdl Don't treat a 66-100Mhz PCI-X bus as plain PCI. From yamt (the code was
already like this in the FreeBSD driver).
 1.7  02-Sep-2003  fvdl Make this less chatty on probe/attach, to match the output of other controllers.
 1.6  29-Aug-2003  thorpej Apply the following change from 06/28/2003 04:39:49 by gibbs to the
FreeBSD ahd driver:

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.
 1.5  29-Aug-2003  thorpej Apply the following change from 5/26/2003 21:15:52 made by gibbs to the
FreeBSD ahd driver:

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
 1.4  29-Aug-2003  thorpej Apply the following change checked in 2003/05/04 00:20:07 by gibbs
to the FreeBSD ahd driver:

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.
 1.3  14-Jul-2003  lukem add missing __KERNEL_RCSID()
 1.2  14-May-2003  wiz branches: 1.2.2;
Correct spelling of coalesce. (Will forward to Justin Gibbs.)
 1.1  21-Apr-2003  fvdl ahd, driver for Adaptec 790x U320 controllers. Originally by Justin Gibbs
for FreeBSD, ported to NetBSD by Pascal Renauld, Network Storage Solutions,
Inc, plus a bunch of changes by me.

This driver is as yet untested in this final form, it will be added
to config files when it has been tested.
 1.2.2.6  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.2.5  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.2.4  04-Feb-2005  skrll Sync with HEAD.
 1.2.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.2.2.1  03-Aug-2004  skrll Sync with HEAD
 1.13.10.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.13.10.1  12-Feb-2005  yamt sync with head.
 1.13.8.1  29-Apr-2005  kent sync with -current
 1.13.6.1  13-May-2005  riz Pull up revisions 1.16, 1.17 (requested by bad in ticket #1480):
Bring in some changes from rev. 1.17 of FreeBSD aic79xx_pci.c:
Fix the *_IROC_* masks so that the correct bits get masked out for the HostRaid
features.
The 29320 and 29320B really are 7902 based, not 7901A based. Use the approriate
chip setup routine.
Recognise generic 7901 based boards by matching against ID_9005_GENERIC_MASK.

Recognise the Dell OEM version of the ASR-29320B as found in recent
e.g. Dell SC1420 boxen. This adapter can't be put out of HostRaid mode,
so recognise it in that mode regardless.
 1.15.2.2  28-Apr-2005  tron Pull up revision 1.17 (requested by bad in ticket #204):
Recognise the Dell OEM version of the ASR-29320B as found in recent
e.g. Dell SC1420 boxen. This adapter can't be put out of HostRaid mode,
so recognise it in that mode regardless.
 1.15.2.1  28-Apr-2005  tron Pull up revision 1.16 (requested by bad in ticket #204):
Bring in some changes from rev. 1.17 of FreeBSD aic79xx_pci.c:
Fix the *_IROC_* masks so that the correct bits get masked out for the HostRaid
features.
The 29320 and 29320B really are 7902 based, not 7901A based. Use the approriate
chip setup routine.
Recognise generic 7901 based boards by matching against ID_9005_GENERIC_MASK.
 1.19.2.3  24-Mar-2008  yamt sync with head.
 1.19.2.2  30-Dec-2006  yamt sync with head.
 1.19.2.1  21-Jun-2006  yamt sync with head.
 1.21.10.1  19-Apr-2006  elad sync with head.
 1.21.8.2  26-Jun-2006  yamt sync with head.
 1.21.8.1  13-Mar-2006  yamt sync with head.
 1.21.6.1  22-Apr-2006  simonb Sync with head.
 1.21.4.1  09-Sep-2006  rpaulo sync with head
 1.22.6.1  13-Jul-2006  gdamore Merge from HEAD.
 1.22.4.1  19-Jun-2006  chap Sync with head.
 1.23.6.2  10-Dec-2006  yamt sync with head.
 1.23.6.1  22-Oct-2006  yamt sync with head
 1.23.4.1  18-Nov-2006  ad Sync with head.
 1.25.48.1  03-Apr-2008  mjf Sync with HEAD.
 1.25.44.1  24-Mar-2008  keiichi sync with head.
 1.25.24.1  23-Mar-2008  matt sync with HEAD
 1.27.18.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.27.4.4  11-Aug-2010  yamt sync with head.
 1.27.4.3  11-Mar-2010  yamt sync with head
 1.27.4.2  16-Sep-2009  yamt sync with head
 1.27.4.1  16-May-2009  yamt sync with head
 1.31.4.1  30-May-2010  rmind sync with head
 1.31.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.32.12.1  18-Feb-2012  mrg merge to -current.
 1.32.8.2  22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.32.8.1  17-Apr-2012  yamt sync with head
 1.33.6.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.33.6.1  23-Jun-2013  tls resync from head
 1.34.4.1  18-May-2014  rmind sync with head
 1.36.2.2  26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.36.2.1  25-Jun-2018  pgoyette Sync with HEAD
 1.37.2.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.37.2.1  10-Jun-2019  christos Sync with HEAD

RSS XML Feed