MIPS: Alchemy: db1200: PCMCIA carddetects must not be auto-enabled.
PATCH v3 1/1 MIPS: Alchemy: db1200: PCMCIA carddetects must not be auto-enabled.
Same issues as SD carddetects: 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 Manuel Lauss <[email protected]>
---
v3: rebase on top of latest linus git (db1xxx_ss.c changed).
v2: remove the now unnecessary locks in the socket driver irq setup code.
Please apply to 2.6.34-rc if still possible!
arch/mips/alchemy/devboards/db1200/setup.c | 10 +++++++--- drivers/pcmcia/db1xxx_ss.c | 16 ++++------------ 2 files changed, 11 insertions(+), 15 deletions(-)
arch/mips/alchemy/devboards/db1200/setup.c +7 -3
@@ -66,12 +66,16 @@ static int __init db1200_arch_init(void)set_irq_type (AU1200_GPIO7_INT ,IRQF_TRIGGER_LOW );bcsr_init_irq (DB1200_INT_BEGIN ,DB1200_INT_END ,AU1200_GPIO7_INT ); -/* do not autoenable these: CPLD has broken edge int handling, -* and the CD handler setup requires manual enabling to work -* around that. +/* insert/eject pairs: one of both is always screaming. To avoid +* issues they must not be automatically enabled when initially +* requested. */ irq_to_desc (DB1200_SD0_INSERT_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 ; }
drivers/pcmcia/db1xxx_ss.c +4 -12
@@ -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) {int ret; -unsigned long flags;if (sock->stschg_irq !=-1 ) { ret = request_irq(sock->stschg_irq, db1000_pcmcia_stschgirq,
@@ -162,30 +161,23 @@ static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock)* active one disabled. */ if (sock->board_type ==BOARD_TYPE_DB1200 ) { -local_irq_save (flags); - ret =request_irq (sock->insert_irq, db1200_pcmcia_cdirq,IRQF_DISABLED ,"pcmcia_insert" , sock); -if (ret) { -local_irq_restore (flags); +if (ret) goto out1; - } ret =request_irq (sock->eject_irq, db1200_pcmcia_cdirq,IRQF_DISABLED ,"pcmcia_eject" , sock);if (ret) {free_irq (sock->insert_irq, sock); -local_irq_restore (flags); goto out1; } -/* disable the currently active one */ +/* enable the currently silent one */ if (db1200_card_inserted (sock)) -disable_irq_nosync (sock->insert_irq); +enable_irq (sock->eject_irq);else -disable_irq_nosync (sock->eject_irq); - -local_irq_restore (flags); +enable_irq (sock->insert_irq); }else {/* all other (older) Db1x00 boards use a GPIO to show * card detection status: use both-edge triggers.
Signature · 1 line
1.7.0.4
Quoted 1 line · Manuel Lauss
Please apply to 2.6.34-rc if still possible!
Done. Is this also required for -stable kernels?
Ralf