Home | History | Annotate | Download | only in pci
History log of /src/sys/dev/pci/svwsata.c
RevisionDateAuthorComments
 1.24  09-Dec-2018  jdolecek use pci_intr_establish_xname() everywhere
 1.23  06-Jun-2018  kamil branches: 1.23.2;
Enhance the syntax in order to be acceptable by Clang

Replace "((crv == 0))" with "(crv == 0)", as the intention is to check the
value, whether it is equal to 0.

This fixes kernel=GENERIC build under MKLLVM=yes.

Sponsored by <The NetBSD Foundation>
 1.22  01-Jun-2018  macallan set ATACH_DMA_BEFORE_CMD
 1.21  01-Jun-2018  macallan another G5-specific fix - do a 32bit read of the status register before
checking for channel interrupts. No more interrupt storms.
Adapted from FreeBSD
 1.20  07-Oct-2017  jdolecek branches: 1.20.2;
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.19  29-Mar-2014  christos branches: 1.19.18;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.18  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.17  28-Apr-2013  macallan branches: 1.17.4;
make this work on PowerMac G5
from Phileas Fogg
 1.16  31-Jul-2012  bouyer branches: 1.16.2;
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.15  26-Jul-2012  jakllsch Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@
 1.14  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.13  04-Apr-2011  dyoung branches: 1.13.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.12  05-Nov-2010  jakllsch branches: 1.12.2;
Pave the way for detachment of pciide(4)-family ATA controllers.
 1.11  26-Nov-2009  njoly branches: 1.11.2; 1.11.4;
Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.
 1.10  18-Mar-2008  cube branches: 1.10.4;
Split device_t and softc for ATA devices, as well as wd(4). Other
cosmetic changes where appropriate.
 1.9  05-Feb-2008  simonb branches: 1.9.2; 1.9.6;
Print the "bus-master DMA support present" message out the same
other a few other SATA drivers do. Nicer output than just a line
with ": DMA" on it...
 1.8  24-Oct-2007  xtraeme branches: 1.8.2;
- Add support for the ServerWorks HT-1000 IDE Controller in rccide.
- Add support for another ServerWorks HT-1000 SATA Controller.

From OpenBSD.
 1.7  30-Nov-2006  hannken branches: 1.7.22; 1.7.24; 1.7.28;
Enable WDC_CAPABILITY_WIDEREGS. With this change LBA48 operations no
longer wrap at 128GB.
Tested on an "ServerWorks HT-1000 SATA Controller (rev. 0x00)".

Approved by: Manuel Bouyer <bouyer@netbsd.org>
 1.6  16-Nov-2006  christos __unused removal on arguments; approved by core.
 1.5  25-Oct-2006  bouyer Use common wdc_sataprobe() where possible; explain why we can't in satalink.c
 1.4  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.3  29-Mar-2006  thorpej branches: 1.3.2; 1.3.4; 1.3.10; 1.3.14; 1.3.16; 1.3.18;
Use device_cfdata().
 1.2  07-Mar-2006  bouyer branches: 1.2.2; 1.2.4;
Also support Serverwork Frodo4, Frodo8 and HT-1000 in svwsata.
From OpenBSD.
 1.1  06-Mar-2006  bouyer branches: 1.1.2;
Add svwsata(4), a driver for Serverworks K2 SATA controllers. From
OpenBSD via Joerg Sonnenberger.
 1.1.2.1  19-Apr-2006  elad sync with head.
 1.2.4.1  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.2.2.3  01-Apr-2006  yamt sync with head.
 1.2.2.2  13-Mar-2006  yamt sync with head.
 1.2.2.1  07-Mar-2006  yamt file svwsata.c was added on branch yamt-pdpolicy on 2006-03-13 09:07:27 +0000
 1.3.18.2  10-Dec-2006  yamt sync with head.
 1.3.18.1  22-Oct-2006  yamt sync with head
 1.3.16.2  09-Sep-2006  rpaulo sync with head
 1.3.16.1  29-Mar-2006  rpaulo file svwsata.c was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:52:19 +0000
 1.3.14.2  12-Jan-2007  ad Sync with head.
 1.3.14.1  18-Nov-2006  ad Sync with head.
 1.3.10.6  24-Mar-2008  yamt sync with head.
 1.3.10.5  11-Feb-2008  yamt sync with head.
 1.3.10.4  27-Oct-2007  yamt sync with head.
 1.3.10.3  30-Dec-2006  yamt sync with head.
 1.3.10.2  21-Jun-2006  yamt sync with head.
 1.3.10.1  29-Mar-2006  yamt file svwsata.c was added on branch yamt-lazymbuf on 2006-06-21 15:05:06 +0000
 1.3.4.3  04-May-2006  tron Pull up following revision(s) (requested by jonathan in ticket #1298):
sys/dev/pci/svwsata.c: revision 1.2
share/man/man4/svwsata.4: revision 1.2
Also support Serverwork Frodo4, Frodo8 and HT-1000 in svwsata.
From OpenBSD.
 1.3.4.2  04-May-2006  tron Pull up following revision(s) (requested by jonathan in ticket #1298):
share/man/man4/pciide.4: revision 1.60
share/man/man4/Makefile: revision 1.376 via patch
sys/dev/pci/svwsata.c: revision 1.1
sys/dev/pci/files.pci: revision 1.243
sys/arch/i386/conf/INSTALL: revision 1.281
sys/dev/pci/pcidevs: revision 1.771 via patch
sys/dev/pci/pciidevar.h: revision 1.33
sys/arch/i386/conf/XEN0: revision 1.34
sys/arch/i386/conf/GENERIC: revision 1.732
sys/dev/pci/pciide_svwsata_reg.h: revision 1.1
Add svwsata(4), a driver for Serverworks K2 SATA controllers. From
OpenBSD via Joerg Sonnenberger.
 1.3.4.1  29-Mar-2006  tron file svwsata.c was added on branch netbsd-3 on 2006-05-04 12:12:07 +0000
 1.3.2.2  22-Apr-2006  simonb Sync with head.
 1.3.2.1  29-Mar-2006  simonb file svwsata.c was added on branch simonb-timecounters on 2006-04-22 11:39:16 +0000
 1.7.28.1  13-Nov-2007  bouyer Sync with HEAD
 1.7.24.2  23-Mar-2008  matt sync with HEAD
 1.7.24.1  06-Nov-2007  matt sync with HEAD
 1.7.22.1  28-Oct-2007  joerg Sync with HEAD.
 1.8.2.1  18-Feb-2008  mjf Sync with HEAD.
 1.9.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.9.2.1  24-Mar-2008  keiichi sync with head.
 1.10.4.1  11-Mar-2010  yamt sync with head
 1.11.4.2  21-Apr-2011  rmind sync with head
 1.11.4.1  05-Mar-2011  rmind sync with head
 1.11.2.1  06-Nov-2010  uebayasi Sync with HEAD.
 1.12.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.13.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.13.4.1  30-Oct-2012  yamt sync with head
 1.16.2.4  03-Dec-2017  jdolecek update from HEAD
 1.16.2.3  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.16.2.2  23-Jun-2013  tls resync from head
 1.16.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.17.4.1  18-May-2014  rmind sync with head
 1.19.18.1  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.20.2.2  26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.20.2.1  25-Jun-2018  pgoyette Sync with HEAD
 1.23.2.1  10-Jun-2019  christos Sync with HEAD

RSS XML Feed