netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jorge Boncompte [DTI2]" <jorge@dti2.net>
To: netdev@vger.kernel.org
Cc: chas williams <chas@cmf.nrl.navy.mil>
Subject: [PATCH][ATM] iphase: doesn't call phy->start due to a bogus #ifndef
Date: Thu, 05 Jun 2008 18:17:00 +0200	[thread overview]
Message-ID: <4848117C.5040801@dti2.net> (raw)

	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] <jorge@dti2.net>
---
  drivers/atm/iphase.c |   25 +++++++++++++------------
  1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index 1b7090a..521d8af 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -2556,17 +2556,13 @@ 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);
  	}
@@ -3226,9 +3222,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--;
-- 


             reply	other threads:[~2008-06-05 16:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-05 16:17 Jorge Boncompte [DTI2] [this message]
2008-06-14 21:24 ` [PATCH][ATM] iphase: doesn't call phy->start due to a bogus #ifndef Chas Williams (CONTRACTOR)
2008-06-14 23:35   ` David Miller
2008-06-14 23:45     ` Chas Williams (CONTRACTOR)
2008-06-14 23:59       ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4848117C.5040801@dti2.net \
    --to=jorge@dti2.net \
    --cc=chas@cmf.nrl.navy.mil \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).