Subject: Re: PCMCIA problem with NetBSD 1.1
To: Dave Johnson <dbj@cs.cmu.edu>
From: Simon J. Gerraty <sjg@zen.void.oz.au>
List: port-i386
Date: 12/31/1995 19:11:32
> returned from all the pcic_rd() calls in pcic_wait() is 0x5f, which doesn't
> include PCIC_READY.  The loop runs for a *long* time, then finally
> times out and the initialization fails.

This sounds very similar to what I saw on my Toshiba 2130CT with a
3com 3c589 ethernet card.   After tracking it to a sitution similar to
what you describe, Stefan suggested reducing the timeout and ignoring
the error.  The patch is below.  Since then everything works fine.  It
would appear that some chip sets do not assert the read status when
expected. 

The PPRINTF()'s are from my debugging efforts - serial consoles are
very useful. 

*** pcmcia.c.~3~        Thu Jul 13 06:57:42 1995
--- pcmcia.c    Thu Sep  7 07:58:40 1995
***************
*** 808,819 ****
        }
  #endif
  
        if ((err = PCMCIA_SERVICE(pca, link, PCMCIA_OP_WAIT,
!                                 500000, 0)) != 0)
                PPRINTF(("failed to initialize %d\n", err));
  error:
        PCMCIA_MAP_MEM(pca, link, 0, 0, 0, PCMCIA_LAST_WIN | PCMCIA_UNMAP);
        if (err != 0) {
                for (i = 0; i < pc_cf->memwin; i++) {
                        PCMCIA_MAP_MEM(pca, link,
                                       (caddr_t) pc_cf->mem[i].start,
--- 814,834 ----
        }
  #endif
  
+ 
+       PPRINTF(("pcmcia_mapcard: about to initialize...\n"));
+ 
+ 
        if ((err = PCMCIA_SERVICE(pca, link, PCMCIA_OP_WAIT,
!                                 1000, 0)) != 0)
                PPRINTF(("failed to initialize %d\n", err));
+ 
+       PPRINTF(("pcmcia_mapcard: initialize gives %d\n", err));
+       err=0;
  error:
        PCMCIA_MAP_MEM(pca, link, 0, 0, 0, PCMCIA_LAST_WIN | PCMCIA_UNMAP);
        if (err != 0) {
+               PPRINTF(("pcmcia_mapcard: unmaping\n"));
+ 
                for (i = 0; i < pc_cf->memwin; i++) {
                        PCMCIA_MAP_MEM(pca, link,
                                       (caddr_t) pc_cf->mem[i].start,