diff options
author | bde <bde@FreeBSD.org> | 1999-05-28 13:23:21 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1999-05-28 13:23:21 +0000 |
commit | 7e52c731df6a87ccbaa50164c708a3fc6d4800f8 (patch) | |
tree | 64c7aa6917c22d659fd413370611c2e2ccdc1c3d /sys/dev/cy | |
parent | 74171e7d70a316b34e4fe4b7fc72111a1819ea70 (diff) | |
download | FreeBSD-src-7e52c731df6a87ccbaa50164c708a3fc6d4800f8.zip FreeBSD-src-7e52c731df6a87ccbaa50164c708a3fc6d4800f8.tar.gz |
Don't call disable_intr() when interrupts are already disabled, since
disable_intr() does non-recursive locking in the SMP case. This should
fix cy-driver-related panics when SMP is configured.
Broken in: rev.1.73 (3.1 and -current)
Diffstat (limited to 'sys/dev/cy')
-rw-r--r-- | sys/dev/cy/cy.c | 9 | ||||
-rw-r--r-- | sys/dev/cy/cy_isa.c | 9 |
2 files changed, 12 insertions, 6 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c index 6947d09..93e8200 100644 --- a/sys/dev/cy/cy.c +++ b/sys/dev/cy/cy.c @@ -27,7 +27,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: cy.c,v 1.86 1999/02/04 15:54:02 bde Exp $ + * $Id: cy.c,v 1.87 1999/04/27 11:14:54 phk Exp $ */ #include "opt_compat.h" @@ -89,6 +89,7 @@ #ifndef SMP #include <machine/lock.h> #endif +#include <machine/psl.h> #include <i386/isa/isa_device.h> #include <i386/isa/cyreg.h> @@ -2835,7 +2836,8 @@ cd_getreg(com, reg) cy_align = com->cy_align; iobase = com->iobase; ef = read_eflags(); - disable_intr(); + if (ef & PSL_I) + disable_intr(); if (basecom->car != car) cd_outb(iobase, CD1400_CAR, cy_align, basecom->car = car); val = cd_inb(iobase, reg, cy_align); @@ -2860,7 +2862,8 @@ cd_setreg(com, reg, val) cy_align = com->cy_align; iobase = com->iobase; ef = read_eflags(); - disable_intr(); + if (ef & PSL_I) + disable_intr(); if (basecom->car != car) cd_outb(iobase, CD1400_CAR, cy_align, basecom->car = car); cd_outb(iobase, reg, cy_align, val); diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c index 6947d09..93e8200 100644 --- a/sys/dev/cy/cy_isa.c +++ b/sys/dev/cy/cy_isa.c @@ -27,7 +27,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: cy.c,v 1.86 1999/02/04 15:54:02 bde Exp $ + * $Id: cy.c,v 1.87 1999/04/27 11:14:54 phk Exp $ */ #include "opt_compat.h" @@ -89,6 +89,7 @@ #ifndef SMP #include <machine/lock.h> #endif +#include <machine/psl.h> #include <i386/isa/isa_device.h> #include <i386/isa/cyreg.h> @@ -2835,7 +2836,8 @@ cd_getreg(com, reg) cy_align = com->cy_align; iobase = com->iobase; ef = read_eflags(); - disable_intr(); + if (ef & PSL_I) + disable_intr(); if (basecom->car != car) cd_outb(iobase, CD1400_CAR, cy_align, basecom->car = car); val = cd_inb(iobase, reg, cy_align); @@ -2860,7 +2862,8 @@ cd_setreg(com, reg, val) cy_align = com->cy_align; iobase = com->iobase; ef = read_eflags(); - disable_intr(); + if (ef & PSL_I) + disable_intr(); if (basecom->car != car) cd_outb(iobase, CD1400_CAR, cy_align, basecom->car = car); cd_outb(iobase, reg, cy_align, val); |