netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, pgynther@google.com, jaedon.shin@gmail.com,
	Florian Fainelli <f.fainelli@gmail.com>,
	vivien.didelot@savoirfairelinux.com,
	jerome.oufella@savoirfairelinux.com, linux@roeck-us.net,
	andrew@lunn.ch, cphealy@gmail.com, mathieu@codeaurora.org,
	jonasj76@gmail.com, andrey.volkov@nexvision.fr,
	Chris.Packham@alliedtelesis.co.nz, alexander.h.duyck@redhat.com
Subject: [PATCH net-next v2 1/4] net: bcmgenet: Add netconsole support
Date: Fri, 31 Jul 2015 11:42:54 -0700	[thread overview]
Message-ID: <1438368177-23942-2-git-send-email-f.fainelli@gmail.com> (raw)
In-Reply-To: <1438368177-23942-1-git-send-email-f.fainelli@gmail.com>

Implement a poll controller for netconsole which invokes both of our
interrupt handlers for the different RX/TX queues.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes in v2:

- properly pair the interrupt handler with disable/enable_irq pairs
- remove the call to bcmgenet_tx_reclaim, this is done by the handler

 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index c6f2d396edf0..eb080ef8ee97 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -2388,6 +2388,23 @@ static irqreturn_t bcmgenet_wol_isr(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void bcmgenet_poll_controller(struct net_device *dev)
+{
+	struct bcmgenet_priv *priv = netdev_priv(dev);
+
+	/* Invoke the main RX/TX interrupt handler */
+	disable_irq(priv->irq0);
+	bcmgenet_isr0(priv->irq0, priv);
+	enable_irq(priv->irq0);
+
+	/* And the interrupt handler for RX/TX priority queues */
+	disable_irq(priv->irq1);
+	bcmgenet_isr1(priv->irq1, priv);
+	enable_irq(priv->irq1);
+}
+#endif
+
 static void bcmgenet_umac_reset(struct bcmgenet_priv *priv)
 {
 	u32 reg;
@@ -2939,6 +2956,9 @@ static const struct net_device_ops bcmgenet_netdev_ops = {
 	.ndo_set_mac_address	= bcmgenet_set_mac_addr,
 	.ndo_do_ioctl		= bcmgenet_ioctl,
 	.ndo_set_features	= bcmgenet_set_features,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	.ndo_poll_controller	= bcmgenet_poll_controller,
+#endif
 };
 
 /* Array of GENET hardware parameters/characteristics */
-- 
2.1.0

  reply	other threads:[~2015-07-31 18:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-31 18:42 [PATCH net-next v2 0/4] net: GENET, SYSTEMPORT and DSA netconsole Florian Fainelli
2015-07-31 18:42 ` Florian Fainelli [this message]
2015-07-31 18:42 ` [PATCH net-next v2 2/4] net: systemport: Add netconsole support Florian Fainelli
2015-07-31 18:42 ` [PATCH net-next v2 3/4] net: dsa: Refactor transmit path to eliminate duplication Florian Fainelli
2015-07-31 18:42 ` [PATCH net-next v2 4/4] net: dsa: Add netconsole support Florian Fainelli
2015-07-31 22:46 ` [PATCH net-next v2 0/4] net: GENET, SYSTEMPORT and DSA netconsole 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=1438368177-23942-2-git-send-email-f.fainelli@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=Chris.Packham@alliedtelesis.co.nz \
    --cc=alexander.h.duyck@redhat.com \
    --cc=andrew@lunn.ch \
    --cc=andrey.volkov@nexvision.fr \
    --cc=cphealy@gmail.com \
    --cc=davem@davemloft.net \
    --cc=jaedon.shin@gmail.com \
    --cc=jerome.oufella@savoirfairelinux.com \
    --cc=jonasj76@gmail.com \
    --cc=linux@roeck-us.net \
    --cc=mathieu@codeaurora.org \
    --cc=netdev@vger.kernel.org \
    --cc=pgynther@google.com \
    --cc=vivien.didelot@savoirfairelinux.com \
    /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).