mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: broonie@sirena.org.uk
To: Jeff Garzik <jeff@garzik.org>, Tim Hockin <thockin@hockin.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [patch 1/3] natsemi: Consistently use interrupt enable/disable functions
Date: Wed, 14 Mar 2007 19:49:13 +0000	[thread overview]
Message-ID: <20070314195156.690711000@sirena.org.uk> (raw)
In-Reply-To: <20070314194912.414925000@sirena.org.uk>

[-- Attachment #1: natsemi-consistent-irq-enable --]
[-- Type: text/plain, Size: 1466 bytes --]

The natsemi drivers include functions for enabling and disabling
interrupts from the chip but these are not used in all code paths.  This
patch changes the code paths that touch the interrupt enable register to
use the functions.  In all cases this adds an extra PCI read to post the
operation but since none of these are in fast paths this shouldn't be
too much of a problem.

Signed-Off-By: Mark Brown <broonie@sirena.org.uk>
Index: linux-2.6/drivers/net/natsemi.c
===================================================================
--- linux-2.6.orig/drivers/net/natsemi.c	2007-03-11 02:27:34.000000000 +0000
+++ linux-2.6/drivers/net/natsemi.c	2007-03-11 02:32:43.000000000 +0000
@@ -1712,7 +1712,7 @@
 
 	/* Enable interrupts by setting the interrupt mask. */
 	writel(DEFAULT_INTR, ioaddr + IntrMask);
-	writel(1, ioaddr + IntrEnable);
+	natsemi_irq_enable(dev);
 
 	writel(RxOn | TxOn, ioaddr + ChipCmd);
 	writel(StatsClear, ioaddr + StatsCtrl); /* Clear Stats */
@@ -3071,7 +3071,7 @@
 		 * Could be used to send a netlink message.
 		 */
 		writel(WOLPkt | LinkChange, ioaddr + IntrMask);
-		writel(1, ioaddr + IntrEnable);
+		natsemi_irq_enable(dev);
 	}
 }
 
@@ -3202,7 +3202,7 @@
 		disable_irq(dev->irq);
 		spin_lock_irq(&np->lock);
 
-		writel(0, ioaddr + IntrEnable);
+		natsemi_irq_disable(dev);
 		np->hands_off = 1;
 		natsemi_stop_rxtx(dev);
 		netif_stop_queue(dev);

--
"You grabbed my hand and we fell into it, like a daydream - or a fever."

  reply	other threads:[~2007-03-14 20:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-14 19:49 [patch 0/3] natsemi updates broonie
2007-03-14 19:49 ` broonie [this message]
2007-03-15 15:00   ` [patch 1/3] natsemi: Consistently use interrupt enable/disable functions Jeff Garzik
2007-03-14 19:49 ` [patch 2/3] natsemi: Fix NAPI for interrupt sharing broonie
2007-03-14 19:49 ` [patch 3/3] natsemi: Avoid IntrStatus lossage if RX state machine resets broonie

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=20070314195156.690711000@sirena.org.uk \
    --to=broonie@sirena.org.uk \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=thockin@hockin.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

all inboxes | Powered by JetHome®