Commit 0000a539 authored by Manuel Lauss's avatar Manuel Lauss Committed by Ralf Baechle

MIPS: DB1200: PCMCIA card detection must not be auto-enabled.

Same issues as SD card detection:  One of both is always triggering and the
handlers take care to shut it up and enable the other.  To avoid messages
about "unbalanced interrupt enable/disable" they must not be automatically
enabled when initally requested.

This was not an issue with the db1200_defconfig due to fortunate timings;
on a build without network chip support the warnings appear.
Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
To: Linux-MIPS <linux-mips@linux-mips.org>
Patchwork: http://patchwork.linux-mips.org/patch/1133/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 0dfeecac
...@@ -66,12 +66,16 @@ static int __init db1200_arch_init(void) ...@@ -66,12 +66,16 @@ static int __init db1200_arch_init(void)
set_irq_type(AU1200_GPIO7_INT, IRQF_TRIGGER_LOW); set_irq_type(AU1200_GPIO7_INT, IRQF_TRIGGER_LOW);
bcsr_init_irq(DB1200_INT_BEGIN, DB1200_INT_END, AU1200_GPIO7_INT); bcsr_init_irq(DB1200_INT_BEGIN, DB1200_INT_END, AU1200_GPIO7_INT);
/* do not autoenable these: CPLD has broken edge int handling, /* insert/eject pairs: one of both is always screaming. To avoid
* and the CD handler setup requires manual enabling to work * issues they must not be automatically enabled when initially
* around that. * requested.
*/ */
irq_to_desc(DB1200_SD0_INSERT_INT)->status |= IRQ_NOAUTOEN; irq_to_desc(DB1200_SD0_INSERT_INT)->status |= IRQ_NOAUTOEN;
irq_to_desc(DB1200_SD0_EJECT_INT)->status |= IRQ_NOAUTOEN; irq_to_desc(DB1200_SD0_EJECT_INT)->status |= IRQ_NOAUTOEN;
irq_to_desc(DB1200_PC0_INSERT_INT)->status |= IRQ_NOAUTOEN;
irq_to_desc(DB1200_PC0_EJECT_INT)->status |= IRQ_NOAUTOEN;
irq_to_desc(DB1200_PC1_INSERT_INT)->status |= IRQ_NOAUTOEN;
irq_to_desc(DB1200_PC1_EJECT_INT)->status |= IRQ_NOAUTOEN;
return 0; return 0;
} }
......
...@@ -146,7 +146,6 @@ static irqreturn_t db1200_pcmcia_cdirq(int irq, void *data) ...@@ -146,7 +146,6 @@ static irqreturn_t db1200_pcmcia_cdirq(int irq, void *data)
static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock) static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock)
{ {
int ret; int ret;
unsigned long flags;
if (sock->stschg_irq != -1) { if (sock->stschg_irq != -1) {
ret = request_irq(sock->stschg_irq, db1000_pcmcia_stschgirq, ret = request_irq(sock->stschg_irq, db1000_pcmcia_stschgirq,
...@@ -162,30 +161,23 @@ static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock) ...@@ -162,30 +161,23 @@ static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock)
* active one disabled. * active one disabled.
*/ */
if (sock->board_type == BOARD_TYPE_DB1200) { if (sock->board_type == BOARD_TYPE_DB1200) {
local_irq_save(flags);
ret = request_irq(sock->insert_irq, db1200_pcmcia_cdirq, ret = request_irq(sock->insert_irq, db1200_pcmcia_cdirq,
IRQF_DISABLED, "pcmcia_insert", sock); IRQF_DISABLED, "pcmcia_insert", sock);
if (ret) { if (ret)
local_irq_restore(flags);
goto out1; goto out1;
}
ret = request_irq(sock->eject_irq, db1200_pcmcia_cdirq, ret = request_irq(sock->eject_irq, db1200_pcmcia_cdirq,
IRQF_DISABLED, "pcmcia_eject", sock); IRQF_DISABLED, "pcmcia_eject", sock);
if (ret) { if (ret) {
free_irq(sock->insert_irq, sock); free_irq(sock->insert_irq, sock);
local_irq_restore(flags);
goto out1; goto out1;
} }
/* disable the currently active one */ /* enable the currently silent one */
if (db1200_card_inserted(sock)) if (db1200_card_inserted(sock))
disable_irq_nosync(sock->insert_irq); enable_irq(sock->eject_irq);
else else
disable_irq_nosync(sock->eject_irq); enable_irq(sock->insert_irq);
local_irq_restore(flags);
} else { } else {
/* all other (older) Db1x00 boards use a GPIO to show /* all other (older) Db1x00 boards use a GPIO to show
* card detection status: use both-edge triggers. * card detection status: use both-edge triggers.
......
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