public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Francois Romieu <romieu@fr.zoreil.com>
To: Ondrej Zary <linux@rainbow-software.org>
Cc: netdev@vger.kernel.org, David Miller <davem@davemloft.net>,
	Kernel development list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] dl2k: Implement suspend
Date: Tue, 17 Nov 2015 00:55:25 +0100	[thread overview]
Message-ID: <20151116235525.GA3700@electric-eye.fr.zoreil.com> (raw)
In-Reply-To: <1447713711-32471-1-git-send-email-linux@rainbow-software.org>

Ondrej Zary <linux@rainbow-software.org> :
[...]
> diff --git a/drivers/net/ethernet/dlink/dl2k.c b/drivers/net/ethernet/dlink/dl2k.c
> index ccca479..23d13c5 100644
> --- a/drivers/net/ethernet/dlink/dl2k.c
> +++ b/drivers/net/ethernet/dlink/dl2k.c
[..]
> @@ -522,6 +515,28 @@ rio_open (struct net_device *dev)
>  	macctrl |= (np->tx_flow) ? TxFlowControlEnable : 0;
>  	macctrl |= (np->rx_flow) ? RxFlowControlEnable : 0;
>  	dw16(MACCtrl, macctrl);
> +}
> +
> +static int rio_open(struct net_device *dev)
> +{
> +	struct netdev_private *np = netdev_priv(dev);
> +	const int irq = np->pdev->irq;
> +	int i;
> +
> +	i = request_irq(irq, rio_interrupt, IRQF_SHARED, dev->name, dev);
> +	if (i)
> +		return i;
> +
> +	alloc_list(dev);
> +
> +	rio_hw_init(dev);

- request shared irq
- allocate memory
- init chipset

It may have worked so far but you ought to nail it before your
changes start to look like regression (if shit can happen, it will).

Btw:
- alloc_list should not be allowed to return partially filled receive
  ring. Please make it return a proper status code.
  The driver itself should rather drop received data than leave holes
  in its receive ring.
- the suspend / resume logic does not need a complete free / alloc
  cycle. Use the same buffers and reset the cur_tx, cur_rx indexes
  as needed.

Go wild.

-- 
Ueimor

      reply	other threads:[~2015-11-16 23:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16 22:41 [PATCH] dl2k: Implement suspend Ondrej Zary
2015-11-16 23:55 ` Francois Romieu [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=20151116235525.GA3700@electric-eye.fr.zoreil.com \
    --to=romieu@fr.zoreil.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rainbow-software.org \
    --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