Commit 8f702872 authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN: Fix up the introduced spinlocks

The reset routines are not called concurrently with other call paths,
and holding a spinlock over schedule_timeout() is plain wrong anyway.

Unfortunately, there's still quite a lot of cli() etc left, which however
are not so easy to kill since they protect IRQ handlers against filling
the tx queue, but don't even live in the same file.
parent 7c99c33b
...@@ -262,14 +262,10 @@ release_io_asuscom(struct IsdnCardState *cs) ...@@ -262,14 +262,10 @@ release_io_asuscom(struct IsdnCardState *cs)
static void static void
reset_asuscom(struct IsdnCardState *cs) reset_asuscom(struct IsdnCardState *cs)
{ {
long flags;
if (cs->subtyp == ASUS_IPAC) if (cs->subtyp == ASUS_IPAC)
writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_POTA2, 0x20); writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_POTA2, 0x20);
else else
byteout(cs->hw.asus.adr, ASUS_RESET); /* Reset On */ byteout(cs->hw.asus.adr, ASUS_RESET); /* Reset On */
save_flags(flags);
sti();
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((10*HZ)/1000); schedule_timeout((10*HZ)/1000);
if (cs->subtyp == ASUS_IPAC) if (cs->subtyp == ASUS_IPAC)
...@@ -285,7 +281,6 @@ reset_asuscom(struct IsdnCardState *cs) ...@@ -285,7 +281,6 @@ reset_asuscom(struct IsdnCardState *cs)
writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_MASK, 0xc0); writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_MASK, 0xc0);
writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_PCFG, 0x12); writereg(cs->hw.asus.adr, cs->hw.asus.isac, IPAC_PCFG, 0x12);
} }
restore_flags(flags);
} }
static int static int
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
extern const char *CardType[]; extern const char *CardType[];
static const char *avm_revision = "$Revision: 2.13.6.2 $"; static const char *avm_revision = "$Revision: 2.13.6.2 $";
static spinlock_t avm_a1_lock = SPIN_LOCK_UNLOCKED;
#define AVM_A1_STAT_ISAC 0x01 #define AVM_A1_STAT_ISAC 0x01
#define AVM_A1_STAT_HSCX 0x02 #define AVM_A1_STAT_HSCX 0x02
...@@ -180,7 +179,6 @@ setup_avm_a1(struct IsdnCard *card) ...@@ -180,7 +179,6 @@ setup_avm_a1(struct IsdnCard *card)
{ {
u_char val; u_char val;
struct IsdnCardState *cs = card->cs; struct IsdnCardState *cs = card->cs;
unsigned long flags;
char tmp[64]; char tmp[64];
strcpy(tmp, avm_revision); strcpy(tmp, avm_revision);
...@@ -255,7 +253,6 @@ setup_avm_a1(struct IsdnCard *card) ...@@ -255,7 +253,6 @@ setup_avm_a1(struct IsdnCard *card)
release_ioregs(cs, 0x1f); release_ioregs(cs, 0x1f);
return (0); return (0);
} }
spin_lock_irqsave(&avm_a1_lock, flags);
byteout(cs->hw.avm.cfg_reg, 0x0); byteout(cs->hw.avm.cfg_reg, 0x0);
HZDELAY(HZ / 5 + 1); HZDELAY(HZ / 5 + 1);
byteout(cs->hw.avm.cfg_reg, 0x1); byteout(cs->hw.avm.cfg_reg, 0x1);
...@@ -269,7 +266,6 @@ setup_avm_a1(struct IsdnCard *card) ...@@ -269,7 +266,6 @@ setup_avm_a1(struct IsdnCard *card)
HZDELAY(HZ / 5 + 1); HZDELAY(HZ / 5 + 1);
byteout(cs->hw.avm.cfg_reg, 0x0); byteout(cs->hw.avm.cfg_reg, 0x0);
HZDELAY(HZ / 5 + 1); HZDELAY(HZ / 5 + 1);
spin_unlock_irqrestore(&avm_a1_lock, flags);
val = bytein(cs->hw.avm.cfg_reg); val = bytein(cs->hw.avm.cfg_reg);
printk(KERN_INFO "AVM A1: Byte at %x is %x\n", printk(KERN_INFO "AVM A1: Byte at %x is %x\n",
......
...@@ -246,7 +246,6 @@ setup_avm_a1_pcmcia(struct IsdnCard *card) ...@@ -246,7 +246,6 @@ setup_avm_a1_pcmcia(struct IsdnCard *card)
{ {
u_char model, vers; u_char model, vers;
struct IsdnCardState *cs = card->cs; struct IsdnCardState *cs = card->cs;
unsigned long flags;
char tmp[64]; char tmp[64];
...@@ -260,7 +259,6 @@ setup_avm_a1_pcmcia(struct IsdnCard *card) ...@@ -260,7 +259,6 @@ setup_avm_a1_pcmcia(struct IsdnCard *card)
cs->irq = card->para[0]; cs->irq = card->para[0];
spin_lock_irqsave(&avm_a1p_lock, flags);
outb(cs->hw.avm.cfg_reg+ASL1_OFFSET, ASL1_W_ENABLE_S0); outb(cs->hw.avm.cfg_reg+ASL1_OFFSET, ASL1_W_ENABLE_S0);
byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET,0x00); byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET,0x00);
...@@ -271,8 +269,6 @@ setup_avm_a1_pcmcia(struct IsdnCard *card) ...@@ -271,8 +269,6 @@ setup_avm_a1_pcmcia(struct IsdnCard *card)
byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET, ASL0_W_TDISABLE|ASL0_W_TRESET); byteout(cs->hw.avm.cfg_reg+ASL0_OFFSET, ASL0_W_TDISABLE|ASL0_W_TRESET);
spin_unlock_irqrestore(&avm_a1p_lock, flags);
model = bytein(cs->hw.avm.cfg_reg+MODREG_OFFSET); model = bytein(cs->hw.avm.cfg_reg+MODREG_OFFSET);
vers = bytein(cs->hw.avm.cfg_reg+VERREG_OFFSET); vers = bytein(cs->hw.avm.cfg_reg+VERREG_OFFSET);
......
...@@ -708,11 +708,7 @@ avm_pcipnp_interrupt(int intno, void *dev_id, struct pt_regs *regs) ...@@ -708,11 +708,7 @@ avm_pcipnp_interrupt(int intno, void *dev_id, struct pt_regs *regs)
static void static void
reset_avmpcipnp(struct IsdnCardState *cs) reset_avmpcipnp(struct IsdnCardState *cs)
{ {
long flags;
printk(KERN_INFO "AVM PCI/PnP: reset\n"); printk(KERN_INFO "AVM PCI/PnP: reset\n");
save_flags(flags);
sti();
outb(AVM_STATUS0_RESET | AVM_STATUS0_DIS_TIMER, cs->hw.avm.cfg_reg + 2); outb(AVM_STATUS0_RESET | AVM_STATUS0_DIS_TIMER, cs->hw.avm.cfg_reg + 2);
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((10*HZ)/1000); /* Timeout 10ms */ schedule_timeout((10*HZ)/1000); /* Timeout 10ms */
......
...@@ -196,12 +196,8 @@ enable_bkm_int(struct IsdnCardState *cs, unsigned bEnable) ...@@ -196,12 +196,8 @@ enable_bkm_int(struct IsdnCardState *cs, unsigned bEnable)
static void static void
reset_bkm(struct IsdnCardState *cs) reset_bkm(struct IsdnCardState *cs)
{ {
long flags;
if (cs->typ == ISDN_CTYPE_BKM_A4T) { if (cs->typ == ISDN_CTYPE_BKM_A4T) {
I20_REGISTER_FILE *pI20_Regs = (I20_REGISTER_FILE *) (cs->hw.ax.base); I20_REGISTER_FILE *pI20_Regs = (I20_REGISTER_FILE *) (cs->hw.ax.base);
save_flags(flags);
sti();
/* Issue the I20 soft reset */ /* Issue the I20 soft reset */
pI20_Regs->i20SysControl = 0xFF; /* all in */ pI20_Regs->i20SysControl = 0xFF; /* all in */
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
...@@ -228,7 +224,6 @@ reset_bkm(struct IsdnCardState *cs) ...@@ -228,7 +224,6 @@ reset_bkm(struct IsdnCardState *cs)
g_A4T_ISAR_RES); g_A4T_ISAR_RES);
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((10 * HZ) / 1000); schedule_timeout((10 * HZ) / 1000);
restore_flags(flags);
} }
} }
......
...@@ -221,19 +221,14 @@ enable_bkm_int(struct IsdnCardState *cs, unsigned bEnable) ...@@ -221,19 +221,14 @@ enable_bkm_int(struct IsdnCardState *cs, unsigned bEnable)
static void static void
reset_bkm(struct IsdnCardState *cs) reset_bkm(struct IsdnCardState *cs)
{ {
long flags;
if (cs->subtyp == SCT_1) { if (cs->subtyp == SCT_1) {
wordout(cs->hw.ax.plx_adr + 0x50, (wordin(cs->hw.ax.plx_adr + 0x50) & ~4)); wordout(cs->hw.ax.plx_adr + 0x50, (wordin(cs->hw.ax.plx_adr + 0x50) & ~4));
save_flags(flags);
sti();
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((10 * HZ) / 1000); schedule_timeout((10 * HZ) / 1000);
/* Remove the soft reset */ /* Remove the soft reset */
wordout(cs->hw.ax.plx_adr + 0x50, (wordin(cs->hw.ax.plx_adr + 0x50) | 4)); wordout(cs->hw.ax.plx_adr + 0x50, (wordin(cs->hw.ax.plx_adr + 0x50) | 4));
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((10 * HZ) / 1000); schedule_timeout((10 * HZ) / 1000);
restore_flags(flags);
} }
} }
......
...@@ -787,15 +787,12 @@ void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...) ...@@ -787,15 +787,12 @@ void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...)
int ll_run(struct IsdnCardState *cs, int addfeatures) int ll_run(struct IsdnCardState *cs, int addfeatures)
{ {
unsigned long flags;
isdn_ctrl ic; isdn_ctrl ic;
spin_lock_irqsave(&hisax_config_lock, flags);
ic.driver = cs->myid; ic.driver = cs->myid;
ic.command = ISDN_STAT_RUN; ic.command = ISDN_STAT_RUN;
cs->iif.features |= addfeatures; cs->iif.features |= addfeatures;
cs->iif.statcallb(&ic); cs->iif.statcallb(&ic);
spin_unlock_irqrestore(&hisax_config_lock, flags);
return 0; return 0;
} }
...@@ -856,18 +853,16 @@ static void closecard(int cardnr) ...@@ -856,18 +853,16 @@ static void closecard(int cardnr)
static int __devinit init_card(struct IsdnCardState *cs) static int __devinit init_card(struct IsdnCardState *cs)
{ {
int irq_cnt, cnt = 3; int irq_cnt, cnt = 3;
unsigned long flags;
if (!cs->irq) if (!cs->irq)
return cs->cardmsg(cs, CARD_INIT, NULL); return cs->cardmsg(cs, CARD_INIT, NULL);
spin_lock_irqsave(&hisax_config_lock, flags);
irq_cnt = kstat_irqs(cs->irq); irq_cnt = kstat_irqs(cs->irq);
printk(KERN_INFO "%s: IRQ %d count %d\n", CardType[cs->typ], printk(KERN_INFO "%s: IRQ %d count %d\n", CardType[cs->typ],
cs->irq, irq_cnt); cs->irq, irq_cnt);
if (request_irq(cs->irq, cs->irq_func, cs->irq_flags, "HiSax", cs)) { if (request_irq(cs->irq, cs->irq_func, cs->irq_flags, "HiSax", cs)) {
printk(KERN_WARNING "HiSax: couldn't get interrupt %d\n", printk(KERN_WARNING "HiSax: couldn't get interrupt %d\n",
cs->irq); cs->irq);
spin_unlock_irqrestore(&hisax_config_lock, flags);
return 1; return 1;
} }
while (cnt) { while (cnt) {
...@@ -875,7 +870,6 @@ static int __devinit init_card(struct IsdnCardState *cs) ...@@ -875,7 +870,6 @@ static int __devinit init_card(struct IsdnCardState *cs)
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
/* Timeout 10ms */ /* Timeout 10ms */
schedule_timeout((10 * HZ) / 1000); schedule_timeout((10 * HZ) / 1000);
spin_unlock_irqrestore(&hisax_config_lock, flags);
printk(KERN_INFO "%s: IRQ %d count %d\n", printk(KERN_INFO "%s: IRQ %d count %d\n",
CardType[cs->typ], cs->irq, kstat_irqs(cs->irq)); CardType[cs->typ], cs->irq, kstat_irqs(cs->irq));
if (kstat_irqs(cs->irq) == irq_cnt) { if (kstat_irqs(cs->irq) == irq_cnt) {
...@@ -894,18 +888,15 @@ static int __devinit init_card(struct IsdnCardState *cs) ...@@ -894,18 +888,15 @@ static int __devinit init_card(struct IsdnCardState *cs)
return 0; return 0;
} }
} }
spin_unlock_irqrestore(&hisax_config_lock, flags);
return 3; return 3;
} }
static int __devinit checkcard(int cardnr, char *id, int *busy_flag) static int __devinit checkcard(int cardnr, char *id, int *busy_flag)
{ {
unsigned long flags;
int ret = 0; int ret = 0;
struct IsdnCard *card = cards + cardnr; struct IsdnCard *card = cards + cardnr;
struct IsdnCardState *cs; struct IsdnCardState *cs;
spin_lock_irqsave(&hisax_config_lock, flags);
cs = kmalloc(sizeof(struct IsdnCardState), GFP_ATOMIC); cs = kmalloc(sizeof(struct IsdnCardState), GFP_ATOMIC);
if (!cs) { if (!cs) {
printk(KERN_WARNING printk(KERN_WARNING
...@@ -1212,7 +1203,6 @@ static int __devinit checkcard(int cardnr, char *id, int *busy_flag) ...@@ -1212,7 +1203,6 @@ static int __devinit checkcard(int cardnr, char *id, int *busy_flag)
kfree(cs); kfree(cs);
card->cs = NULL; card->cs = NULL;
out: out:
spin_unlock_irqrestore(&hisax_config_lock, flags);
return ret; return ret;
} }
...@@ -1538,9 +1528,7 @@ static int __init HiSax_init(void) ...@@ -1538,9 +1528,7 @@ static int __init HiSax_init(void)
static void __exit HiSax_exit(void) static void __exit HiSax_exit(void)
{ {
int cardnr = nrcards - 1; int cardnr = nrcards - 1;
unsigned long flags;
spin_lock_irqsave(&hisax_config_lock, flags);
while (cardnr >= 0) while (cardnr >= 0)
HiSax_closecard(cardnr--); HiSax_closecard(cardnr--);
Isdnl1Free(); Isdnl1Free();
...@@ -1548,7 +1536,6 @@ static void __exit HiSax_exit(void) ...@@ -1548,7 +1536,6 @@ static void __exit HiSax_exit(void)
Isdnl2Free(); Isdnl2Free();
Isdnl3Free(); Isdnl3Free();
CallcFree(); CallcFree();
spin_unlock_irqrestore(&hisax_config_lock, flags);
printk(KERN_INFO "HiSax module removed\n"); printk(KERN_INFO "HiSax module removed\n");
} }
......
...@@ -749,10 +749,6 @@ release_io_diva(struct IsdnCardState *cs) ...@@ -749,10 +749,6 @@ release_io_diva(struct IsdnCardState *cs)
static void static void
reset_diva(struct IsdnCardState *cs) reset_diva(struct IsdnCardState *cs)
{ {
long flags;
save_flags(flags);
sti();
if (cs->subtyp == DIVA_IPAC_ISA) { if (cs->subtyp == DIVA_IPAC_ISA) {
writereg(cs->hw.diva.isac_adr, cs->hw.diva.isac, IPAC_POTA2, 0x20); writereg(cs->hw.diva.isac_adr, cs->hw.diva.isac, IPAC_POTA2, 0x20);
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
...@@ -799,7 +795,6 @@ reset_diva(struct IsdnCardState *cs) ...@@ -799,7 +795,6 @@ reset_diva(struct IsdnCardState *cs)
} }
byteout(cs->hw.diva.ctrl, cs->hw.diva.ctrl_reg); byteout(cs->hw.diva.ctrl, cs->hw.diva.ctrl_reg);
} }
restore_flags(flags);
} }
#define DIVA_ASSIGN 1 #define DIVA_ASSIGN 1
......
...@@ -483,8 +483,6 @@ release_io_elsa(struct IsdnCardState *cs) ...@@ -483,8 +483,6 @@ release_io_elsa(struct IsdnCardState *cs)
static void static void
reset_elsa(struct IsdnCardState *cs) reset_elsa(struct IsdnCardState *cs)
{ {
long flags;
if (cs->hw.elsa.timer) { if (cs->hw.elsa.timer) {
/* Wait 1 Timer */ /* Wait 1 Timer */
byteout(cs->hw.elsa.timer, 0); byteout(cs->hw.elsa.timer, 0);
...@@ -504,8 +502,6 @@ reset_elsa(struct IsdnCardState *cs) ...@@ -504,8 +502,6 @@ reset_elsa(struct IsdnCardState *cs)
byteout(cs->hw.elsa.trig, 0xff); byteout(cs->hw.elsa.trig, 0xff);
} }
if ((cs->subtyp == ELSA_QS1000PCI) || (cs->subtyp == ELSA_QS3000PCI) || (cs->subtyp == ELSA_PCMCIA_IPAC)) { if ((cs->subtyp == ELSA_QS1000PCI) || (cs->subtyp == ELSA_QS3000PCI) || (cs->subtyp == ELSA_PCMCIA_IPAC)) {
save_flags(flags);
sti();
writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_POTA2, 0x20); writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_POTA2, 0x20);
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((10*HZ)/1000); /* Timeout 10ms */ schedule_timeout((10*HZ)/1000); /* Timeout 10ms */
...@@ -513,7 +509,6 @@ reset_elsa(struct IsdnCardState *cs) ...@@ -513,7 +509,6 @@ reset_elsa(struct IsdnCardState *cs)
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_MASK, 0xc0); writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_MASK, 0xc0);
schedule_timeout((10*HZ)/1000); /* Timeout 10ms */ schedule_timeout((10*HZ)/1000); /* Timeout 10ms */
restore_flags(flags);
if (cs->subtyp != ELSA_PCMCIA_IPAC) { if (cs->subtyp != ELSA_PCMCIA_IPAC) {
writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ACFG, 0x0); writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_ACFG, 0x0);
writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_AOE, 0x3c); writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_AOE, 0x3c);
...@@ -674,7 +669,6 @@ static int ...@@ -674,7 +669,6 @@ static int
Elsa_card_msg(struct IsdnCardState *cs, int mt, void *arg) Elsa_card_msg(struct IsdnCardState *cs, int mt, void *arg)
{ {
int ret = 0; int ret = 0;
long flags;
switch (mt) { switch (mt) {
case CARD_RESET: case CARD_RESET:
...@@ -703,16 +697,13 @@ Elsa_card_msg(struct IsdnCardState *cs, int mt, void *arg) ...@@ -703,16 +697,13 @@ Elsa_card_msg(struct IsdnCardState *cs, int mt, void *arg)
} else if (cs->subtyp == ELSA_QS3000PCI) { } else if (cs->subtyp == ELSA_QS3000PCI) {
ret = 0; ret = 0;
} else { } else {
save_flags(flags);
cs->hw.elsa.counter = 0; cs->hw.elsa.counter = 0;
sti();
cs->hw.elsa.ctrl_reg |= ELSA_ENA_TIMER_INT; cs->hw.elsa.ctrl_reg |= ELSA_ENA_TIMER_INT;
cs->hw.elsa.status |= ELSA_TIMER_AKTIV; cs->hw.elsa.status |= ELSA_TIMER_AKTIV;
byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg); byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg);
byteout(cs->hw.elsa.timer, 0); byteout(cs->hw.elsa.timer, 0);
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((110*HZ)/1000); schedule_timeout((110*HZ)/1000);
restore_flags(flags);
cs->hw.elsa.ctrl_reg &= ~ELSA_ENA_TIMER_INT; cs->hw.elsa.ctrl_reg &= ~ELSA_ENA_TIMER_INT;
byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg); byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg);
cs->hw.elsa.status &= ~ELSA_TIMER_AKTIV; cs->hw.elsa.status &= ~ELSA_TIMER_AKTIV;
...@@ -795,7 +786,6 @@ probe_elsa_adr(unsigned int adr, int typ) ...@@ -795,7 +786,6 @@ probe_elsa_adr(unsigned int adr, int typ)
{ {
int i, in1, in2, p16_1 = 0, p16_2 = 0, p8_1 = 0, p8_2 = 0, pc_1 = 0, int i, in1, in2, p16_1 = 0, p16_2 = 0, p8_1 = 0, p8_2 = 0, pc_1 = 0,
pc_2 = 0, pfp_1 = 0, pfp_2 = 0; pc_2 = 0, pfp_1 = 0, pfp_2 = 0;
unsigned long flags;
/* In case of the elsa pcmcia card, this region is in use, /* In case of the elsa pcmcia card, this region is in use,
reserved for us by the card manager. So we do not check it reserved for us by the card manager. So we do not check it
...@@ -806,7 +796,6 @@ probe_elsa_adr(unsigned int adr, int typ) ...@@ -806,7 +796,6 @@ probe_elsa_adr(unsigned int adr, int typ)
adr); adr);
return (0); return (0);
} }
spin_lock_irqsave(&elsa_lock, flags);
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
in1 = inb(adr + ELSA_CONFIG); /* 'toggelt' bei */ in1 = inb(adr + ELSA_CONFIG); /* 'toggelt' bei */
in2 = inb(adr + ELSA_CONFIG); /* jedem Zugriff */ in2 = inb(adr + ELSA_CONFIG); /* jedem Zugriff */
...@@ -819,7 +808,6 @@ probe_elsa_adr(unsigned int adr, int typ) ...@@ -819,7 +808,6 @@ probe_elsa_adr(unsigned int adr, int typ)
pfp_1 += 0x40 & in1; pfp_1 += 0x40 & in1;
pfp_2 += 0x40 & in2; pfp_2 += 0x40 & in2;
} }
spin_unlock_irqrestore(&elsa_lock, flags);
printk(KERN_INFO "Elsa: Probing IO 0x%x", adr); printk(KERN_INFO "Elsa: Probing IO 0x%x", adr);
if (65 == ++p16_1 * ++p16_2) { if (65 == ++p16_1 * ++p16_2) {
printk(" PCC-16/PCF found\n"); printk(" PCC-16/PCF found\n");
...@@ -874,7 +862,6 @@ static struct pci_bus *pnp_c __devinitdata = NULL; ...@@ -874,7 +862,6 @@ static struct pci_bus *pnp_c __devinitdata = NULL;
int __devinit int __devinit
setup_elsa(struct IsdnCard *card) setup_elsa(struct IsdnCard *card)
{ {
unsigned long flags;
int bytecnt; int bytecnt;
u_char val, pci_rev; u_char val, pci_rev;
struct IsdnCardState *cs = card->cs; struct IsdnCardState *cs = card->cs;
...@@ -1166,9 +1153,7 @@ setup_elsa(struct IsdnCard *card) ...@@ -1166,9 +1153,7 @@ setup_elsa(struct IsdnCard *card)
return (0); return (0);
} }
} }
spin_lock_irqsave(&elsa_lock, flags);
HZDELAY(1); /* wait >=10 ms */ HZDELAY(1); /* wait >=10 ms */
spin_unlock_irqrestore(&elsa_lock, flags);
if (TimerRun(cs)) { if (TimerRun(cs)) {
printk(KERN_WARNING "Elsa: timer do not run down\n"); printk(KERN_WARNING "Elsa: timer do not run down\n");
release_io_elsa(cs); release_io_elsa(cs);
......
...@@ -137,13 +137,9 @@ static void dummywr(struct IsdnCardState *cs, int chan, BYTE off, BYTE value) ...@@ -137,13 +137,9 @@ static void dummywr(struct IsdnCardState *cs, int chan, BYTE off, BYTE value)
static void static void
reset_enpci(struct IsdnCardState *cs) reset_enpci(struct IsdnCardState *cs)
{ {
long flags;
if (cs->debug & L1_DEB_ISAC) if (cs->debug & L1_DEB_ISAC)
debugl1(cs, "enter:now PCI: reset"); debugl1(cs, "enter:now PCI: reset");
save_flags(flags);
sti();
/* Reset on, (also for AMD) */ /* Reset on, (also for AMD) */
cs->hw.njet.ctrl_reg = 0x07; cs->hw.njet.ctrl_reg = 0x07;
OutByte(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg); OutByte(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg);
...@@ -156,13 +152,11 @@ reset_enpci(struct IsdnCardState *cs) ...@@ -156,13 +152,11 @@ reset_enpci(struct IsdnCardState *cs)
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
/* 80ms delay */ /* 80ms delay */
schedule_timeout((80*HZ)/1000); schedule_timeout((80*HZ)/1000);
restore_flags(flags);
cs->hw.njet.auxd = 0; // LED-status cs->hw.njet.auxd = 0; // LED-status
cs->hw.njet.dmactrl = 0; cs->hw.njet.dmactrl = 0;
OutByte(cs->hw.njet.base + NETJET_AUXCTRL, ~TJ_AMD_IRQ); OutByte(cs->hw.njet.base + NETJET_AUXCTRL, ~TJ_AMD_IRQ);
OutByte(cs->hw.njet.base + NETJET_IRQMASK1, TJ_AMD_IRQ); OutByte(cs->hw.njet.base + NETJET_IRQMASK1, TJ_AMD_IRQ);
OutByte(cs->hw.njet.auxa, cs->hw.njet.auxd); // LED off OutByte(cs->hw.njet.auxa, cs->hw.njet.auxd); // LED off
} }
......
...@@ -356,17 +356,14 @@ release_io_gazel(struct IsdnCardState *cs) ...@@ -356,17 +356,14 @@ release_io_gazel(struct IsdnCardState *cs)
static int static int
reset_gazel(struct IsdnCardState *cs) reset_gazel(struct IsdnCardState *cs)
{ {
unsigned long flags;
unsigned long plxcntrl, addr = cs->hw.gazel.cfg_reg; unsigned long plxcntrl, addr = cs->hw.gazel.cfg_reg;
switch (cs->subtyp) { switch (cs->subtyp) {
case R647: case R647:
spin_lock_irqsave(&gazel_lock, flags);
writereg(addr, 0, 0); writereg(addr, 0, 0);
HZDELAY(10); HZDELAY(10);
writereg(addr, 0, 1); writereg(addr, 0, 1);
HZDELAY(2); HZDELAY(2);
spin_unlock_irqrestore(&gazel_lock, flags);
break; break;
case R685: case R685:
plxcntrl = inl(addr + PLX_CNTRL); plxcntrl = inl(addr + PLX_CNTRL);
......
...@@ -64,15 +64,11 @@ release_io_hfcs(struct IsdnCardState *cs) ...@@ -64,15 +64,11 @@ release_io_hfcs(struct IsdnCardState *cs)
static void static void
reset_hfcs(struct IsdnCardState *cs) reset_hfcs(struct IsdnCardState *cs)
{ {
long flags;
printk(KERN_INFO "HFCS: resetting card\n"); printk(KERN_INFO "HFCS: resetting card\n");
cs->hw.hfcD.cirm = HFCD_RESET; cs->hw.hfcD.cirm = HFCD_RESET;
if (cs->typ == ISDN_CTYPE_TELES3C) if (cs->typ == ISDN_CTYPE_TELES3C)
cs->hw.hfcD.cirm |= HFCD_MEM8K; cs->hw.hfcD.cirm |= HFCD_MEM8K;
cs->BC_Write_Reg(cs, HFCD_DATA, HFCD_CIRM, cs->hw.hfcD.cirm); /* Reset On */ cs->BC_Write_Reg(cs, HFCD_DATA, HFCD_CIRM, cs->hw.hfcD.cirm); /* Reset On */
save_flags(flags);
sti();
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((30*HZ)/1000); schedule_timeout((30*HZ)/1000);
cs->hw.hfcD.cirm = 0; cs->hw.hfcD.cirm = 0;
...@@ -103,14 +99,11 @@ reset_hfcs(struct IsdnCardState *cs) ...@@ -103,14 +99,11 @@ reset_hfcs(struct IsdnCardState *cs)
cs->BC_Write_Reg(cs, HFCD_DATA, HFCD_MST_MODE, cs->hw.hfcD.mst_m); /* HFC Master */ cs->BC_Write_Reg(cs, HFCD_DATA, HFCD_MST_MODE, cs->hw.hfcD.mst_m); /* HFC Master */
cs->hw.hfcD.sctrl = 0; cs->hw.hfcD.sctrl = 0;
cs->BC_Write_Reg(cs, HFCD_DATA, HFCD_SCTRL, cs->hw.hfcD.sctrl); cs->BC_Write_Reg(cs, HFCD_DATA, HFCD_SCTRL, cs->hw.hfcD.sctrl);
restore_flags(flags);
} }
static int static int
hfcs_card_msg(struct IsdnCardState *cs, int mt, void *arg) hfcs_card_msg(struct IsdnCardState *cs, int mt, void *arg)
{ {
long flags;
if (cs->debug & L1_DEB_ISAC) if (cs->debug & L1_DEB_ISAC)
debugl1(cs, "HFCS: card_msg %x", mt); debugl1(cs, "HFCS: card_msg %x", mt);
switch (mt) { switch (mt) {
...@@ -124,14 +117,11 @@ hfcs_card_msg(struct IsdnCardState *cs, int mt, void *arg) ...@@ -124,14 +117,11 @@ hfcs_card_msg(struct IsdnCardState *cs, int mt, void *arg)
cs->hw.hfcD.timer.expires = jiffies + 75; cs->hw.hfcD.timer.expires = jiffies + 75;
add_timer(&cs->hw.hfcD.timer); add_timer(&cs->hw.hfcD.timer);
init2bds0(cs); init2bds0(cs);
save_flags(flags);
sti();
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((80*HZ)/1000); schedule_timeout((80*HZ)/1000);
cs->hw.hfcD.ctmt |= HFCD_TIM800; cs->hw.hfcD.ctmt |= HFCD_TIM800;
cs->BC_Write_Reg(cs, HFCD_DATA, HFCD_CTMT, cs->hw.hfcD.ctmt); cs->BC_Write_Reg(cs, HFCD_DATA, HFCD_CTMT, cs->hw.hfcD.ctmt);
cs->BC_Write_Reg(cs, HFCD_DATA, HFCD_MST_MODE, cs->hw.hfcD.mst_m); cs->BC_Write_Reg(cs, HFCD_DATA, HFCD_MST_MODE, cs->hw.hfcD.mst_m);
restore_flags(flags);
return(0); return(0);
case CARD_TEST: case CARD_TEST:
return(0); return(0);
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
extern const char *CardType[]; extern const char *CardType[];
static const char *ISurf_revision = "$Revision: 1.10.6.2 $"; static const char *ISurf_revision = "$Revision: 1.10.6.2 $";
static spinlock_t isurf_lock = SPIN_LOCK_UNLOCKED;
#define byteout(addr,val) outb(val,addr) #define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr) #define bytein(addr) inb(addr)
...@@ -135,19 +134,14 @@ release_io_isurf(struct IsdnCardState *cs) ...@@ -135,19 +134,14 @@ release_io_isurf(struct IsdnCardState *cs)
static void static void
reset_isurf(struct IsdnCardState *cs, u_char chips) reset_isurf(struct IsdnCardState *cs, u_char chips)
{ {
long flags;
printk(KERN_INFO "ISurf: resetting card\n"); printk(KERN_INFO "ISurf: resetting card\n");
byteout(cs->hw.isurf.reset, chips); /* Reset On */ byteout(cs->hw.isurf.reset, chips); /* Reset On */
save_flags(flags);
sti();
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((10*HZ)/1000); schedule_timeout((10*HZ)/1000);
byteout(cs->hw.isurf.reset, ISURF_ISAR_EA); /* Reset Off */ byteout(cs->hw.isurf.reset, ISURF_ISAR_EA); /* Reset Off */
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((10*HZ)/1000); schedule_timeout((10*HZ)/1000);
restore_flags(flags);
} }
static int static int
......
...@@ -183,18 +183,15 @@ release_io_ix1micro(struct IsdnCardState *cs) ...@@ -183,18 +183,15 @@ release_io_ix1micro(struct IsdnCardState *cs)
static void static void
ix1_reset(struct IsdnCardState *cs) ix1_reset(struct IsdnCardState *cs)
{ {
unsigned long flags;
int cnt; int cnt;
/* reset isac */ /* reset isac */
spin_lock_irqsave(&ix1_micro_lock, flags);
cnt = 3 * (HZ / 10) + 1; cnt = 3 * (HZ / 10) + 1;
while (cnt--) { while (cnt--) {
byteout(cs->hw.ix1.cfg_reg + SPECIAL_PORT_OFFSET, 1); byteout(cs->hw.ix1.cfg_reg + SPECIAL_PORT_OFFSET, 1);
HZDELAY(1); /* wait >=10 ms */ HZDELAY(1); /* wait >=10 ms */
} }
byteout(cs->hw.ix1.cfg_reg + SPECIAL_PORT_OFFSET, 0); byteout(cs->hw.ix1.cfg_reg + SPECIAL_PORT_OFFSET, 0);
spin_unlock_irqrestore(&ix1_micro_lock, flags);
} }
static int static int
......
...@@ -181,13 +181,9 @@ SaphirWatchDog(struct IsdnCardState *cs) ...@@ -181,13 +181,9 @@ SaphirWatchDog(struct IsdnCardState *cs)
void void
release_io_saphir(struct IsdnCardState *cs) release_io_saphir(struct IsdnCardState *cs)
{ {
unsigned long flags;
spin_lock_irqsave(&saphir_lock, flags);
byteout(cs->hw.saphir.cfg_reg + IRQ_REG, 0xff); byteout(cs->hw.saphir.cfg_reg + IRQ_REG, 0xff);
del_timer(&cs->hw.saphir.timer); del_timer_sync(&cs->hw.saphir.timer);
cs->hw.saphir.timer.function = NULL; cs->hw.saphir.timer.function = NULL;
spin_unlock_irqrestore(&saphir_lock, flags);
if (cs->hw.saphir.cfg_reg) if (cs->hw.saphir.cfg_reg)
release_region(cs->hw.saphir.cfg_reg, 6); release_region(cs->hw.saphir.cfg_reg, 6);
} }
...@@ -195,7 +191,6 @@ release_io_saphir(struct IsdnCardState *cs) ...@@ -195,7 +191,6 @@ release_io_saphir(struct IsdnCardState *cs)
static int static int
saphir_reset(struct IsdnCardState *cs) saphir_reset(struct IsdnCardState *cs)
{ {
long flags;
u_char irq_val; u_char irq_val;
switch(cs->irq) { switch(cs->irq) {
...@@ -218,15 +213,12 @@ saphir_reset(struct IsdnCardState *cs) ...@@ -218,15 +213,12 @@ saphir_reset(struct IsdnCardState *cs)
return (1); return (1);
} }
byteout(cs->hw.saphir.cfg_reg + IRQ_REG, irq_val); byteout(cs->hw.saphir.cfg_reg + IRQ_REG, irq_val);
save_flags(flags);
sti();
byteout(cs->hw.saphir.cfg_reg + RESET_REG, 1); byteout(cs->hw.saphir.cfg_reg + RESET_REG, 1);
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((30*HZ)/1000); /* Timeout 30ms */ schedule_timeout((30*HZ)/1000); /* Timeout 30ms */
byteout(cs->hw.saphir.cfg_reg + RESET_REG, 0); byteout(cs->hw.saphir.cfg_reg + RESET_REG, 0);
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((30*HZ)/1000); /* Timeout 30ms */ schedule_timeout((30*HZ)/1000); /* Timeout 30ms */
restore_flags(flags);
byteout(cs->hw.saphir.cfg_reg + IRQ_REG, irq_val); byteout(cs->hw.saphir.cfg_reg + IRQ_REG, irq_val);
byteout(cs->hw.saphir.cfg_reg + SPARE_REG, 0x02); byteout(cs->hw.saphir.cfg_reg + SPARE_REG, 0x02);
return (0); return (0);
......
...@@ -421,16 +421,12 @@ release_io_sedlbauer(struct IsdnCardState *cs) ...@@ -421,16 +421,12 @@ release_io_sedlbauer(struct IsdnCardState *cs)
static void static void
reset_sedlbauer(struct IsdnCardState *cs) reset_sedlbauer(struct IsdnCardState *cs)
{ {
long flags;
printk(KERN_INFO "Sedlbauer: resetting card\n"); printk(KERN_INFO "Sedlbauer: resetting card\n");
if (!((cs->hw.sedl.bus == SEDL_BUS_PCMCIA) && if (!((cs->hw.sedl.bus == SEDL_BUS_PCMCIA) &&
(cs->hw.sedl.chip == SEDL_CHIP_ISAC_HSCX))) { (cs->hw.sedl.chip == SEDL_CHIP_ISAC_HSCX))) {
if (cs->hw.sedl.chip == SEDL_CHIP_IPAC) { if (cs->hw.sedl.chip == SEDL_CHIP_IPAC) {
writereg(cs->hw.sedl.adr, cs->hw.sedl.isac, IPAC_POTA2, 0x20); writereg(cs->hw.sedl.adr, cs->hw.sedl.isac, IPAC_POTA2, 0x20);
save_flags(flags);
sti();
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((10*HZ)/1000); schedule_timeout((10*HZ)/1000);
writereg(cs->hw.sedl.adr, cs->hw.sedl.isac, IPAC_POTA2, 0x0); writereg(cs->hw.sedl.adr, cs->hw.sedl.isac, IPAC_POTA2, 0x0);
...@@ -441,28 +437,21 @@ reset_sedlbauer(struct IsdnCardState *cs) ...@@ -441,28 +437,21 @@ reset_sedlbauer(struct IsdnCardState *cs)
writereg(cs->hw.sedl.adr, cs->hw.sedl.isac, IPAC_AOE, 0x0); writereg(cs->hw.sedl.adr, cs->hw.sedl.isac, IPAC_AOE, 0x0);
writereg(cs->hw.sedl.adr, cs->hw.sedl.isac, IPAC_MASK, 0xc0); writereg(cs->hw.sedl.adr, cs->hw.sedl.isac, IPAC_MASK, 0xc0);
writereg(cs->hw.sedl.adr, cs->hw.sedl.isac, IPAC_PCFG, 0x12); writereg(cs->hw.sedl.adr, cs->hw.sedl.isac, IPAC_PCFG, 0x12);
restore_flags(flags);
} else if ((cs->hw.sedl.chip == SEDL_CHIP_ISAC_ISAR) && } else if ((cs->hw.sedl.chip == SEDL_CHIP_ISAC_ISAR) &&
(cs->hw.sedl.bus == SEDL_BUS_PCI)) { (cs->hw.sedl.bus == SEDL_BUS_PCI)) {
byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_on); byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_on);
save_flags(flags);
sti();
current->state = TASK_UNINTERRUPTIBLE; current->state = TASK_UNINTERRUPTIBLE;
schedule_timeout((20*HZ)/1000); schedule_timeout((20*HZ)/1000);
byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_off); byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_off);
current->state = TASK_UNINTERRUPTIBLE; current->state = TASK_UNINTERRUPTIBLE;
schedule_timeout((20*HZ)/1000); schedule_timeout((20*HZ)/1000);
restore_flags(flags);
} else { } else {
byteout(cs->hw.sedl.reset_on, SEDL_RESET); /* Reset On */ byteout(cs->hw.sedl.reset_on, SEDL_RESET); /* Reset On */
save_flags(flags);
sti();
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((10*HZ)/1000); schedule_timeout((10*HZ)/1000);
byteout(cs->hw.sedl.reset_off, 0); /* Reset Off */ byteout(cs->hw.sedl.reset_off, 0); /* Reset Off */
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((10*HZ)/1000); schedule_timeout((10*HZ)/1000);
restore_flags(flags);
} }
} }
} }
...@@ -551,7 +540,6 @@ setup_sedlbauer(struct IsdnCard *card) ...@@ -551,7 +540,6 @@ setup_sedlbauer(struct IsdnCard *card)
struct IsdnCardState *cs = card->cs; struct IsdnCardState *cs = card->cs;
char tmp[64]; char tmp[64];
u16 sub_vendor_id, sub_id; u16 sub_vendor_id, sub_id;
unsigned long flags;
strcpy(tmp, Sedlbauer_revision); strcpy(tmp, Sedlbauer_revision);
printk(KERN_INFO "HiSax: Sedlbauer driver Rev. %s\n", HiSax_getrev(tmp)); printk(KERN_INFO "HiSax: Sedlbauer driver Rev. %s\n", HiSax_getrev(tmp));
...@@ -684,12 +672,9 @@ setup_sedlbauer(struct IsdnCard *card) ...@@ -684,12 +672,9 @@ setup_sedlbauer(struct IsdnCard *card)
byteout(cs->hw.sedl.cfg_reg+ 2, 0xdd); byteout(cs->hw.sedl.cfg_reg+ 2, 0xdd);
byteout(cs->hw.sedl.cfg_reg+ 5, 0x02); byteout(cs->hw.sedl.cfg_reg+ 5, 0x02);
byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_on); byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_on);
save_flags(flags);
sti();
current->state = TASK_UNINTERRUPTIBLE; current->state = TASK_UNINTERRUPTIBLE;
schedule_timeout((10*HZ)/1000); schedule_timeout((10*HZ)/1000);
byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_off); byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_off);
restore_flags(flags);
#else #else
printk(KERN_WARNING "Sedlbauer: NO_PCI_BIOS\n"); printk(KERN_WARNING "Sedlbauer: NO_PCI_BIOS\n");
return (0); return (0);
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
extern const char *CardType[]; extern const char *CardType[];
const char *sportster_revision = "$Revision: 1.14.6.2 $"; const char *sportster_revision = "$Revision: 1.14.6.2 $";
static spinlock_t sportster_lock = SPIN_LOCK_UNLOCKED;
#define byteout(addr,val) outb(val,addr) #define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr) #define bytein(addr) inb(addr)
...@@ -148,19 +147,14 @@ release_io_sportster(struct IsdnCardState *cs) ...@@ -148,19 +147,14 @@ release_io_sportster(struct IsdnCardState *cs)
void void
reset_sportster(struct IsdnCardState *cs) reset_sportster(struct IsdnCardState *cs)
{ {
long flags;
cs->hw.spt.res_irq |= SPORTSTER_RESET; /* Reset On */ cs->hw.spt.res_irq |= SPORTSTER_RESET; /* Reset On */
byteout(cs->hw.spt.cfg_reg + SPORTSTER_RES_IRQ, cs->hw.spt.res_irq); byteout(cs->hw.spt.cfg_reg + SPORTSTER_RES_IRQ, cs->hw.spt.res_irq);
save_flags(flags);
sti();
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((10*HZ)/1000); schedule_timeout((10*HZ)/1000);
cs->hw.spt.res_irq &= ~SPORTSTER_RESET; /* Reset Off */ cs->hw.spt.res_irq &= ~SPORTSTER_RESET; /* Reset Off */
byteout(cs->hw.spt.cfg_reg + SPORTSTER_RES_IRQ, cs->hw.spt.res_irq); byteout(cs->hw.spt.cfg_reg + SPORTSTER_RES_IRQ, cs->hw.spt.res_irq);
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((10*HZ)/1000); schedule_timeout((10*HZ)/1000);
restore_flags(flags);
} }
static int static int
......
...@@ -219,20 +219,15 @@ release_io_TeleInt(struct IsdnCardState *cs) ...@@ -219,20 +219,15 @@ release_io_TeleInt(struct IsdnCardState *cs)
static void static void
reset_TeleInt(struct IsdnCardState *cs) reset_TeleInt(struct IsdnCardState *cs)
{ {
long flags;
printk(KERN_INFO "TeleInt: resetting card\n"); printk(KERN_INFO "TeleInt: resetting card\n");
cs->hw.hfc.cirm |= HFC_RESET; cs->hw.hfc.cirm |= HFC_RESET;
byteout(cs->hw.hfc.addr | 1, cs->hw.hfc.cirm); /* Reset On */ byteout(cs->hw.hfc.addr | 1, cs->hw.hfc.cirm); /* Reset On */
save_flags(flags);
sti();
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((30*HZ)/1000); schedule_timeout((30*HZ)/1000);
cs->hw.hfc.cirm &= ~HFC_RESET; cs->hw.hfc.cirm &= ~HFC_RESET;
byteout(cs->hw.hfc.addr | 1, cs->hw.hfc.cirm); /* Reset Off */ byteout(cs->hw.hfc.addr | 1, cs->hw.hfc.cirm); /* Reset Off */
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout((10*HZ)/1000); schedule_timeout((10*HZ)/1000);
restore_flags(flags);
} }
static int static int
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
extern const char *CardType[]; extern const char *CardType[];
const char *teles0_revision = "$Revision: 2.13.6.2 $"; const char *teles0_revision = "$Revision: 2.13.6.2 $";
static spinlock_t teles0_lock = SPIN_LOCK_UNLOCKED;
#define TELES_IOMEM_SIZE 0x400 #define TELES_IOMEM_SIZE 0x400
#define byteout(addr,val) outb(val,addr) #define byteout(addr,val) outb(val,addr)
...@@ -197,9 +196,7 @@ static int ...@@ -197,9 +196,7 @@ static int
reset_teles0(struct IsdnCardState *cs) reset_teles0(struct IsdnCardState *cs)
{ {
u_char cfval; u_char cfval;
unsigned long flags;
spin_lock_irqsave(&teles0_lock, flags);
if (cs->hw.teles0.cfg_reg) { if (cs->hw.teles0.cfg_reg) {
switch (cs->irq) { switch (cs->irq) {
case 2: case 2:
...@@ -228,7 +225,6 @@ reset_teles0(struct IsdnCardState *cs) ...@@ -228,7 +225,6 @@ reset_teles0(struct IsdnCardState *cs)
cfval = 0x0E; cfval = 0x0E;
break; break;
default: default:
spin_unlock_irqrestore(&teles0_lock, flags);
return(1); return(1);
} }
cfval |= ((cs->hw.teles0.phymem >> 9) & 0xF0); cfval |= ((cs->hw.teles0.phymem >> 9) & 0xF0);
...@@ -241,7 +237,6 @@ reset_teles0(struct IsdnCardState *cs) ...@@ -241,7 +237,6 @@ reset_teles0(struct IsdnCardState *cs)
HZDELAY(HZ / 5 + 1); HZDELAY(HZ / 5 + 1);
writeb(1, cs->hw.teles0.membase + 0x80); mb(); writeb(1, cs->hw.teles0.membase + 0x80); mb();
HZDELAY(HZ / 5 + 1); HZDELAY(HZ / 5 + 1);
spin_unlock_irqrestore(&teles0_lock, flags);
return(0); return(0);
} }
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
extern const char *CardType[]; extern const char *CardType[];
const char *teles3_revision = "$Revision: 2.17.6.2 $"; const char *teles3_revision = "$Revision: 2.17.6.2 $";
static spinlock_t teles3_lock = SPIN_LOCK_UNLOCKED;
#define byteout(addr,val) outb(val,addr) #define byteout(addr,val) outb(val,addr)
#define bytein(addr) inb(addr) #define bytein(addr) inb(addr)
...@@ -175,7 +174,6 @@ release_io_teles3(struct IsdnCardState *cs) ...@@ -175,7 +174,6 @@ release_io_teles3(struct IsdnCardState *cs)
static int static int
reset_teles3(struct IsdnCardState *cs) reset_teles3(struct IsdnCardState *cs)
{ {
unsigned long flags;
u_char irqcfg; u_char irqcfg;
if (cs->typ != ISDN_CTYPE_TELESPCMCIA) { if (cs->typ != ISDN_CTYPE_TELESPCMCIA) {
...@@ -209,27 +207,21 @@ reset_teles3(struct IsdnCardState *cs) ...@@ -209,27 +207,21 @@ reset_teles3(struct IsdnCardState *cs)
default: default:
return(1); return(1);
} }
spin_lock_irqsave(&teles3_lock, flags);
byteout(cs->hw.teles3.cfg_reg + 4, irqcfg); byteout(cs->hw.teles3.cfg_reg + 4, irqcfg);
HZDELAY(HZ / 10 + 1); HZDELAY(HZ / 10 + 1);
byteout(cs->hw.teles3.cfg_reg + 4, irqcfg | 1); byteout(cs->hw.teles3.cfg_reg + 4, irqcfg | 1);
HZDELAY(HZ / 10 + 1); HZDELAY(HZ / 10 + 1);
spin_unlock_irqrestore(&teles3_lock, flags);
} else if (cs->typ == ISDN_CTYPE_COMPAQ_ISA) { } else if (cs->typ == ISDN_CTYPE_COMPAQ_ISA) {
spin_lock_irqsave(&teles3_lock, flags);
byteout(cs->hw.teles3.cfg_reg, 0xff); byteout(cs->hw.teles3.cfg_reg, 0xff);
HZDELAY(2); HZDELAY(2);
byteout(cs->hw.teles3.cfg_reg, 0x00); byteout(cs->hw.teles3.cfg_reg, 0x00);
HZDELAY(2); HZDELAY(2);
spin_unlock_irqrestore(&teles3_lock, flags);
} else { } else {
/* Reset off for 16.3 PnP , thanks to Georg Acher */ /* Reset off for 16.3 PnP , thanks to Georg Acher */
spin_lock_irqsave(&teles3_lock, flags);
byteout(cs->hw.teles3.isac + 0x3c, 0); byteout(cs->hw.teles3.isac + 0x3c, 0);
HZDELAY(2); HZDELAY(2);
byteout(cs->hw.teles3.isac + 0x3c, 1); byteout(cs->hw.teles3.isac + 0x3c, 1);
HZDELAY(2); HZDELAY(2);
spin_unlock_irqrestore(&teles3_lock, flags);
} }
} }
return(0); return(0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment