From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752574AbbKPXze (ORCPT ); Mon, 16 Nov 2015 18:55:34 -0500 Received: from violet.fr.zoreil.com ([92.243.8.30]:48191 "EHLO violet.fr.zoreil.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751630AbbKPXzd (ORCPT ); Mon, 16 Nov 2015 18:55:33 -0500 Date: Tue, 17 Nov 2015 00:55:25 +0100 From: Francois Romieu To: Ondrej Zary Cc: netdev@vger.kernel.org, David Miller , Kernel development list Subject: Re: [PATCH] dl2k: Implement suspend Message-ID: <20151116235525.GA3700@electric-eye.fr.zoreil.com> References: <1447713711-32471-1-git-send-email-linux@rainbow-software.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1447713711-32471-1-git-send-email-linux@rainbow-software.org> X-Organisation: Land of Sunshine Inc. User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ondrej Zary : [...] > 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