netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: nicolas.ferre@microchip.com,
	linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	harini.katakam@xilinx.com
Cc: linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	pthombar@cadence.com, sergio.prado@e-labworks.com,
	antoine.tenart@bootlin.com, linux@armlinux.org.uk,
	andrew@lunn.ch, michal.simek@xilinx.com
Subject: Re: [PATCH 5/5] net: macb: Add WoL interrupt support for MACB type of Ethernet controller
Date: Thu, 16 Apr 2020 12:26:23 -0700	[thread overview]
Message-ID: <c3abc339-ccfa-6ca1-a27c-af2808d89d98@gmail.com> (raw)
In-Reply-To: <3c9db82da283abd7faf248985d21155a48554bdf.1587058078.git.nicolas.ferre@microchip.com>



On 4/16/2020 10:44 AM, nicolas.ferre@microchip.com wrote:
> From: Nicolas Ferre <nicolas.ferre@microchip.com>
> 
> Handle the Wake-on-Lan interrupt for the Cadence MACB Ethernet
> controller.
> As we do for the GEM version, we handle of WoL interrupt in a
> specialized interrupt handler for MACB version that is positionned
> just between suspend() and resume() calls.
> 
> Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
> ---
>   drivers/net/ethernet/cadence/macb_main.c | 38 +++++++++++++++++++++++-
>   1 file changed, 37 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 71e6afbdfb47..6d535e3e803c 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -1513,6 +1513,34 @@ static void macb_tx_restart(struct macb_queue *queue)
>   	macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(TSTART));
>   }
>   
> +static irqreturn_t macb_wol_interrupt(int irq, void *dev_id)
> +{
> +	struct macb_queue *queue = dev_id;
> +	struct macb *bp = queue->bp;
> +	u32 status;
> +
> +	status = queue_readl(queue, ISR);
> +
> +	if (unlikely(!status))
> +		return IRQ_NONE;
> +
> +	spin_lock(&bp->lock);
> +
> +	if (status & MACB_BIT(WOL)) {
> +		queue_writel(queue, IDR, MACB_BIT(WOL));
> +		macb_writel(bp, WOL, 0);
> +		netdev_vdbg(bp->dev, "MACB WoL: queue = %u, isr = 0x%08lx\n",
> +			    (unsigned int)(queue - bp->queues),
> +			    (unsigned long)status);
> +		if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
> +			queue_writel(queue, ISR, MACB_BIT(WOL));
> +	}

Likewise, this would need a call to pm_wakeup_event() to record the 
wake-up event associated with this device.
-- 
Florian

      reply	other threads:[~2020-04-16 19:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-16 17:44 [PATCH 0/5] net: macb: Wake-on-Lan magic packet fixes and GEM handling nicolas.ferre
2020-04-16 17:44 ` [PATCH 1/5] net: macb: fix wakeup test in runtime suspend/resume routines nicolas.ferre
2020-04-16 18:26   ` Harini Katakam
2020-04-17 12:33     ` Nicolas Ferre
2020-04-16 19:21   ` Florian Fainelli
2020-04-16 17:44 ` [PATCH 2/5] net: macb: mark device wake capable when "magic-packet" property present nicolas.ferre
2020-04-16 19:21   ` Florian Fainelli
2020-04-16 17:44 ` [PATCH 3/5] net: macb: fix macb_get/set_wol() when moving to phylink nicolas.ferre
2020-04-16 19:22   ` Florian Fainelli
2020-04-16 17:44 ` [PATCH 4/5] net: macb: WoL support for GEM type of Ethernet controller nicolas.ferre
2020-04-16 19:25   ` Florian Fainelli
2020-04-17 12:57     ` Nicolas Ferre
2020-04-17 17:14   ` Nicolas Ferre
2020-04-21  8:21     ` Nicolas.Ferre
2020-04-21  8:37       ` Harini Katakam
2020-04-16 17:44 ` [PATCH 5/5] net: macb: Add WoL interrupt support for MACB " nicolas.ferre
2020-04-16 19:26   ` Florian Fainelli [this message]

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=c3abc339-ccfa-6ca1-a27c-af2808d89d98@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=antoine.tenart@bootlin.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=davem@davemloft.net \
    --cc=harini.katakam@xilinx.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=michal.simek@xilinx.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=pthombar@cadence.com \
    --cc=sergio.prado@e-labworks.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).