Skip to contentSkip to conversation

PowerPC: ibm_newemac minor fixes.

PATCH In review Valentine Barshak 3 participants 7 messages Nov 23, 2007 – Nov 24, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover PowerPC: ibm_newemac minor fixes.

These patches have some minor ibm_newemac fixes.

Thanks,
Valentine.

#1 lore raw

PATCH 1/3 PowerPC: ibm_newemac correct opb_bus_freq value

The EMAC4_MR1_OBCI(freq) macro expects freg in MHz, while opb_bus_freq is kept in Hz. Correct this.

---
 drivers/net/ibm_newemac/core.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/net/ibm_newemac/core.c +1 -1
diff -pruN linux-2.6.orig/drivers/net/ibm_newemac/core.c linux-2.6/drivers/net/ibm_newemac/core.c
@@ -402,7 +402,7 @@ static u32 __emac_calc_base_mr1(struct e
 static u32 __emac4_calc_base_mr1(struct emac_instance *dev, int tx_size, int rx_size)
 {
 	u32 ret = EMAC_MR1_VLE | EMAC_MR1_IST | EMAC4_MR1_TR |
-		EMAC4_MR1_OBCI(dev->opb_bus_freq);
+		EMAC4_MR1_OBCI(dev->opb_bus_freq / 1000000);
 
 	DBG2(dev, "__emac4_calc_base_mr1" NL);
 
#2 lore raw

PATCH 2/3 PowerPC: ibm_newemac tah_ph typo fix

In reply to Valentine Barshak

This patch fixes a typo in ibm_newemac/core.c
(tah_port should be used instead of tah_ph)

---
 drivers/net/ibm_newemac/core.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/net/ibm_newemac/core.c +1 -1
diff -pruN linux-2.6.orig/drivers/net/ibm_newemac/core.c linux-2.6/drivers/net/ibm_newemac/core.c
@@ -2427,7 +2427,7 @@ static int __devinit emac_init_config(st
 	if (emac_read_uint_prop(np, "tah-device", &dev->tah_ph, 0))
 		dev->tah_ph = 0;
 	if (emac_read_uint_prop(np, "tah-channel", &dev->tah_port, 0))
-		dev->tah_ph = 0;
+		dev->tah_port = 0;
 	if (emac_read_uint_prop(np, "mdio-device", &dev->mdio_ph, 0))
 		dev->mdio_ph = 0;
 	if (emac_read_uint_prop(np, "zmii-device", &dev->zmii_ph, 0))
#3 lore raw

PATCH 3/3 PowerPC: ibm_newemac call dev_set_drvdata() before tah_reset()

In reply to Valentine Barshak

The patch moves dev_set_drvdata(&ofdev->dev, dev) up before tah_reset(ofdev) is called to avoid a NULL pointer dereference, since tah_reset uses drvdata.

---
 drivers/net/ibm_newemac/tah.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/ibm_newemac/tah.c +2 -1
diff -pruN linux-2.6.orig/drivers/net/ibm_newemac/tah.c linux-2.6/drivers/net/ibm_newemac/tah.c
@@ -116,13 +116,14 @@ static int __devinit tah_probe(struct of
 		goto err_free;
 	}
 
+	dev_set_drvdata(&ofdev->dev, dev);
+
 	/* Initialize TAH and enable IPv4 checksum verification, no TSO yet */
 	tah_reset(ofdev);
 
 	printk(KERN_INFO
 	       "TAH %s initialized\n", ofdev->node->full_name);
 	wmb();
-	dev_set_drvdata(&ofdev->dev, dev);
 
 	return 0;
#4 lore raw
In reply to Valentine Barshak
Quoted 1 line · Valentine Barshak

These patches have some minor ibm_newemac fixes.

All 3 patches look good, thanks. I'll sign them off and forward them to Jeff in my next batch.

Jeff, did you already pick up my previous drop of EMAC patches from last week for .25 or not ? If not, I will resend the whole lot along with Valentine's patches sometime next week.

Cheers,
Ben.

#5 lore raw
Quoted 10 lines · Benjamin Herrenschmidt
Quoted 1 line · Valentine Barshak

These patches have some minor ibm_newemac fixes.

All 3 patches look good, thanks. I'll sign them off and forward them to Jeff in my next batch.

Jeff, did you already pick up my previous drop of EMAC patches from last week for .25 or not ? If not, I will resend the whole lot along with Valentine's patches sometime next week.

Just got back from Thanksgiving holiday, and am about to go through the lot that's sitting in my inbox.

Just let me know what you would prefer me to do, starting from today.

Jeff

#6 lore raw
Quoted 8 lines · Jeff Garzik
Quoted 7 lines · Benjamin Herrenschmidt
Quoted 1 line · Valentine Barshak

These patches have some minor ibm_newemac fixes.

All 3 patches look good, thanks. I'll sign them off and forward them to Jeff in my next batch.

Quoted 8 lines
Quoted 3 lines

Jeff, did you already pick up my previous drop of EMAC patches from last week for .25 or not ? If not, I will resend the whole lot along with Valentine's patches sometime next week.

Just got back from Thanksgiving holiday, and am about to go through the lot that's sitting in my inbox.

Just let me know what you would prefer me to do, starting from today.

Then wait for my next batch and ignore previous patches, except the one titled "ibm_newemac: Fix possible lockup on close" which is a 2.6.24 bug fix.

Thanks !

Cheers,
Ben.