public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.4.25 yenta problem and small fix/workaround
@ 2004-02-19 11:22 Silla Rizzoli
  2004-02-19 13:14 ` Marcelo Tosatti
  0 siblings, 1 reply; 11+ messages in thread
From: Silla Rizzoli @ 2004-02-19 11:22 UTC (permalink / raw)
  To: linux-kernel

Hello!
Inserting a PC Card in my laptop (IMB R40 2681) with kernel 2.4.25 results in 
the following message:

Feb 19 11:10:16 [kernel] cs: socket d603e000 voltage interrogation timed out

This sometimes happens with 2.6.x too, but issuing cardctl insert 0 usually 
solves the problem, however in this case it didn't. I tried to modify all the 
pcmcia_core module parameters but to no avail, the socket remained dead.

Examining the sources I noticed that 2.4.25 introduced this three line check; 
I suppose that the socket state read returns a valid state and 
cb_writel(socket, CB_SOCKET_FORCE, CB_CVSTEST) is not executed.
Removing the check and executing the last line regardless fixes the problem.
I am probably experiencing a hardware bug limited to my laptop, but I'm 
posting this small patch here just in case someone has the same problem.

Regards,
Silla Rizzoli



--- ./drivers/pcmcia/yenta.c.orig       2004-02-19 11:44:29.000000000 +0100
+++ ./drivers/pcmcia/yenta.c    2004-02-19 11:43:45.000000000 +0100
@@ -676,9 +676,6 @@
        exca_writeb(socket, I365_GENCTL, 0x00);

        /* Redo card voltage interrogation */
-       state = cb_readl(socket, CB_SOCKET_STATE);
-       if (!(state & (CB_CDETECT1 | CB_CDETECT2 | CB_5VCARD |
-                       CB_3VCARD | CB_XVCARD | CB_YVCARD)))

        cb_writel(socket, CB_SOCKET_FORCE, CB_CVSTEST);
 }

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: 2.4.25 yenta problem and small fix/workaround
@ 2004-02-20 22:31 Daniel Ritz
  2004-02-21 12:28 ` Silla Rizzoli
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Ritz @ 2004-02-20 22:31 UTC (permalink / raw)
  To: Silla Rizzoli, David Hinds; +Cc: linux-kernel

silla, does this one help?
dave, what do you think?

rgds
-daniel

patch:
the CB_CDETECT1 and CB_CDETECT2 bits both should be 0 for the card being
recognized correctly (and one of the voltage bits need to be set)

--- 1.15/drivers/pcmcia/yenta.c	Tue Jan  6 11:55:05 2004
+++ edited/drivers/pcmcia/yenta.c	Fri Feb 20 23:17:54 2004
@@ -135,8 +135,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)) ? 0 : SS_PENDING;
+	val |= (state & (CB_5VCARD | CB_3VCARD | CB_XVCARD | CB_YVCARD)) ? 0 : SS_PENDING;
+	val |= (state & (CB_CDETECT1 | CB_CDETECT2)) ? SS_PENDING : 0;
 
 	if (state & CB_CBCARD) {
 		val |= SS_CARDBUS;	
@@ -677,10 +677,9 @@
 
 	/* Redo card voltage interrogation */
 	state = cb_readl(socket, CB_SOCKET_STATE);
-	if (!(state & (CB_CDETECT1 | CB_CDETECT2 | CB_5VCARD |
-			CB_3VCARD | CB_XVCARD | CB_YVCARD)))
-		
-	cb_writel(socket, CB_SOCKET_FORCE, CB_CVSTEST);
+	if (!(state & (CB_5VCARD | CB_3VCARD | CB_XVCARD | CB_YVCARD)) ||
+	    (state & (CB_CDETECT1 | CB_CDETECT2)))
+		cb_writel(socket, CB_SOCKET_FORCE, CB_CVSTEST);
 }
 
 /* Called at resume and initialization events */


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-02-22 17:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-19 11:22 2.4.25 yenta problem and small fix/workaround Silla Rizzoli
2004-02-19 13:14 ` Marcelo Tosatti
2004-02-19 12:58   ` Silla Rizzoli
2004-02-19 20:32   ` David Hinds
2004-02-20 10:36     ` Silla Rizzoli
  -- strict thread matches above, loose matches on Subject: below --
2004-02-20 22:31 Daniel Ritz
2004-02-21 12:28 ` Silla Rizzoli
2004-02-21 17:12   ` Daniel Ritz
2004-02-22 16:03     ` Silla Rizzoli
2004-02-22 16:30       ` Russell King
2004-02-22 17:20         ` Silla Rizzoli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox