Re: test2-pre4 and pcmcia network problems

From: David Hinds (dhinds@valinux.com)
Date: Wed Jun 21 2000 - 17:12:57 EST


> I'm almost positive that it's the power sense that goes wrong, and this
> has had some changes lately.

You're correct. You must always do a CVSTEST at init time after doing
the interrupt scan: anything that writes to the SOCKET_FORCE register
leaves invalid data in the present-state register unless you do this.
Some bridges will automatically re-interrogate eventually; others will
report the wrong card type.

In the old i82365 driver, I always do the CVSTEST. Then in the
equivalent of yenta_get_status(), I set SS_PENDING if the socket
status indicates that a card interrogation is in progress, which is
what the current test in yenta_power_sense() does. That tells the
upper layers to try again later.

-- Dave

--- yenta.c.orig Sat May 20 11:28:14 2000
+++ yenta.c Wed Jun 21 15:34:50 2000
@@ -127,6 +127,8 @@
 
         val = (state & CB_3VCARD) ? SS_3VCARD : 0;
         val |= (state & CB_XVCARD) ? SS_XVCARD : 0;
+ val |= (state & (CB_CDETECT1 | CB_CDETECT2 | CB_5VCARD | CB_3VCARD
+ | CB_XVCARD | CB_YVCARD)) ? SS_PENDING : 0;
 
         if (state & CB_CBCARD) {
                 val |= SS_CARDBUS;
@@ -556,30 +558,6 @@
         }
 }
 
-/*
- * Many chipsets (all TI chips?) seem to have
- * problems sensing the power state of the card
- * that was inserted at chip init time, so force
- * it if necessary..
- */
-static void yenta_power_sense(pci_socket_t *socket)
-{
- u32 status = cb_readl(socket, CB_SOCKET_STATE);
-
- /*
- * Nothing inserted, nothing to sense..
- * ..or sense status already available.
- */
- if (status & (CB_CDETECT1 | CB_CDETECT2 | CB_5VCARD | CB_3VCARD | CB_XVCARD | CB_YVCARD))
- return;
-
- /*
- * Ho humm. It reports a card, but it doesn't report
- * any voltages. Need to redo the VS test..
- */
- cb_writel(socket, CB_SOCKET_FORCE, CB_CVSTEST);
-}
-
 /* Called at resume and initialization events */
 static int yenta_init(pci_socket_t *socket)
 {
@@ -620,7 +598,8 @@
         exca_writeb(socket, I365_GBLCTL, 0x00);
         exca_writeb(socket, I365_GENCTL, 0x00);
 
- yenta_power_sense(socket);
+ /* Redo card voltage interrogation */
+ cb_writel(socket, CB_SOCKET_FORCE, CB_CVSTEST);
 
         yenta_clear_maps(socket);
         return 0;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:22 EST