Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Add a new option CISS_NO_INTERRUPT_HACK for driving ciss...
details: https://anonhg.NetBSD.org/src/rev/6a75daa62e26
branches: trunk
changeset: 359492:6a75daa62e26
user: joerg <joerg%NetBSD.org@localhost>
date: Mon Feb 12 23:11:00 2018 +0000
description:
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.
diffstat:
sys/arch/amd64/conf/ALL | 6 ++++--
sys/conf/files | 3 ++-
sys/dev/ic/ciss.c | 8 ++++++--
sys/dev/ic/cissvar.h | 7 ++++++-
sys/dev/pci/ciss_pci.c | 28 ++++++++++++++++++++++++++--
5 files changed, 44 insertions(+), 8 deletions(-)
diffs (187 lines):
diff -r 9e41b3595264 -r 6a75daa62e26 sys/arch/amd64/conf/ALL
--- a/sys/arch/amd64/conf/ALL Mon Feb 12 22:31:04 2018 +0000
+++ b/sys/arch/amd64/conf/ALL Mon Feb 12 23:11:00 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.80 2018/01/27 21:46:54 pgoyette Exp $
+# $NetBSD: ALL,v 1.81 2018/02/12 23:11:00 joerg Exp $
# From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
#
# ALL machine description file
@@ -17,7 +17,7 @@
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "ALL-$Revision: 1.80 $"
+#ident "ALL-$Revision: 1.81 $"
maxusers 64 # estimated number of users
@@ -808,6 +808,8 @@
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
diff -r 9e41b3595264 -r 6a75daa62e26 sys/conf/files
--- a/sys/conf/files Mon Feb 12 22:31:04 2018 +0000
+++ b/sys/conf/files Mon Feb 12 23:11:00 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files,v 1.1193 2018/02/04 17:31:51 maxv Exp $
+# $NetBSD: files,v 1.1194 2018/02/12 23:11:00 joerg Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
version 20171118
@@ -518,6 +518,7 @@
# 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
diff -r 9e41b3595264 -r 6a75daa62e26 sys/dev/ic/ciss.c
--- a/sys/dev/ic/ciss.c Mon Feb 12 22:31:04 2018 +0000
+++ b/sys/dev/ic/ciss.c Mon Feb 12 23:11:00 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ciss.c,v 1.37 2017/07/28 14:49:55 riastradh Exp $ */
+/* $NetBSD: ciss.c,v 1.38 2018/02/12 23:11:00 joerg 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.37 2017/07/28 14:49:55 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.38 2018/02/12 23:11:00 joerg Exp $");
#include "bio.h"
@@ -593,9 +593,11 @@
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 @@
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);
}
diff -r 9e41b3595264 -r 6a75daa62e26 sys/dev/ic/cissvar.h
--- a/sys/dev/ic/cissvar.h Mon Feb 12 22:31:04 2018 +0000
+++ b/sys/dev/ic/cissvar.h Mon Feb 12 23:11:00 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cissvar.h,v 1.6 2013/10/12 16:52:21 christos Exp $ */
+/* $NetBSD: cissvar.h,v 1.7 2018/02/12 23:11:00 joerg 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 @@
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;
diff -r 9e41b3595264 -r 6a75daa62e26 sys/dev/pci/ciss_pci.c
--- a/sys/dev/pci/ciss_pci.c Mon Feb 12 22:31:04 2018 +0000
+++ b/sys/dev/pci/ciss_pci.c Mon Feb 12 23:11:00 2018 +0000
@@ -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.14 2018/02/12 23:11:00 joerg 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.14 2018/02/12 23:11:00 joerg Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -243,6 +243,20 @@
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 @@
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 @@
}
/* 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 @@
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
}
Home |
Main Index |
Thread Index |
Old Index