2003-07-25 20:51:01

by Christopher Swingley

[permalink] [raw]
Subject: 2.4.6-test1, PCMCIA cards require two insertions

Greetings!

I'm running 2.6.0-test1 on an SiS based laptop with all the PCMCIA
network and serial drivers built into the kernel. When the system boots
with a PCMCIA cardbus card in place, the card doesn't show up. I unplug
the card and plug it back in, and then the kernel "sees" it and it
works. If I unplug it again, I have to go through a plug - unplug -
plug cycle before it recognizes it. As if it only recognizes the card
on even numbered insertion events.

My modem card is not a cardbus card (no gold colored strip on the top)
and it exhibits the same plug - unplug - plug requirement. If it's in
the slot when the computer boots, however, it will get set up, because
the pcmcia-cs cardmgr sets it up via the sysinit scripts.

Any thoughts on why these cards require more than one insertion before
they're recognized? Bug / feature?

Thanks,

Chris
--
Christopher S. Swingley email: [email protected]
IARC -- Frontier Program Please use encryption. GPG key at:
University of Alaska Fairbanks http://www.frontier.iarc.uaf.edu/~cswingle/


2003-07-25 21:12:00

by Bart Trojanowski

[permalink] [raw]
Subject: Re: 2.4.6-test1, PCMCIA cards require two insertions

* Christopher Swingley <[email protected]> [030725 17:12]:
> I'm running 2.6.0-test1 on an SiS based laptop with all the PCMCIA
> network and serial drivers built into the kernel. When the system boots
> with a PCMCIA cardbus card in place, the card doesn't show up. I unplug
> the card and plug it back in, and then the kernel "sees" it and it
> works. If I unplug it again, I have to go through a plug - unplug -
> plug cycle before it recognizes it. As if it only recognizes the card
> on even numbered insertion events.

I see the same on my Thinkpad (CardBus bridge: Texas Instruments PCI1450)
With any card I've tried. In addition on APM h/w suspend (ACPI didn't
work for me) I see the same thing... I have to pull out the card and put
it back in for it to be recognized.

Bart.

--
WebSig: http://www.jukie.net/~bart/sig/

2003-08-02 16:33:58

by Russell King

[permalink] [raw]
Subject: Re: 2.4.6-test1, PCMCIA cards require two insertions

On Fri, Jul 25, 2003 at 01:02:42PM -0800, Christopher Swingley wrote:
> I'm running 2.6.0-test1 on an SiS based laptop with all the PCMCIA
> network and serial drivers built into the kernel. When the system boots
> with a PCMCIA cardbus card in place, the card doesn't show up. I unplug
> the card and plug it back in, and then the kernel "sees" it and it
> works. If I unplug it again, I have to go through a plug - unplug -
> plug cycle before it recognizes it. As if it only recognizes the card
> on even numbered insertion events.

Hmm, weird - I'm not seeing that behaviour here. Can you report back
with kernel messages with the following patch applied please?

--- linux/drivers/pcmcia/cs.c.old Sat Aug 2 17:25:45 2003
+++ linux/drivers/pcmcia/cs.c Sat Aug 2 17:32:49 2003
@@ -579,6 +579,7 @@

