Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1270705
| From | Francois Romieu <romieu@fr.zoreil.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] dl2k: Implement suspend |
| Date | 2015-11-17 01:00 +0100 |
| Message-ID | <qvBQL-5zm-31@gated-at.bofh.it> (permalink) |
| References | <qvAL0-4US-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] dl2k: Implement suspend Ondrej Zary <linux@rainbow-software.org> - 2015-11-16 23:50 +0100 Re: [PATCH] dl2k: Implement suspend Francois Romieu <romieu@fr.zoreil.com> - 2015-11-17 01:00 +0100
csiph-web