From patchwork Tue Aug 25 02:59:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Dillow X-Patchwork-Id: 32004 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 5EA0DB7B64 for ; Tue, 25 Aug 2009 13:00:05 +1000 (EST) Received: by ozlabs.org (Postfix) id 4DDFBDDD0B; Tue, 25 Aug 2009 13:00:05 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id D46C2DDD01 for ; Tue, 25 Aug 2009 13:00:04 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754281AbZHYC7Y (ORCPT ); Mon, 24 Aug 2009 22:59:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754278AbZHYC7Y (ORCPT ); Mon, 24 Aug 2009 22:59:24 -0400 Received: from smtp.knology.net ([24.214.63.101]:57439 "EHLO smtp.knology.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754178AbZHYC7O (ORCPT ); Mon, 24 Aug 2009 22:59:14 -0400 Received: (qmail 961 invoked by uid 0); 25 Aug 2009 02:59:12 -0000 Received: from unknown (HELO shed.thedillows.org) (207.98.218.89) by smtp5.knology.net with SMTP; 25 Aug 2009 02:59:12 -0000 Received: from [192.168.1.10] (obelisk.gig.thedillows.org [192.168.1.10]) by shed.thedillows.org (8.14.3/8.14.3) with ESMTP id n7P2xAeY010615; Mon, 24 Aug 2009 22:59:11 -0400 Subject: Re: [PATCH 2.6.30-rc4] r8169: avoid losing MSI interrupts From: David Dillow To: "Eric W. Biederman" Cc: Michael Riepe , Michael Buesch , Francois Romieu , Rui Santos , Michael =?ISO-8859-1?Q?B=FCker?= , linux-kernel@vger.kernel.org, netdev@vger.kernel.org In-Reply-To: References: <200903041828.49972.m.bueker@berlin.de> <1242001754.4093.12.camel@obelisk.thedillows.org> <200905112248.44868.mb@bu3sch.de> <200905112310.08534.mb@bu3sch.de> <1242077392.3716.15.camel@lap75545.ornl.gov> <4A09DC3E.2080807@googlemail.com> <1242268709.4979.7.camel@obelisk.thedillows.org> <4A0C6504.8000704@googlemail.com> <1242328457.32579.12.camel@lap75545.ornl.gov> <4A0C7443.1010000@googlemail.com> <1243042174.3580.23.camel@obelisk.thedillows.org> <1250895567.23419.1.camel@obelisk.thedillows.org> <1250897657.23419.5.camel@obelisk.thedillows.org> <1250973787.3582.14.camel@obelisk.thedillows.org> Date: Mon, 24 Aug 2009 22:59:10 -0400 Message-Id: <1251169150.4023.11.camel@obelisk.thedillows.org> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 (2.26.3-1.fc11) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, 2009-08-24 at 17:51 -0700, Eric W. Biederman wrote: > When I decode the bits in status they are TxOK, RxOK and TxDescUnavail so it looks > there is some bidirectional communication going on. > > Do we really want to loop when those bits are set? Maybe not when only those bits are set, but I worry that we would trade one race for another where we stop getting interrupts from the card. > Perhaps we want to remove them from rtl_cfg_infos for the part? Then you'd never get an interrupt for them in the first place, I think. I'm not real happy with the interrupt handling in the driver; it makes a certain amount of sense to split the MSI vs non-MSI interrupt cases out. It also means another pass through re-auditing things against the vendor driver. That's more work than I'm able to commit to at the moment. I've not been able to reproduce it locally on my r8169d, running for ~30 minutes straight at full speed. I've not tried running it in UP, though. Perhaps I can do that tomorrow. Here's a possible patch to mask the NAPI events while we're running in NAPI mode. I'm not sure it is going to help, since the intr_mask was 0xffff when you hit the loop guard, so I left it in for now. --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index b82780d..12755b7 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c @@ -3556,6 +3556,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance) void __iomem *ioaddr = tp->mmio_addr; int handled = 0; int status; + int count = 0; /* loop handling interrupts until we have no new ones or * we hit a invalid/hotplug case. @@ -3564,6 +3565,15 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance) while (status && status != 0xffff) { handled = 1; + if (count++ > 100) { + printk_once("r8169 screaming irq status %08x " + "mask %08x event %08x napi %08x\n", + status, tp->intr_mask, tp->intr_event, + tp->napi_event); + break; + } + + /* Handle all of the error cases first. These will reset * the chip, so just exit the loop. */ @@ -3613,6 +3623,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance) RTL_W16(IntrStatus, (status & RxFIFOOver) ? (status | RxOverflow) : status); status = RTL_R16(IntrStatus); + status &= tp->intr_mask; } return IRQ_RETVAL(handled);