static void socket_shutdown(struct pcmcia_socket *skt)
{
+printk("socket_shutdown: skt %p\n", skt);
socket_remove_drivers(skt);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(cs_to_timeout(shutdown_delay));
@@ -590,7 +591,7 @@
static int socket_reset(struct pcmcia_socket *skt)
{
int status, i;
-
+printk("socket_reset: skt %p\n", skt);
skt->socket.flags |= SS_OUTPUT_ENA | SS_RESET;
skt->ops->set_socket(skt, &skt->socket);
udelay((long)reset_time);
@@ -622,6 +623,7 @@
int status, i;

skt->ops->get_status(skt, &status);
+printk("socket_setup: skt %p status %08x\n", skt, status);
if (!(status & SS_DETECT))
return CS_NO_CARD;

@@ -704,7 +706,7 @@
static int socket_insert(struct pcmcia_socket *skt)
{
int ret;
-
+printk("socket_insert: skt %p\n", skt);
if (!try_module_get(skt->owner))
return CS_NO_CARD;

@@ -728,6 +730,7 @@

static int socket_suspend(struct pcmcia_socket *skt)
{
+printk("socket_suspend: skt %p state %08x\n", skt, skt->state);
if (skt->state & SOCKET_SUSPEND)
return CS_IN_USE;

@@ -748,7 +751,7 @@
static int socket_resume(struct pcmcia_socket *skt)
{
int ret;
-
+printk("socket_resume: skt %p state %08x\n", skt, skt->state);
if (!(skt->state & SOCKET_SUSPEND))
return CS_IN_USE;

@@ -782,6 +785,7 @@

static void socket_remove(struct pcmcia_socket *skt)
{
+printk("socket_remove: skt %p\n", skt);
socket_shutdown(skt);
module_put(skt->owner);
}
@@ -808,6 +812,7 @@
}

skt->ops->get_status(skt, &status);
+printk("socket %p status %08x\n", skt, status);
if ((skt->state & SOCKET_PRESENT) &&
!(status & SS_DETECT))
socket_remove(skt);
@@ -866,6 +871,7 @@

void pcmcia_parse_events(struct pcmcia_socket *s, u_int events)
{
+printk("parse_events: socket %p thread %p events %08x\n", s, s->thread, events);
if (s->thread) {
spin_lock(&s->thread_lock);
s->thread_events |= events;

--
Russell King ([email protected]) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html

2003-08-04 15:49:49

by Christopher Swingley

[permalink] [raw]
Subject: Re: 2.4.6-test1, PCMCIA cards require two insertions

Russell,

Earlier I reported:

> On Fri, Jul 25, 2003 at 01:02:42PM -0800, Christopher Swingley wrote:
> > I'm running 2.6.0-test1 on an SiS based laptop with all the PCMCIA
> > network and serial drivers built into the kernel. When the system boots
> > with a PCMCIA cardbus card in place, the card doesn't show up. I unplug
> > the card and plug it back in, and then the kernel "sees" it and it
> > works. If I unplug it again, I have to go through a plug - unplug -
> > plug cycle before it recognizes it. As if it only recognizes the card
> > on even numbered insertion events.

Still behaves the same way with a stock 2.6.0-test2. I applied the
patch you included to 2.6.0-test2. Same strange dual-insertion behavior
was noted.

Also, I have another laptop, Intel based, that doesn't show this
behavior. So it's something to do with this one.

> Hmm, weird - I'm not seeing that behaviour here. Can you report back
> with kernel messages with the following patch applied please?

Here's what happens on the console. If you want kern.log, let me know
and I'll send that along. I don't see anything different between them.

After the laptop finishes booting, the PCMCIA network card (tulip
driver) is not running.

I remove the card:

parse_events: socket df5cd82c thread df60e060 events 00000080
socket df5cd82c status 00001c00

I insert the card:

parse_events: socket df5cd82c thread df60e060 events 00000080
socket df5cd82c status 00001c80
socket_insert: skt df5cd82c
socket_setup: skt df5cd82c status 00001c80
socket_reset: skt df5cd82c
Linux Tulip driver version 1.1.13 (May 11, 2002)
<rest of tulip driver stuff snipped>

I remove the card:

parse_events: socket df5cd82c thread df60e060 events 00000080
socket df5cd82c status 00001c00
socket_remove: skt df5cd82c
socket_shutdown: skt df5cd82c status 00001c80

I insert the card:

(nothing at all)

I remove the card:

parse_events: socket df5cd82c thread df60e060 events 00000080
socket df5cd82c status 00001c00

I insert the card:

parse_events: socket df5cd82c thread df60e060 events 00000080
socket df5cd82c status 00001c80
socket_insert: skt df5cd82c
socket_setup: skt df5cd82c status 00001c80
socket_reset: skt df5cd82c
Linux Tulip driver version 1.1.13 (May 11, 2002)
<rest of tulip driver stuff snipped>

Chris
--
Christopher S. Swingley email: [email protected]
IARC -- Frontier Program Please use encryption. GPG key at:
University of Alaska Fairbanks http://www.frontier.iarc.uaf.edu/~cswingle/