Home | History | Annotate | Download | only in pci
History log of /src/sys/dev/pci/pdcsata.c
RevisionDateAuthorComments
 1.32  03-Sep-2021  andvar fix typos in comments, mainly s/extention/extension/ and s/sufficent/sufficient/
 1.31  03-Feb-2019  mrg - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
this case, and thus can't be marked __dead easily
 1.30  09-Dec-2018  jdolecek use pci_intr_establish_xname() everywhere
 1.29  20-Oct-2017  jdolecek branches: 1.29.2; 1.29.4;
move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606
 1.28  07-Oct-2017  jdolecek Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

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

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

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

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

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

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)
 1.27  29-Mar-2014  christos branches: 1.27.18;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.26  07-Oct-2013  jakllsch Use the universal pciide_detach() for detach function of all remaining
pciide-core drivers, except pciide at pnpbios which isn't actually PCI.
 1.25  31-Jul-2012  bouyer branches: 1.25.2; 1.25.4;
Apply back changes that were reverted on Jul 24 and Jul 26 (general ata/wdc
cleanup and SATA PMP support), now that I'm back to fix the fallouts.
 1.24  26-Jul-2012  jakllsch Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@
 1.23  24-Jul-2012  jakllsch Revert dsl@'s changes of Sun, 15 Jul 2012 10:55:35 +0000 and
Sun, 15 Jul 2012 10:56:50 +0000, excepting the kernel version bump.
First step in reverting regressions to ata(4) subsystem during the addition of
port multiplier support.
 1.22  15-Jul-2012  dsl Some namespace protection (and add greppablity).
Prefix the DRIVE_ and DRIVET_ constants from atavar.h with ATA_.
Don't use an enum for drive_type - you don't know how big it will be.
Move driver_type to avoid implicit structure padding (esp on arm).
This change is purely lexical and mechanical.

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

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

Thanks to:
- Protocase (http://www.protocase.com/) which provided a system
with lots of controllers, SATA PMP and drive slots
- Conservation Genomics Laboratory, Department of Biology, New Mexico State
University for hosting the above system
- Brook Milligan, who set up remote access and has been very responsive
when SATA cable move was needed
 1.20  04-Apr-2011  dyoung branches: 1.20.4;
Neither pci_dma64_available(), pci_probe_device(), pci_mapreg_map(9),
pci_find_rom(), pci_intr_map(9), pci_enumerate_bus(), nor the match
predicate passed to pciide_compat_intr_establish() should ever modify
their pci_attach_args argument, so make their pci_attach_args arguments
const and deal with the fallout throughout the kernel.

For the most part, these changes add a 'const' where there was no
'const' before, however, some drivers and MD code used to modify
pci_attach_args. Now those drivers either copy their pci_attach_args
and modify the copy, or refrain from modifying pci_attach_args:

Xen: according to Manuel Bouyer, writing to pci_attach_args in
pci_intr_map() was a leftover from Xen 2. Probably a bug. I
stopped writing it. I have not tested this change.

siside(4): sis_hostbr_match() needlessly wrote to pci_attach_args.
Probably a bug. I use a temporary variable. I have not tested this
change.

slide(4): sl82c105_chip_map() overwrote the caller's pci_attach_args.
Probably a bug. Use a local pci_attach_args. I have not tested
this change.

viaide(4): via_sata_chip_map() and via_sata_chip_map_new() overwrote the
caller's pci_attach_args. Probably a bug. Make a local copy of the
caller's pci_attach_args and modify the copy. I have not tested
this change.

While I'm here, make pci_mapreg_submap() static.

With these changes in place, I have tested the compilation of these
kernels:

alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-eb NSLU2
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE GUMSTIX
HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321 IXDP425 IXM1200
KUROBOX_PRO LUBBOCK MARVELL_NAS NAPPI SHEEVAPLUG SMDK2800 TEAMASA_NPWR
TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sgimips GENERIC32_IP2x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC

As of Sun Apr 3 15:26:26 CDT 2011, I could not compile these kernels
with or without my patches in place:

### evbmips-el GDIUM

nbmake: nbmake: don't know how to make /home/dyoung/pristine-nbsd/src/sys/arch/mips/mips/softintr.c. Stop

### evbarm-el MPCSA_GENERIC
src/sys/arch/evbarm/conf/MPCSA_GENERIC:318: ds1672rtc*: unknown device `ds1672rtc'

### ia64 GENERIC

/tmp/genassym.28085/assym.c: In function 'f111':
/tmp/genassym.28085/assym.c:67: error: invalid application of 'sizeof' to incomplete type 'struct pcb'
/tmp/genassym.28085/assym.c:76: error: dereferencing pointer to incomplete type

### sgimips GENERIC32_IP3x

crmfb.o: In function `crmfb_attach':
crmfb.c:(.text+0x2304): undefined reference to `ddc_read_edid'
crmfb.c:(.text+0x2304): relocation truncated to fit: R_MIPS_26 against `ddc_read_edid'
crmfb.c:(.text+0x234c): undefined reference to `edid_parse'
crmfb.c:(.text+0x234c): relocation truncated to fit: R_MIPS_26 against `edid_parse'
crmfb.c:(.text+0x2354): undefined reference to `edid_print'
crmfb.c:(.text+0x2354): relocation truncated to fit: R_MIPS_26 against `edid_print'
 1.19  05-Nov-2010  jakllsch branches: 1.19.2;
Pave the way for detachment of pciide(4)-family ATA controllers.
 1.18  26-Nov-2009  njoly branches: 1.18.2; 1.18.4;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.
 1.17  19-Oct-2009  bouyer Remove closes 3 & 4 from my licence. Lots of thanks to Soren Jacobsen
for the booring work !
 1.16  18-Mar-2008  cube branches: 1.16.4;
Split device_t and softc for ATA devices, as well as wd(4). Other
cosmetic changes where appropriate.
 1.15  09-Feb-2007  ad branches: 1.15.20; 1.15.36; 1.15.40;
Merge newlock2 to head.
 1.14  16-Nov-2006  christos __unused removal on arguments; approved by core.
 1.13  25-Oct-2006  bouyer Map the SATA registers for SATA channels, and probe drives using them instead
of using the old PATA way. Tested with a PDC20375 (2xSATA + 1xPATA).
While there add the PDC20618-621 products (Ultra/133 controllers);
untested. Yes, it's strange to support PATA-only devices in a driver
called pdcsata, but that's how it is ...
 1.12  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.11  03-Sep-2006  xtraeme branches: 1.11.2; 1.11.4;
Add support for PDC40519 and PDC40779... from obsd.
 1.10  13-Aug-2006  dsainty Add support for the Promise PDC20771, present on the Promise FastTrak TX2300.

This support is not based on a datasheet, because a datasheet is not readily
available for this chip. However, Promise have partially open sourced their
driver for Linux, and all suggestions are that the PDC20771 is pretty similar
to other recent SATA chips.

The TX2300 has two ports, but there is unoccupied space on the board for a
third PATA port. It isn't entirely obvious how many channels the PDC20771 can
support.

The pdc205xx_drv_probe probe is necessary to avoid probing two wd* devices for
every physical device.
 1.9  26-Jun-2006  xtraeme branches: 1.9.2;
Add missing __KERNEL_RCSID()
 1.8  26-Jun-2006  xtraeme Add support for PDC20775 and PDC40518.
 1.7  20-Jun-2006  christos PR/33445: Brian Buhrow: Fix a number of problems with the pdcsata driver:

> The driver for the family of Promise SATA controllers,
> /usr/src/sys/dev/pci/pdcsata.c is not very robust when it comes to handling
> transient drive errors, or interrupt hickups when the card is under load.
> Worse, my experience seems to indicate, and the Linux driver confirms,
> that these cards tend to fall over rather frequently during high load
> operations or if drives unexpectedly reset or go to sleep. Symptoms
> include interupt timeouts during heavy load, the inability to reset drives
> if they go to sleep, and a failure of the card to generate interrupts at
> all if the interrupt load gets too high.
 1.6  26-Jan-2006  bouyer branches: 1.6.2; 1.6.6; 1.6.14;
Add support for Promise PDC2057x SATA/150 Ide controllers.
From FreeBSD, tested by Douglas Wade Needham.
 1.5  16-Jan-2006  bouyer properly use ata_channel->ch_ndrive:
- initialize it properly in the bus front-ends (all 2, exept in wdc_pcmcia.c
for the "Sandisk CompactFlash Card" where it's set to 1)
- remplace hardcoded '2' by ata_channel->ch_ndrive in MI IDE drivers.

From Christos Zoulas in kern/32501.
 1.4  04-Dec-2005  christos branches: 1.4.2;
PR/32238: Ryo Shimizu: Add support for Promise SATA300TX4 SATA Controller
(PDC40718)
 1.3  27-Feb-2005  perry branches: 1.3.2; 1.3.4; 1.3.6;
nuke trailing whitespace
 1.2  28-Nov-2004  bouyer branches: 1.2.2; 1.2.6; 1.2.8;
Add RAID support, from Shin'ichiro TAYA on current-users@.
 1.1  24-Nov-2004  bouyer pdcsata(4), a driver for the Promise SATA150 (aka PDC203xx) serie of
controllers. Tested with a PDC20375 (2 SATA, one PATA) controller on sparc64.
Added to all kernel config file which had pdcide(4).
 1.2.8.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.6.1  29-Apr-2005  kent sync with -current
 1.2.2.4  11-Dec-2005  christos Sync with head.
 1.2.2.3  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.2.2  29-Nov-2004  skrll Sync with HEAD.
 1.2.2.1  28-Nov-2004  skrll file pdcsata.c was added on branch ktrace-lwp on 2004-11-29 07:24:17 +0000
 1.3.6.4  24-Mar-2008  yamt sync with head.
 1.3.6.3  26-Feb-2007  yamt sync with head.
 1.3.6.2  30-Dec-2006  yamt sync with head.
 1.3.6.1  21-Jun-2006  yamt sync with head.
 1.3.4.3  07-Apr-2005  tron Pull up revision 1.2 via patch (requested by bouyer in ticket #1037):
Add RAID support, from Shin'ichiro TAYA on current-users@.
 1.3.4.2  02-Apr-2005  he Pull up revision 1.1 (via patch, requested by bouyer in ticket #1019):
Add pdcsata(4), a driver for the Promise SATA150 (aka PDC203xx)
series of controllers.
 1.3.4.1  27-Feb-2005  he file pdcsata.c was added on branch netbsd-2 on 2005-04-02 21:24:31 +0000
 1.3.2.4  15-Aug-2006  ghen Pull up following revision(s) (requested by xtraeme in ticket #1466):
sys/dev/pci/pcidevs: revision 1.798, 1.819
sys/dev/pci/pdcsata.c: revision 1.8, 1.10
Add support for PDC20775 and PDC40518.

Add the Promise PDC20771, present on the Promise FastTrak TX2300
Add support for the Promise PDC20771, present on the Promise FastTrak TX2300.
This support is not based on a datasheet, because a datasheet is not readily
available for this chip. However, Promise have partially open sourced their
driver for Linux, and all suggestions are that the PDC20771 is pretty similar
to other recent SATA chips.
The TX2300 has two ports, but there is unoccupied space on the board for a
third PATA port. It isn't entirely obvious how many channels the PDC20771 can
support.
The pdc205xx_drv_probe probe is necessary to avoid probing two wd* devices for
every physical device.
 1.3.2.3  28-Jul-2006  riz Pull up following revision(s) (requested by simonb in ticket #1430):
sys/dev/pci/pdcsata.c: revision 1.7
PR/33445: Brian Buhrow: Fix a number of problems with the pdcsata driver:
The driver for the family of Promise SATA controllers,
/usr/src/sys/dev/pci/pdcsata.c is not very robust when it comes to handling
transient drive errors, or interrupt hickups when the card is under load.
Worse, my experience seems to indicate, and the Linux driver confirms,
that these cards tend to fall over rather frequently during high load
operations or if drives unexpectedly reset or go to sleep. Symptoms
include interupt timeouts during heavy load, the inability to reset drives
if they go to sleep, and a failure of the card to generate interrupts at
all if the interrupt load gets too high.
--
 1.3.2.2  05-Feb-2006  riz Pull up following revision(s) (requested by bouyer in ticket #1156):
sys/dev/pci/pdcsata.c: revision 1.6
Add support for Promise PDC2057x SATA/150 Ide controllers.
From FreeBSD, tested by Douglas Wade Needham.
 1.3.2.1  21-Jan-2006  snj Pull up following revision(s) (requested by simonb in ticket #1126):
sys/dev/pci/pcidevs: revision 1.739
sys/dev/pci/pdcsata.c: revision 1.4
PR/32238: Ryo Shimizu: Add support for Promise SATA300TX4 SATA Controller
(PDC40718)
 1.4.2.1  01-Feb-2006  yamt sync with head.
 1.6.14.1  13-Jul-2006  gdamore Merge from HEAD.
 1.6.6.4  14-Sep-2006  yamt sync with head.
 1.6.6.3  03-Sep-2006  yamt sync with head.
 1.6.6.2  11-Aug-2006  yamt sync with head
 1.6.6.1  26-Jun-2006  yamt sync with head.
 1.6.2.1  09-Sep-2006  rpaulo sync with head
 1.9.2.2  07-Sep-2006  riz Pull up following revision(s) (requested by xtraeme in ticket #115):
share/man/man4/pdcsata.4: revision 1.5
sys/dev/pci/pcidevs: revision 1.827
sys/dev/pci/pcidevs: revision 1.828
sys/dev/pci/pcidevs: revision 1.829
sys/dev/pci/pdcsata.c: revision 1.11
Add some ICH8 devices... from obsd.
Add some missing devices from Promise and sort them.
Add missing PDC20265 device... removed accidentally in previous.
Add support for PDC40519 and PDC40779... from obsd.
Mention PDC40519 and PDC40779... and bump date.
 1.9.2.1  15-Aug-2006  ghen Pull up following revision(s) (requested by xtraeme in ticket #28):
sys/dev/pci/pcidevs: revision 1.819
sys/dev/pci/pcidevs.h: revision 1.819
sys/dev/pci/pcidevs_data.h: revision 1.818 (via patch)
sys/dev/pci/pdcsata.c: revision 1.10
Add the Promise PDC20771, present on the Promise FastTrak TX2300
Add support for the Promise PDC20771, present on the Promise FastTrak TX2300.
This support is not based on a datasheet, because a datasheet is not readily
available for this chip. However, Promise have partially open sourced their
driver for Linux, and all suggestions are that the PDC20771 is pretty similar
to other recent SATA chips.
The TX2300 has two ports, but there is unoccupied space on the board for a
third PATA port. It isn't entirely obvious how many channels the PDC20771 can
support.
The pdc205xx_drv_probe probe is necessary to avoid probing two wd* devices for
every physical device.
 1.11.4.2  10-Dec-2006  yamt sync with head.
 1.11.4.1  22-Oct-2006  yamt sync with head
 1.11.2.2  06-Feb-2007  ad Quiten noisy boot messages.
 1.11.2.1  18-Nov-2006  ad Sync with head.
 1.15.40.1  03-Apr-2008  mjf Sync with HEAD.
 1.15.36.1  24-Mar-2008  keiichi sync with head.
 1.15.20.1  23-Mar-2008  matt sync with HEAD
 1.16.4.1  11-Mar-2010  yamt sync with head
 1.18.4.2  21-Apr-2011  rmind sync with head
 1.18.4.1  05-Mar-2011  rmind sync with head
 1.18.2.1  06-Nov-2010  uebayasi Sync with HEAD.
 1.19.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.20.4.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.20.4.1  30-Oct-2012  yamt sync with head
 1.25.4.1  18-May-2014  rmind sync with head
 1.25.2.3  03-Dec-2017  jdolecek update from HEAD
 1.25.2.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.25.2.1  09-Oct-2012  bouyer Support transfers of up to MACHINE_MAXPHYS in all pciide variants, and ahci.
wd(4) limits its maxphys depending on the drives's capability (64k sectors
for LBA48, 256 sectors for LBA and 128 sectors for older devices).

I assumed all pciide controllers could do MACHINE_MAXPHYS transfers, but
this may not be true. The capabilities of each controller variants should be
looked at more closely.
 1.27.18.2  27-Sep-2017  jdolecek change wdc_init_shadow_regs() to accept only struct wdc_regs, it doesn't
touch anything else

factor out the probe-only struct ata_channel initialization to wdcprobe(), to
reduce duplication of logic in individual drivers, and to actually work now
that more init is needed beyond the memset()
 1.27.18.1  10-Apr-2017  jdolecek ATA infrastructure improvements to eventually support more outstanding
commands

patch by Matt Thomas
 1.29.4.1  10-Jun-2019  christos Sync with HEAD
 1.29.2.1  26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts

RSS XML Feed