diff options
author | Daniel Ritz <daniel.ritz@gmx.ch> | 2005-08-24 11:03:23 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2005-09-26 07:11:24 -0400 |
commit | a413c09094e4df714c274690928dcf8125daf7e8 (patch) | |
tree | fc7fcdbd1f85686638aa959a632cab0328abf47f /drivers/pcmcia/yenta_socket.c | |
parent | 8c3520d4eb3b1bbf2e45fbae8dcfb8db06d5e775 (diff) |
[PATCH] yenta: don't mess with bridge control register
In interrupt probing (both ISA and PCI) the bridge control register is used
to change interrupt routing to ISA or PCI by changing bit 7. But this bit
only controls the routing of card functional interrupts, not the CSC
interrupts which are used for interrupt probing.
A bad side effect of messing with this register in yenta_probe_irq() is
that it can lead to irq storms if a card is inserted and already powered by
the BIOS.
Usage in yenta_sock_init() and yenta_config_init() seem to be fishy as well.
Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/yenta_socket.c')
-rw-r--r-- | drivers/pcmcia/yenta_socket.c | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index fd2a6f892c41..53a02f085800 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c | |||
@@ -559,12 +559,6 @@ static void yenta_interrogate(struct yenta_socket *socket) | |||
559 | static int yenta_sock_init(struct pcmcia_socket *sock) | 559 | static int yenta_sock_init(struct pcmcia_socket *sock) |
560 | { | 560 | { |
561 | struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket); | 561 | struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket); |
562 | u16 bridge; | ||
563 | |||
564 | bridge = config_readw(socket, CB_BRIDGE_CONTROL) & ~CB_BRIDGE_INTR; | ||
565 | if (!socket->cb_irq) | ||
566 | bridge |= CB_BRIDGE_INTR; | ||
567 | config_writew(socket, CB_BRIDGE_CONTROL, bridge); | ||
568 | 562 | ||
569 | exca_writeb(socket, I365_GBLCTL, 0x00); | 563 | exca_writeb(socket, I365_GBLCTL, 0x00); |
570 | exca_writeb(socket, I365_GENCTL, 0x00); | 564 | exca_writeb(socket, I365_GENCTL, 0x00); |
@@ -890,16 +884,8 @@ static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mas | |||
890 | { | 884 | { |
891 | int i; | 885 | int i; |
892 | unsigned long val; | 886 | unsigned long val; |
893 | u16 bridge_ctrl; | ||
894 | u32 mask; | 887 | u32 mask; |
895 | 888 | ||
896 | /* Set up ISA irq routing to probe the ISA irqs.. */ | ||
897 | bridge_ctrl = config_readw(socket, CB_BRIDGE_CONTROL); | ||
898 | if (!(bridge_ctrl & CB_BRIDGE_INTR)) { | ||
899 | bridge_ctrl |= CB_BRIDGE_INTR; | ||
900 | config_writew(socket, CB_BRIDGE_CONTROL, bridge_ctrl); | ||
901 | } | ||
902 | |||
903 | /* | 889 | /* |
904 | * Probe for usable interrupts using the force | 890 | * Probe for usable interrupts using the force |
905 | * register to generate bogus card status events. | 891 | * register to generate bogus card status events. |
@@ -921,9 +907,6 @@ static unsigned int yenta_probe_irq(struct yenta_socket *socket, u32 isa_irq_mas | |||
921 | 907 | ||
922 | mask = probe_irq_mask(val) & 0xffff; | 908 | mask = probe_irq_mask(val) & 0xffff; |
923 | 909 | ||
924 | bridge_ctrl &= ~CB_BRIDGE_INTR; | ||
925 | config_writew(socket, CB_BRIDGE_CONTROL, bridge_ctrl); | ||
926 | |||
927 | return mask; | 910 | return mask; |
928 | } | 911 | } |
929 | 912 | ||
@@ -951,18 +934,11 @@ static irqreturn_t yenta_probe_handler(int irq, void *dev_id, struct pt_regs *re | |||
951 | /* probes the PCI interrupt, use only on override functions */ | 934 | /* probes the PCI interrupt, use only on override functions */ |
952 | static int yenta_probe_cb_irq(struct yenta_socket *socket) | 935 | static int yenta_probe_cb_irq(struct yenta_socket *socket) |
953 | { | 936 | { |
954 | u16 bridge_ctrl; | ||
955 | |||
956 | if (!socket->cb_irq) | 937 | if (!socket->cb_irq) |
957 | return -1; | 938 | return -1; |
958 | 939 | ||
959 | socket->probe_status = 0; | 940 | socket->probe_status = 0; |
960 | 941 | ||
961 | /* disable ISA interrupts */ | ||
962 | bridge_ctrl = config_readw(socket, CB_BRIDGE_CONTROL); | ||
963 | bridge_ctrl &= ~CB_BRIDGE_INTR; | ||
964 | config_writew(socket, CB_BRIDGE_CONTROL, bridge_ctrl); | ||
965 | |||
966 | if (request_irq(socket->cb_irq, yenta_probe_handler, SA_SHIRQ, "yenta", socket)) { | 942 | if (request_irq(socket->cb_irq, yenta_probe_handler, SA_SHIRQ, "yenta", socket)) { |
967 | printk(KERN_WARNING "Yenta: request_irq() in yenta_probe_cb_irq() failed!\n"); | 943 | printk(KERN_WARNING "Yenta: request_irq() in yenta_probe_cb_irq() failed!\n"); |
968 | return -1; | 944 | return -1; |
@@ -973,7 +949,7 @@ static int yenta_probe_cb_irq(struct yenta_socket *socket) | |||
973 | cb_writel(socket, CB_SOCKET_EVENT, -1); | 949 | cb_writel(socket, CB_SOCKET_EVENT, -1); |
974 | cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK); | 950 | cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK); |
975 | cb_writel(socket, CB_SOCKET_FORCE, CB_FCARDSTS); | 951 | cb_writel(socket, CB_SOCKET_FORCE, CB_FCARDSTS); |
976 | 952 | ||
977 | msleep(100); | 953 | msleep(100); |
978 | 954 | ||
979 | /* disable interrupts */ | 955 | /* disable interrupts */ |
@@ -1038,8 +1014,8 @@ static void yenta_config_init(struct yenta_socket *socket) | |||
1038 | * - PCI interrupts enabled if a PCI interrupt exists.. | 1014 | * - PCI interrupts enabled if a PCI interrupt exists.. |
1039 | */ | 1015 | */ |
1040 | bridge = config_readw(socket, CB_BRIDGE_CONTROL); | 1016 | bridge = config_readw(socket, CB_BRIDGE_CONTROL); |
1041 | bridge &= ~(CB_BRIDGE_CRST | CB_BRIDGE_PREFETCH1 | CB_BRIDGE_INTR | CB_BRIDGE_ISAEN | CB_BRIDGE_VGAEN); | 1017 | bridge &= ~(CB_BRIDGE_CRST | CB_BRIDGE_PREFETCH1 | CB_BRIDGE_ISAEN | CB_BRIDGE_VGAEN); |
1042 | bridge |= CB_BRIDGE_PREFETCH0 | CB_BRIDGE_POSTEN | CB_BRIDGE_INTR; | 1018 | bridge |= CB_BRIDGE_PREFETCH0 | CB_BRIDGE_POSTEN; |
1043 | config_writew(socket, CB_BRIDGE_CONTROL, bridge); | 1019 | config_writew(socket, CB_BRIDGE_CONTROL, bridge); |
1044 | } | 1020 | } |
1045 | 1021 | ||