aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/cy/cy.c
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1999-05-28 13:23:21 +0000
committerBruce Evans <bde@FreeBSD.org>1999-05-28 13:23:21 +0000
commit4011dfccd24eb067e51b8fb4c27e574528a93258 (patch)
tree51abf028898f51bc6e82ef4e79c9eada4aa6c1d6 /sys/dev/cy/cy.c
parentf80db2b88147ba6c20fc80474dfbd05164c6b520 (diff)
downloadsrc-4011dfccd24eb067e51b8fb4c27e574528a93258.tar.gz
src-4011dfccd24eb067e51b8fb4c27e574528a93258.zip
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)
Notes
Notes: svn path=/head/; revision=47585
Diffstat (limited to 'sys/dev/cy/cy.c')
-rw-r--r--sys/dev/cy/cy.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index 6947d095f7bb..93e820049617 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);