summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/cy.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1999-05-28 13:23:21 +0000
committerbde <bde@FreeBSD.org>1999-05-28 13:23:21 +0000
commit7e52c731df6a87ccbaa50164c708a3fc6d4800f8 (patch)
tree64c7aa6917c22d659fd413370611c2e2ccdc1c3d /sys/i386/isa/cy.c
parent74171e7d70a316b34e4fe4b7fc72111a1819ea70 (diff)
downloadFreeBSD-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/i386/isa/cy.c')
-rw-r--r--sys/i386/isa/cy.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c
index 6947d09..93e8200 100644
--- a/sys/i386/isa/cy.c
+++ b/sys/i386/isa/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);
OpenPOWER on IntegriCloud