DORMANTno replies

[PATCH net-2.6 3/7] atm: [iphase] doesn't call phy->start due to a bogus #ifndef

From: chas williams - CONTRACTOR <hidden>
Date: 2008-06-16 17:27:29
Subsystem: atm, the rest · Maintainers: Chas Williams, Linus Torvalds

commit e8f40697490f1972d716326375085b0b08df13bc
Author: Jorge Boncompte [DTI2] [off-list ref]
Date:   Sat Jun 14 17:21:20 2008 -0400

    atm: [iphase] doesn't call phy->start due to a bogus #ifndef
    
    This causes the suni driver to oops if you try to use sonetdiag to get
    the statistics. Also add the corresponding phy->stop call to fix another
    oops if you try to remove the module.
    
    Signed-off-by: Jorge Boncompte [DTI2] [off-list ref]
    Signed-off-by: Chas Williams [off-list ref]
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index 1925915..14e4638 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -2557,17 +2557,11 @@ static int __devinit ia_start(struct atm_dev *dev)
 		error = suni_init(dev);
 		if (error)
 			goto err_free_rx;
-		/* 
-		 * Enable interrupt on loss of signal
-		 * SUNI_RSOP_CIE - 0x10
-		 * SUNI_RSOP_CIE_LOSE - 0x04
-		 */
-		ia_phy_put(dev, ia_phy_get(dev, 0x10) | 0x04, 0x10);
-#ifndef MODULE
-		error = dev->phy->start(dev);
-		if (error)
-			goto err_free_rx;
-#endif
+		if (dev->phy->start) {
+			error = dev->phy->start(dev);
+			if (error)
+				goto err_free_rx;
+		}
 		/* Get iadev->carrier_detect status */
 		IaFrontEndIntr(iadev);
 	}
@@ -3233,9 +3227,14 @@ static void __devexit ia_remove_one(struct pci_dev *pdev)
 	struct atm_dev *dev = pci_get_drvdata(pdev);
 	IADEV *iadev = INPH_IA_DEV(dev);
 
-	ia_phy_put(dev, ia_phy_get(dev,0x10) & ~(0x4), 0x10); 
+	/* Disable phy interrupts */
+	ia_phy_put(dev, ia_phy_get(dev, SUNI_RSOP_CIE) & ~(SUNI_RSOP_CIE_LOSE),
+				   SUNI_RSOP_CIE);
 	udelay(1);
 
+	if (dev->phy && dev->phy->stop)
+		dev->phy->stop(dev);
+
 	/* De-register device */  
       	free_irq(iadev->irq, dev);
 	iadev_count--;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help