From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754764AbXJGOkr (ORCPT ); Sun, 7 Oct 2007 10:40:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753100AbXJGOkj (ORCPT ); Sun, 7 Oct 2007 10:40:39 -0400 Received: from srv5.dvmed.net ([207.36.208.214]:54433 "EHLO mail.dvmed.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753047AbXJGOki (ORCPT ); Sun, 7 Oct 2007 10:40:38 -0400 Message-ID: <4708EFE0.1080900@garzik.org> Date: Sun, 07 Oct 2007 10:40:32 -0400 From: Jeff Garzik User-Agent: Thunderbird 2.0.0.5 (X11/20070727) MIME-Version: 1.0 To: netdev@vger.kernel.org, Ayaz Abdulla CC: LKML , Andrew Morton Subject: Re: [PATCH 6/n] forcedeth: protect slow path with mutex References: <20071006151250.GA17020@havoc.gtf.org> <20071007112347.GA23577@havoc.gtf.org> In-Reply-To: <20071007112347.GA23577@havoc.gtf.org> Content-Type: multipart/mixed; boundary="------------070305060203060704000902" X-Spam-Score: -4.4 (----) X-Spam-Report: SpamAssassin version 3.1.9 on srv5.dvmed.net summary: Content analysis details: (-4.4 points, 5.0 required) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------070305060203060704000902 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Jeff Garzik wrote: > commit abca163a14b28c234df9bf38034bc967ff81c3aa > Author: Jeff Garzik > Date: Sun Oct 7 07:22:14 2007 -0400 > > [netdrvr] forcedeth: wrap slow path hw manipulation inside hw_mutex > > * This makes sure everybody who wants to start/stop the RX and TX engines > first acquires this mutex. > > * tx_timeout code was deleted, replaced by scheduling reset_task. > > * linkchange moved to a workqueue (always inside hw_mutex) > > * simplified irq handling a bit > > * make sure to disable workqueues before NAPI > > Signed-off-by: Jeff Garzik > > drivers/net/forcedeth.c | 272 ++++++++++++++++++++++++++++++------------------ > 1 file changed, 175 insertions(+), 97 deletions(-) You will need the attached patch to even build (oops). Also, testing shows there is a mutex deadlock somewhere. --------------070305060203060704000902 Content-Type: text/plain; name="patch.fe6" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch.fe6" diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index d1c1efa..91926b1 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c @@ -2929,6 +2929,7 @@ static void nv_linkchange_task(struct work_struct *work) static void nv_link_irq(struct net_device *dev) { + struct fe_priv *np = netdev_priv(dev); u8 __iomem *base = get_hwbase(dev); u32 miistat; @@ -4378,6 +4379,7 @@ static int nv_ethtool_begin (struct net_device *dev) struct fe_priv *np = get_nvpriv(dev); mutex_lock(&np->hw_mutex); + return 0; } static void nv_ethtool_complete (struct net_device *dev) --------------070305060203060704000902--