Module Name: src Committed By: bouyer Date: Mon Apr 9 12:49:32 UTC 2018
Modified Files: src/sys/arch/amd64/conf [netbsd-8]: ALL src/sys/conf [netbsd-8]: files src/sys/dev/ic [netbsd-8]: ciss.c cissvar.h src/sys/dev/pci [netbsd-8]: ciss_pci.c Log Message: Pull up following revision(s) (requested by spz in ticket #708): sys/conf/files: revision 1.1194 sys/dev/ic/cissvar.h: revision 1.7 sys/dev/ic/ciss.c: revision 1.38 sys/dev/pci/ciss_pci.c: revision 1.14 sys/arch/amd64/conf/ALL: revision 1.81 Add a new option CISS_NO_INTERRUPT_HACK for driving ciss(4) by callouts. This is intended as workaround for certain Xen issues with dom0 kernels and will likely want to have a high HZ value as well for decent performance. To generate a diff of this commit: cvs rdiff -u -r1.59.2.3 -r1.59.2.4 src/sys/arch/amd64/conf/ALL cvs rdiff -u -r1.1173.2.4 -r1.1173.2.5 src/sys/conf/files cvs rdiff -u -r1.36.10.1 -r1.36.10.2 src/sys/dev/ic/ciss.c cvs rdiff -u -r1.6 -r1.6.22.1 src/sys/dev/ic/cissvar.h cvs rdiff -u -r1.13 -r1.13.10.1 src/sys/dev/pci/ciss_pci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/amd64/conf/ALL diff -u src/sys/arch/amd64/conf/ALL:1.59.2.3 src/sys/arch/amd64/conf/ALL:1.59.2.4 --- src/sys/arch/amd64/conf/ALL:1.59.2.3 Sun Feb 11 21:17:34 2018 +++ src/sys/arch/amd64/conf/ALL Mon Apr 9 12:49:32 2018 @@ -1,4 +1,4 @@ -# $NetBSD: ALL,v 1.59.2.3 2018/02/11 21:17:34 snj Exp $ +# $NetBSD: ALL,v 1.59.2.4 2018/04/09 12:49:32 bouyer Exp $ # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp # # ALL machine description file @@ -17,7 +17,7 @@ include "arch/amd64/conf/std.amd64" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "ALL-$Revision: 1.59.2.3 $" +#ident "ALL-$Revision: 1.59.2.4 $" maxusers 64 # estimated number of users @@ -815,6 +815,8 @@ amr* at pci? dev ? function ? # AMI/LSI arcmsr* at pci? dev ? function ? # Areca SATA RAID controllers cac* at pci? dev ? function ? # Compaq PCI array controllers ciss* at pci? dev ? function ? # HP Smart Array controllers +options CISS_NO_INTERRUPT_HACK + icp* at pci? dev ? function ? # ICP-Vortex GDT & Intel RAID mlx* at pci? dev ? function ? # Mylex DAC960 & DEC SWXCR family twa* at pci? dev ? function ? # 3ware Escalade 95xx RAID controllers Index: src/sys/conf/files diff -u src/sys/conf/files:1.1173.2.4 src/sys/conf/files:1.1173.2.5 --- src/sys/conf/files:1.1173.2.4 Sun Feb 11 21:17:34 2018 +++ src/sys/conf/files Mon Apr 9 12:49:31 2018 @@ -1,4 +1,4 @@ -# $NetBSD: files,v 1.1173.2.4 2018/02/11 21:17:34 snj Exp $ +# $NetBSD: files,v 1.1173.2.5 2018/04/09 12:49:31 bouyer Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 version 20170615 @@ -516,6 +516,7 @@ file dev/ic/ld_cac.c ld_cac # HP/Compaq Command Interface for SCSI-3 Support # +defflag opt_ciss.h CISS_NO_INTERRUPT_HACK device ciss: scsi file dev/ic/ciss.c ciss Index: src/sys/dev/ic/ciss.c diff -u src/sys/dev/ic/ciss.c:1.36.10.1 src/sys/dev/ic/ciss.c:1.36.10.2 --- src/sys/dev/ic/ciss.c:1.36.10.1 Wed Aug 9 05:18:26 2017 +++ src/sys/dev/ic/ciss.c Mon Apr 9 12:49:31 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ciss.c,v 1.36.10.1 2017/08/09 05:18:26 snj Exp $ */ +/* $NetBSD: ciss.c,v 1.36.10.2 2018/04/09 12:49:31 bouyer Exp $ */ /* $OpenBSD: ciss.c,v 1.68 2013/05/30 16:15:02 deraadt Exp $ */ /* @@ -19,7 +19,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.36.10.1 2017/08/09 05:18:26 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.36.10.2 2018/04/09 12:49:31 bouyer Exp $"); #include "bio.h" @@ -593,9 +593,11 @@ ciss_cmd(struct ciss_ccb *ccb, int flags bus_dmamap_sync(sc->sc_dmat, sc->cmdmap, 0, sc->cmdmap->dm_mapsize, BUS_DMASYNC_PREWRITE); +#ifndef CISS_NO_INTERRUPT_HACK if ((wait & (XS_CTL_POLL|XS_CTL_NOSLEEP)) == (XS_CTL_POLL|XS_CTL_NOSLEEP)) bus_space_write_4(sc->sc_iot, sc->sc_ioh, CISS_IMR, bus_space_read_4(sc->sc_iot, sc->sc_ioh, CISS_IMR) | sc->iem); +#endif mutex_enter(&sc->sc_mutex); TAILQ_INSERT_TAIL(&sc->sc_ccbq, ccb, ccb_link); @@ -637,9 +639,11 @@ ciss_cmd(struct ciss_ccb *ccb, int flags ccb->ccb_err.cmd_stat, ccb->ccb_err.scsi_stat)); } +#ifndef CISS_NO_INTERRUPT_HACK if ((wait & (XS_CTL_POLL|XS_CTL_NOSLEEP)) == (XS_CTL_POLL|XS_CTL_NOSLEEP)) bus_space_write_4(sc->sc_iot, sc->sc_ioh, CISS_IMR, bus_space_read_4(sc->sc_iot, sc->sc_ioh, CISS_IMR) & ~sc->iem); +#endif return (error); } Index: src/sys/dev/ic/cissvar.h diff -u src/sys/dev/ic/cissvar.h:1.6 src/sys/dev/ic/cissvar.h:1.6.22.1 --- src/sys/dev/ic/cissvar.h:1.6 Sat Oct 12 16:52:21 2013 +++ src/sys/dev/ic/cissvar.h Mon Apr 9 12:49:31 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: cissvar.h,v 1.6 2013/10/12 16:52:21 christos Exp $ */ +/* $NetBSD: cissvar.h,v 1.6.22.1 2018/04/09 12:49:31 bouyer Exp $ */ /* $OpenBSD: cissvar.h,v 1.15 2013/05/30 16:15:02 deraadt Exp $ */ /* @@ -24,6 +24,8 @@ #include <dev/sysmon/sysmonvar.h> #include <sys/envsys.h> +#include "opt_ciss.h" + struct ciss_ld { struct ciss_blink bling; /* a copy of blink state */ char xname[16]; /* copy of the sdN name */ @@ -43,6 +45,9 @@ struct ciss_softc { void *sc_sh; /* shutdown hook */ struct proc *sc_thread; int sc_flush; +#ifdef CISS_NO_INTERRUPT_HACK + struct callout sc_interrupt_hack; +#endif struct scsipi_channel sc_channel; struct scsipi_channel *sc_channel_raw; Index: src/sys/dev/pci/ciss_pci.c diff -u src/sys/dev/pci/ciss_pci.c:1.13 src/sys/dev/pci/ciss_pci.c:1.13.10.1 --- src/sys/dev/pci/ciss_pci.c:1.13 Thu Jul 14 04:00:46 2016 +++ src/sys/dev/pci/ciss_pci.c Mon Apr 9 12:49:31 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ciss_pci.c,v 1.13 2016/07/14 04:00:46 msaitoh Exp $ */ +/* $NetBSD: ciss_pci.c,v 1.13.10.1 2018/04/09 12:49:31 bouyer Exp $ */ /* $OpenBSD: ciss_pci.c,v 1.9 2005/12/13 15:56:01 brad Exp $ */ /* @@ -19,7 +19,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ciss_pci.c,v 1.13 2016/07/14 04:00:46 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ciss_pci.c,v 1.13.10.1 2018/04/09 12:49:31 bouyer Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -243,6 +243,20 @@ ciss_pci_match(device_t parent, cfdata_t return 0; } +#ifdef CISS_NO_INTERRUPT_HACK +static void +ciss_intr_wrapper(void *sc_) +{ + struct ciss_softc *sc = sc_; + int s; + + s = splbio(); + ciss_intr(sc); + splx(s); + callout_schedule(&sc->sc_interrupt_hack, 1); +} +#endif + void ciss_pci_attach(device_t parent, device_t self, void *aux) { @@ -256,6 +270,10 @@ ciss_pci_attach(device_t parent, device_ int i; char intrbuf[PCI_INTRSTR_LEN]; +#ifdef CISS_NO_INTERRUPT_HACK + callout_init(&sc->sc_interrupt_hack, 0); + callout_setfunc(&sc->sc_interrupt_hack, ciss_intr_wrapper, sc); +#endif sc->sc_dev = self; aprint_naive("\n"); @@ -316,8 +334,10 @@ ciss_pci_attach(device_t parent, device_ } /* disable interrupts until ready */ +#ifndef CISS_NO_INTERRUPT_HACK bus_space_write_4(sc->sc_iot, sc->sc_ioh, CISS_IMR, bus_space_read_4(sc->sc_iot, sc->sc_ioh, CISS_IMR) | sc->iem); +#endif if (pci_intr_map(pa, &ih)) { aprint_error_dev(self, "can't map interrupt\n"); @@ -350,7 +370,11 @@ ciss_pci_attach(device_t parent, device_ return; } +#ifndef CISS_NO_INTERRUPT_HACK /* enable interrupts now */ bus_space_write_4(sc->sc_iot, sc->sc_ioh, CISS_IMR, bus_space_read_4(sc->sc_iot, sc->sc_ioh, CISS_IMR) & ~sc->iem); +#else + callout_schedule(&sc->sc_interrupt_hack, 1); +#endif }