2004-03-19 18:33:47

by Marcelo Tosatti

[permalink] [raw]
Subject: REMINDER: 2.4.25 and 2.6.x yenta detection issue


Hi,

It seems the problem reported by Silla Rizzoli is still present in 2.6.x
and 2.4.25 (both include the voltage interrogation patch by rmk).

Daniel Ritz made some efforts to fix it, but did not seem to get it right.

Just a reminder.

Maybe we should add it to the bugzilla?

---------- Forwarded message ----------
Date: Fri, 20 Feb 2004 11:36:03 +0100
From: Silla Rizzoli <[email protected]>
To: David Hinds <[email protected]>
Cc: Marcelo Tosatti <[email protected]>,
[email protected], Russell King <[email protected]>
Subject: Re: 2.4.25 yenta problem and small fix/workaround

> That is a pisser. What brand and model of laptop is this, exactly?
> Did you ever use the pcmcia-cs modules on this laptop, and if so, did
> they behave the same? Does this happen with a specific card? Which
> one(s) are you using? Does it happen if you hot insert the card, or
> only if the card is inserted at startup? What CardBus bridge do you
> have (use 'lspci -v')?
>
> As Marcello said, the change was introduced specifically to avoid this
> sort of problem, on certain other laptops.
>
> -- Dave

The laptop is an IBM R40 2681-BDG. That means P4 1.8 GHz (non-Centrino), with
chipset 845.


I own two pc cards, a Cisco Aironet 350 (AIR-PCM352) and a Option Globetrotter
GSM/GPRS card, driven using serial_cs.

The cards always get correctly recognized in they are already inserted at boot
time, but rarely if plug them in when my Gentoo has finished booting. To make
them work a cardctl insert 0 (I only have one socket) usually helps,
sometimes I have to unload/reload the pcmcia modules, and very very rarely a
reboot is needed; this happens with 2.6.x and 2.4.25. The two PC Cards behave
the same, maybe the Cisco one is a bit more picky.

You'll find a complete lspci here:
http://www.communicationvalley.it/lspci.txt

The kernel config for 2.6.3 here:
http://www.communicationvalley.it/2.6.3-oldradeon.cfg

The kernel config for 2.4.25 here:
http://www.communicationvalley.it/2.4.25.config

I only used pcmcia-cs on a distant past, but I'm downloading them now, I'll
let you know how they work very soon.

Thanks,
--
Silla Rizzoli
Communication Valley SpA
Strada Quarta 6/1D
43100 Parma
Tel: +39-0521-4980
Fax: +39-0521-498080
http://www.communicationvalley.it/




2004-03-19 21:07:34

by Russell King

[permalink] [raw]
Subject: Re: REMINDER: 2.4.25 and 2.6.x yenta detection issue

On Fri, Mar 19, 2004 at 03:14:54PM -0300, Marcelo Tosatti wrote:
> It seems the problem reported by Silla Rizzoli is still present in 2.6.x
> and 2.4.25 (both include the voltage interrogation patch by rmk).
>
> Daniel Ritz made some efforts to fix it, but did not seem to get it right.

And that effort is still going on. Daniel and Pavel have been trying
to find a good algorithm for detecting and fixing misconfigured TI
interrupt routing, and this effort is still on-going.

What would be useful is if Silla could test some of Daniel's patches
and provide feedback.

The latest 2.6 patch from Daniel is at:

http://ritz.dnsalias.org/linux/pcmcia-ti-routing-9.patch

and I'll ask that feedback is sent to linux-pcmcia and not as a reply
to this message (I'm just monitoring what's going on at present.)

Essentially, this patch needs to be well tested before it goes into
mainline.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
2.6 Serial core

2004-03-21 00:55:28

by Daniel Ritz

[permalink] [raw]
Subject: Re: REMINDER: 2.4.25 and 2.6.x yenta detection issue

