summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-07-30 17:31:42 +0000
committerjhb <jhb@FreeBSD.org>2002-07-30 17:31:42 +0000
commit3e7ec9829208a49a191f9e14611dfa65ccb8cd32 (patch)
tree0ce50cce2c36d8085084c56012faa32d384e4667 /sys/pci
parentb7f4c19c8b1bd286da21aee3bd871d03ac928e14 (diff)
downloadFreeBSD-src-3e7ec9829208a49a191f9e14611dfa65ccb8cd32.zip
FreeBSD-src-3e7ec9829208a49a191f9e14611dfa65ccb8cd32.tar.gz
If we get 0xffff back when reading the status register, assume the card
has gone away instead of spinning in the interrupt handler. This stops my machine from hanging when I eject a rl(4)-based cardbus card. Reviewed by: imp
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/if_rl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c
index 4ffe7a3..e5dc0be 100644
--- a/sys/pci/if_rl.c
+++ b/sys/pci/if_rl.c
@@ -1380,6 +1380,8 @@ rl_poll (struct ifnet *ifp, enum poll_cmd cmd, int count)
u_int16_t status;
status = CSR_READ_2(sc, RL_ISR);
+ if (status == 0xffff)
+ goto done;
if (status)
CSR_WRITE_2(sc, RL_ISR, status);
@@ -1426,6 +1428,9 @@ static void rl_intr(arg)
for (;;) {
status = CSR_READ_2(sc, RL_ISR);
+ /* If the card has gone away the read returns 0xffff. */
+ if (status == 0xffff)
+ break;
if (status)
CSR_WRITE_2(sc, RL_ISR, status);
OpenPOWER on IntegriCloud