From owner-freebsd-stable@FreeBSD.ORG Tue Apr 24 04:07:26 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4DEDD1065675; Tue, 24 Apr 2012 04:07:26 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pz0-f44.google.com (mail-pz0-f44.google.com [209.85.210.44]) by mx1.freebsd.org (Postfix) with ESMTP id 12BEB8FC08; Tue, 24 Apr 2012 04:07:26 +0000 (UTC) Received: by dadz14 with SMTP id z14so932421dad.17 for ; Mon, 23 Apr 2012 21:07:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=fGGYdiLZYnCSAguzcDxo+WaQSO+4u86wM7en4XI7wHM=; b=xfUuLtGVKxQicCVcxxspdKdPjRGTs0pixWT9ENLVurCr6ujqg3UhFBqYqsFLzmdS5e qaT5CxT9gTLNeIdCWQvXD5B366cvS4Xvk6PuqZ3ZCsnFiCMNYm+Uw0kzQFeWL7cEZZw3 SsmoRpPXfTqQEe/ud3fVoMYkIoRzEUCNyH57zAg+p5/20d8yimEsS+hnhsfLCC8l43iG lGrN3bui/y0UjqC1CaKKMck9HupGOt28ufGCMpeq+uPU1xpOMp1kY3jHvUrNcGep7Mar 99oJbr0DV2U2eez8B2QNfye6m/9snd54ywvhNgYCs+QtXp8jocuUj8qCp4v3JeqL0lXC +A9A== Received: by 10.68.237.163 with SMTP id vd3mr568773pbc.33.1335240445901; Mon, 23 Apr 2012 21:07:25 -0700 (PDT) Received: from pyunyh@gmail.com ([114.111.62.249]) by mx.google.com with ESMTPS id wf6sm16249198pbc.8.2012.04.23.21.07.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 Apr 2012 21:07:24 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Tue, 24 Apr 2012 13:07:19 -0700 From: YongHyeon PYUN Date: Tue, 24 Apr 2012 13:07:19 -0700 To: John Baldwin Message-ID: <20120424200719.GB6932@michelle.cdnetworks.com> References: <20120228210329.GA2741@localhost> <201203061036.05227.jhb@freebsd.org> <20120307204052.GC9436@michelle.cdnetworks.com> <201204231024.42237.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="vtzGhvizbBRQ85DL" Content-Disposition: inline In-Reply-To: <201204231024.42237.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: Pavel Gorshkov , freebsd-stable@freebsd.org Subject: Re: msk0: interrupt storm X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Apr 2012 04:07:26 -0000 --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Apr 23, 2012 at 10:24:41AM -0400, John Baldwin wrote: > On Wednesday, March 07, 2012 3:40:53 pm YongHyeon PYUN wrote: > > On Tue, Mar 06, 2012 at 10:36:05AM -0500, John Baldwin wrote: > > > On Thursday, March 01, 2012 8:29:55 pm YongHyeon PYUN wrote: > > > > On Wed, Feb 29, 2012 at 01:03:29AM +0400, Pavel Gorshkov wrote: > > > > > My laptop running 9.0-RELEASE/amd64/GENERIC freezes and > > > > > (sometimes) unfreezes intermittently, logging the following: > > > > > > > > > > Feb 28 23:07:36 lifebook kernel: interrupt storm detected on "irq259:"; > > > throttling interrupt source > > > > > > > > > > $ vmstat -i > > > > > ... > > > > > irq259: mskc0 11669511 3456 > > > > > > > > > > > > > > > Looks very similar to this: > > > > > http://www.freebsd.org/cgi/query-pr.cgi?pr=164569 > > > > > > > > > > Any suggestions? > > > > > > > > Try disabling MSI and see whether that makes any difference. > > > > > > I also get interrupt storms with msk. They do fix themselves when they > > > happen, and I've seen it happen with the machine is idle. This is on my > > > little netbook where msk had several problems initially that have since been > > > fixed. > > > > > > mskc0: port 0x2000-0x20ff mem > > > 0xe0000000-0xe0003fff irq 19 at device 0.0 on pci32 > > > msk0: on mskc0 > > > msk0: Ethernet address: 00:24:81:40:e3:ef > > > miibus0: on msk0 > > > e1000phy0: PHY 0 on miibus0 > > > e1000phy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, > > > 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto, auto-flow > > > > > > mskc0@pci0:32:0:0: class=0x020000 card=0x3056103c chip=0x436c11ab > > > rev=0x10 hdr=0x00 > > > vendor = 'Marvell Technology Group Ltd.' > > > device = '88E8072 PCI-E Gigabit Ethernet Controller' > > > class = network > > > subclass = ethernet > > > > > > > John, can you let me know the value of B0_Y2_SP_ISRC2 register in > > interrupt handler when you see the interrupt storm? > > I finally tested this. I added some KTR traces to dump ISRC2 on each > call to msk_intr() and hacked the interrupt thread code to turn KTR tracing > off when a storm occurred. The traces look like this: > > index cpu timestamp trace > ------ --- ---------------- ----- > 148 0 111662766108828 msk_intr: B0_Y2_SP_ISRC2 = 0x44000000 > 147 0 111662765994576 msk_intr: B0_Y2_SP_ISRC2 = 0x44000000 > 146 0 111662765380260 msk_intr: B0_Y2_SP_ISRC2 = 0x44000000 > 145 0 111662765257308 msk_intr: B0_Y2_SP_ISRC2 = 0x44000000 > 144 0 111662765134356 msk_intr: B0_Y2_SP_ISRC2 = 0x44000000 > 143 0 111662765011560 msk_intr: B0_Y2_SP_ISRC2 = 0x44000000 > 142 0 111662764888656 msk_intr: B0_Y2_SP_ISRC2 = 0x44000000 > 141 0 111662764773924 msk_intr: B0_Y2_SP_ISRC2 = 0x44000000 > 140 0 111662764659360 msk_intr: B0_Y2_SP_ISRC2 = 0x44000000 > 139 0 111662764528140 msk_intr: B0_Y2_SP_ISRC2 = 0x44000000 > 138 0 111662764413576 msk_intr: B0_Y2_SP_ISRC2 = 0x44000000 > 137 0 111662764287852 msk_intr: B0_Y2_SP_ISRC2 = 0x44000000 > ... > > (All traces have the same register value.) The TSC on this netbook runs > at machdep.tsc_freq: 1596035244 > > (The timestamps above are TSC values.) > > Let me know if you'd like me to log more stuff in the driver. Thanks! wonder why the deivce gets TWSI completion interrupt since the driver does not monitor temperature sensor. In addition, the interrupt was already disabled so have no idea how this can happen. Here, I assume your controller implemented optional temperature sensor and it is monitored by H/W. Anyway, try attached patch and let me know whether it makes any difference. --vtzGhvizbBRQ85DL Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="msk.TWSI.diff" Index: sys/dev/msk/if_msk.c =================================================================== --- sys/dev/msk/if_msk.c (revision 234591) +++ sys/dev/msk/if_msk.c (working copy) @@ -3734,6 +3734,9 @@ if ((status & Y2_IS_STAT_BMU) != 0 && domore == 0) CSR_WRITE_4(sc, STAT_CTRL, SC_STAT_CLR_IRQ); + /* Clear TWSI IRQ. */ + if ((status & Y2_IS_TWSI_RDY) != 0) + CSR_WRITE_4(sc, B2_I2C_IRQ, 1); /* Reenable interrupts. */ CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2); --vtzGhvizbBRQ85DL--