On Friday 19 March 2004 22:07, Russell King wrote:
> On Fri, Mar 19, 2004 at 03:14:54PM -0300, Marcelo Tosatti wrote:
> > It seems the problem reported by Silla Rizzoli is still present in 2.6.x
> > and 2.4.25 (both include the voltage interrogation patch by rmk).
> >
> > Daniel Ritz made some efforts to fix it, but did not seem to get it right.
>
> And that effort is still going on. Daniel and Pavel have been trying
> to find a good algorithm for detecting and fixing misconfigured TI
> interrupt routing, and this effort is still on-going.
>
> What would be useful is if Silla could test some of Daniel's patches
> and provide feedback.

silla has another problem. mfunc and devctl are correct. the problems:
- in 2.4 TI1520 is not in the override list, so PCI CSC interrupts are not active
- redoing voltage interrogation: before 2.4.25 when there was no check pcmcia
was working better for silla (as long as another device was generating
interrupts) but with the check added cards are not recognized correctly.
- it looks like (i'm not sure) that the socket state is bouncing a bit after card insert
(the CDETECT bits) so yenta_get_status() returns w/o SS_PENDING too early....
the attached patch fixes it (at least for silla) and does nothing bad for me...

marcelo, please apply at least the second part of the patch which adds the TI1510/1520.

rgds
-daniel

---patch---

- add the TI1510 and TI1520 to the TI override list
- redo voltage interrogation if none of the voltage bits is set. this also does
the interrogation when there's no card or a partitial inserted card. some
bridges may have a wrong state on power up. the check was added to 2.4.25 'cos
unconditionally doing it breaks on some setups when a card is already
recognized correctly. this check is still intact with my small modification.
- in yenta_get_status() return SS_PENDING when none of the voltage bits is set
or a card is only partitiall inserted, but not if there's no card at all.


--- 1.15/drivers/pcmcia/yenta.c Tue Jan 6 11:55:05 2004
+++ edited/drivers/pcmcia/yenta.c Sat Mar 20 18:50:07 2004
@@ -135,8 +135,12 @@

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;
+
+ /* when there's may be a card -> SS_PENDING if no voltage bit is set */
+ if ((state & (CB_CDETECT1 | CB_CDETECT2)) != (CB_CDETECT1 | CB_CDETECT2))
+ if (!(state & (CB_5VCARD | CB_3VCARD | CB_XVCARD | CB_YVCARD)) ||
+ (state & (CB_CDETECT1 | CB_CDETECT2)))
+ val |= SS_PENDING;

if (state & CB_CBCARD) {
val |= SS_CARDBUS;
@@ -677,10 +681,8 @@

/* 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)))
+ cb_writel(socket, CB_SOCKET_FORCE, CB_CVSTEST);
}

/* Called at resume and initialization events */
@@ -870,6 +872,8 @@
{ PD(TI,1420), &ti_ops },
{ PD(TI,4410), &ti_ops },
{ PD(TI,4451), &ti_ops },
+ { PD(TI,1510), &ti_ops },
+ { PD(TI,1520), &ti_ops },

{ PD(RICOH,RL5C465), &ricoh_ops },
{ PD(RICOH,RL5C466), &ricoh_ops },
--- 1.85/include/linux/pci_ids.h Tue Mar 16 20:08:27 2004
+++ edited/include/linux/pci_ids.h Sat Mar 20 00:19:22 2004
@@ -660,6 +660,8 @@
#define PCI_DEVICE_ID_TI_4410 0xac41
#define PCI_DEVICE_ID_TI_4451 0xac42
#define PCI_DEVICE_ID_TI_1420 0xac51
+#define PCI_DEVICE_ID_TI_1520 0xac55
+#define PCI_DEVICE_ID_TI_1510 0xac56

#define PCI_VENDOR_ID_SONY 0x104d
#define PCI_DEVICE_ID_SONY_CXD3222 0x8039





2004-04-28 20:11:52

by Jonathan Sambrook

[permalink] [raw]
Subject: Re: REMINDER: 2.4.25 and 2.6.x yenta detection issue

At 21:07 on Fri 19/03/04, [email protected] masquerading as 'Russell King' wrote:
> On Fri, Mar 19, 2004 at 03:14:54PM -0300, Marcelo Tosatti wrote:
> > It seems the problem reported by Silla Rizzoli is still present in 2.6.x
> > and 2.4.25 (both include the voltage interrogation patch by rmk).
> >
> > Daniel Ritz made some efforts to fix it, but did not seem to get it right.
>
> And that effort is still going on. Daniel and Pavel have been trying
> to find a good algorithm for detecting and fixing misconfigured TI
> interrupt routing, and this effort is still on-going.
>
> What would be useful is if Silla could test some of Daniel's patches
> and provide feedback.
>
> The latest 2.6 patch from Daniel is at:

Any movement on 2.4.x w.r.t this?
Even a patch to get back 2.4.23 functionality whihc worked fine here
would be good (need > 2.4.25 for XFS).

Regards,
Jonathan
>
> http://ritz.dnsalias.org/linux/pcmcia-ti-routing-9.patch
>
> and I'll ask that feedback is sent to linux-pcmcia and not as a reply
> to this message (I'm just monitoring what's going on at present.)
>
> Essentially, this patch needs to be well tested before it goes into
> mainline.
>
> --
> Russell King
> Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
> maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
> 2.6 Serial core
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

--

Jonathan Sambrook
Software Developer
Designer Servers


Attachments:
(No filename) (1.68 kB)
(No filename) (189.00 B)
Download all attachments

2004-04-28 21:20:10

by Daniel Ritz

[permalink] [raw]
Subject: Re: REMINDER: 2.4.25 and 2.6.x yenta detection issue

On Wednesday 28 April 2004 21:54, Jonathan Sambrook wrote:
> At 21:07 on Fri 19/03/04, [email protected] masquerading as 'Russell King' wrote:
> > On Fri, Mar 19, 2004 at 03:14:54PM -0300, Marcelo Tosatti wrote:
> > > It seems the problem reported by Silla Rizzoli is still present in 2.6.x
> > > and 2.4.25 (both include the voltage interrogation patch by rmk).
> > >
> > > Daniel Ritz made some efforts to fix it, but did not seem to get it right.
> >
> > And that effort is still going on. Daniel and Pavel have been trying
> > to find a good algorithm for detecting and fixing misconfigured TI
> > interrupt routing, and this effort is still on-going.
> >
> > What would be useful is if Silla could test some of Daniel's patches
> > and provide feedback.
> >
> > The latest 2.6 patch from Daniel is at:
>
> Any movement on 2.4.x w.r.t this?
> Even a patch to get back 2.4.23 functionality whihc worked fine here
> would be good (need > 2.4.25 for XFS).
>

well, the 2.4 of the TI interrupt routing that is merged in 2.6 is is here since april 6:
http://ritz.dnsalias.org/linux/pcmcia-ti-routing-9_v24.patch
(yes, the 2.6 version is nicer 'cos of the nicer override handling there)

the problem silla rizzoli has is different. the patch that solved it:

--- snip ---
the CB_CDETECT1 and CB_CDETECT2 bits both needs to be 0 for the card being
recognized correctly (and one of the voltage bits need to be set).

with the patch we always redo the interrogation as longs as we're not sure
a card is really there (it would be bad to do so on some bridges). this solves
hangs of the bridge seen at least on one TI1520.

the if-statement was originally added 'cos some bridges misbehave if the
interrogation is done when a card is already correctly recognised. this is
still true with the patch.

the ti1520 that silla rizzoli has shoots itself in the head (read: hangs) and does not
regognise card insert/removal event. the card only works there if it was inserted on
boot. redoing the interrogation when there's no card kicks the bridge back into the
right state making it work...

--- 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
@@ -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 */

2004-04-29 17:38:07

by Jonathan Sambrook

[permalink] [raw]
Subject: Re: REMINDER: 2.4.25 and 2.6.x yenta detection issue

At 23:10 on Wed 28/04/04, [email protected] masquerading as 'Daniel Ritz' wrote:
> On Wednesday 28 April 2004 21:54, Jonathan Sambrook wrote:
> > At 21:07 on Fri 19/03/04, [email protected] masquerading as 'Russell King' wrote:
> > > On Fri, Mar 19, 2004 at 03:14:54PM -0300, Marcelo Tosatti wrote:
> > > > It seems the problem reported by Silla Rizzoli is still present in 2.6.x
> > > > and 2.4.25 (both include the voltage interrogation patch by rmk).
> > > >
> > > > Daniel Ritz made some efforts to fix it, but did not seem to get it right.
> > >
> > > And that effort is still going on. Daniel and Pavel have been trying
> > > to find a good algorithm for detecting and fixing misconfigured TI
> > > interrupt routing, and this effort is still on-going.
> > >
> > > What would be useful is if Silla could test some of Daniel's patches
> > > and provide feedback.
> > >
> > > The latest 2.6 patch from Daniel is at:
> >
> > Any movement on 2.4.x w.r.t this?
> > Even a patch to get back 2.4.23 functionality whihc worked fine here
> > would be good (need > 2.4.25 for XFS).
> >
>
> well, the 2.4 of the TI interrupt routing that is merged in 2.6 is is here since april 6:
> http://ritz.dnsalias.org/linux/pcmcia-ti-routing-9_v24.patch
> (yes, the 2.6 version is nicer 'cos of the nicer override handling there)
>
> the problem silla rizzoli has is different. the patch that solved it:

Hmmn.. my TI1410 is still detecting my Yenta/Orinoco based configuration
as Anonymous Memory, that's with pcmcia-ti-routing-9_v24.patch :( As I
say, was working with 2.4.22.

dmesg says:
Linux Kernel Card Services 3.1.22
options: [pci] [cardbus] [pm]
PCI: Enabling device 01:06.0 (0000 -> 0002)
Yenta TI: socket 01:06.0, mfunc 0x00001d92, devctl 0x02
Yenta TI: socket 01:06.0 probing PCI interrupt failed, trying to fix
Yenta TI: socket 01:06.0 no PCI interrupts. Fish. Please report.
Yenta ISA IRQ mask 0x0000, PCI irq 0
Socket status: 10000011
cs: IO port probe 0x0c00-0x0cff: excluding 0xcf0-0xcff
cs: IO port probe 0x0800-0x08ff: clean.
cs: IO port probe 0x0100-0x04ff: excluding 0x4d0-0x4d7
cs: IO port probe 0x0a00-0x0aff: clean.
cs: memory probe 0x40000000-0x40000fff: excluding
0x40000000-0x40001fff

lspci:
01:06.0 CardBus bridge: Texas Instruments PCI1410 PC card Cardbus
Controller (rev 01)

>
> --- snip ---
> the CB_CDETECT1 and CB_CDETECT2 bits both needs to be 0 for the card being
> recognized correctly (and one of the voltage bits need to be set).
>
> with the patch we always redo the interrogation as longs as we're not sure
> a card is really there (it would be bad to do so on some bridges). this solves
> hangs of the bridge seen at least on one TI1520.
>
> the if-statement was originally added 'cos some bridges misbehave if the
> interrogation is done when a card is already correctly recognised. this is
> still true with the patch.
>
> the ti1520 that silla rizzoli has shoots itself in the head (read: hangs) and does not
> regognise card insert/removal event. the card only works there if it was inserted on
> boot. redoing the interrogation when there's no card kicks the bridge back into the
> right state making it work...
>
> --- 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
> @@ -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 */
>

--

Jonathan Sambrook
Software Developer
Designer Servers


Attachments:
(No filename) (3.81 kB)
(No filename) (189.00 B)
Download all attachments