[RFC v3] PCMCIA locking updates for 2.6.34

Dominik Brodowski linux at dominikbrodowski.net
Sun Feb 21 04:21:20 EST 2010


Hey,

On Sun, Feb 21, 2010 at 07:59:37AM +0900, Komuro wrote:
> Hi,
> 
> > > eth8: command 0x5800 did not complete!
> > > eth8: command 0x5800 did not complete!
> > > eth8: command 0x5800 did not complete!
> > > eth8: command 0x5800 did not complete!
> > > eth8: command 0x5800 did not complete!
> > 
> > Actually, this error happens when the conf->ConfigIndex of the 3com card 
> > is not set up properly...
> 
> >but that is statically set to "1" in 3c589_cs.c? I'm a bit confused...
> 
> I set the ConfigIndex = 7 in 3c589_cs.c.
> 3CXEM556 works now.
> 
> -    link->conf.ConfigIndex = 1;
> +    link->conf.ConfigIndex = 7;

Hm. It's still strange: Why did it work in the past, even with ConfigIndex
statically set to 1? Will "ConfigIndex = 7" work for _all_ cards? Why do
the CIS overrides for 3c589_cs, but also for 3c574_cs both use ConfigIndex 7?
Might something like this -- which reads the ConfigIndex out of the CIS --
be the best choice to solve this issue?

Best,
	Dominik


diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 98938ea..dcf1669 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -327,6 +327,15 @@ static void tc574_detach(struct pcmcia_device *link)
 
 static const char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"};
 
+static int tc574_noop(struct pcmcia_device *p_dev,
+		cistpl_cftable_entry_t *cfg,
+		cistpl_cftable_entry_t *dflt,
+		unsigned int vcc,
+		void *priv_data)
+{
+	return 0;
+}
+
 static int tc574_config(struct pcmcia_device *link)
 {
 	struct net_device *dev = link->priv;
@@ -343,6 +352,9 @@ static int tc574_config(struct pcmcia_device *link)
 
 	dev_dbg(&link->dev, "3c574_config()\n");
 
+	/* Set ConfigIndex */
+	pcmcia_loop_config(link, tc574_noop, NULL);
+
 	link->io.IOAddrLines = 16;
 	for (i = j = 0; j < 0x400; j += 0x20) {
 		link->io.BasePort1 = j ^ 0x300;
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 322e11d..8765a14 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -239,6 +239,16 @@ static void tc589_detach(struct pcmcia_device *link)
     
 ======================================================================*/
 
+static int tc589_noop(struct pcmcia_device *p_dev,
+		cistpl_cftable_entry_t *cfg,
+		cistpl_cftable_entry_t *dflt,
+		unsigned int vcc,
+		void *priv_data)
+{
+	return 0;
+}
+
+
 static int tc589_config(struct pcmcia_device *link)
 {
     struct net_device *dev = link->priv;
@@ -259,6 +269,9 @@ static int tc589_config(struct pcmcia_device *link)
 		   "3Com card??\n");
     multi = (link->card_id == PRODID_3COM_3C562);
 
+    /* Set ConfigIndex */
+    pcmcia_loop_config(link, tc589_noop, NULL);
+
     /* For the 3c562, the base address must be xx00-xx7f */
     link->io.IOAddrLines = 16;
     for (i = j = 0; j < 0x400; j += 0x10) {





More information about the linux-pcmcia mailing list