From patchwork Mon Mar 18 19:19:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 2294911 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 82B51DF215 for ; Mon, 18 Mar 2013 19:19:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6AD6CE622D for ; Mon, 18 Mar 2013 12:19:52 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f44.google.com (mail-ee0-f44.google.com [74.125.83.44]) by gabe.freedesktop.org (Postfix) with ESMTP id A08C9E5E03 for ; Mon, 18 Mar 2013 12:16:19 -0700 (PDT) Received: by mail-ee0-f44.google.com with SMTP id l10so2838855eei.31 for ; Mon, 18 Mar 2013 12:16:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=x-received:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:x-operating-system:user-agent; bh=0GXDYZksBQq2bG+EFPGwhaSVm+e8OFqLod+EAslYYO4=; b=kIwPK7iSaPsSlNjLsOEz9MeDN3iT1BIqdXTtUxL+A37FaXv/D2AFaLVFY7HIiysKCv RcWME1yRSL0aRvCxmeEJY0zAuEMOQw718WhLyjc8hXyGuFxCy4LDQ2l0iKl3gEVH43YN OGVbkdjTLvQTPxVSUJSBN3QTMI0wizLjsh+Dc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:x-operating-system:user-agent :x-gm-message-state; bh=0GXDYZksBQq2bG+EFPGwhaSVm+e8OFqLod+EAslYYO4=; b=g7dSZ05VQ3Z5Mu9gwVF0e5KfnaBOYsl2wMqpelzRxJZg//LCYYxdzMXg4pjcdyNGNd S/tWIjSAfQB2+RqtthhuzoDyuqm5J9KHQV8UgoNRnqrJJXIn4fsEL2XkcGp6Z7eh6xxD l1oHSvWGr3+R3PHZ2KB+8uEtTXn0K5yx5NT8763Ysv6H2cElaJNuNHR5OC2ZcYREaQ18 cnf7LZwAtVvs/+RIu8WYP/va8KaTreZY58K5NZ7liOSYZwUciaejhrK7B/yxdeJ2QAsg DRpmfZV5L4HBE7vRwNQ37vf0jLYEdEV6xrTqdX3RZE5hTUKwE+9jVwwoJR81u6KhHMox GmdA== X-Received: by 10.14.173.67 with SMTP id u43mr52166831eel.22.1363634178354; Mon, 18 Mar 2013 12:16:18 -0700 (PDT) Received: from phenom.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id z45sm28926205eeu.10.2013.03.18.12.16.16 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 18 Mar 2013 12:16:17 -0700 (PDT) Date: Mon, 18 Mar 2013 20:19:03 +0100 From: Daniel Vetter To: Jiri Kosina Subject: Re: [3.9-rc1] irq 16: nobody cared (was [3.9-rc1] very poor interrupt responses) Message-ID: <20130318191903.GS9021@phenom.ffwll.local> Mail-Followup-To: Jiri Kosina , Yinghai Lu , Harald Arnesen , Kernel development list , "Rafael J. Wysocki" , Peter Hurley , Alan Stern , Thomas Meyer , Shawn Starr , USB list , linux-acpi@vger.kernel.org, Bjorn Helgaas , linux-pci@vger.kernel.org, Imre Deak , Daniel Kurtz , dri-devel@lists.freedesktop.org References: <1460519.ejNFI1DrGk@vostro.rjw.lan> <1363280764.26318.4.camel@thor.lan> <5657408.cYX6iimiA4@vostro.rjw.lan> <5142E7F0.4020002@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 3.7.0-rc4+ User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQnVHFoPMhAxTPLLcaOwFLf3dA4TQ3bZJhZ1Y03XJca80gOtUjaoAit3S1yDC3eWefMGkzR9 Cc: Harald Arnesen , Peter Hurley , Shawn Starr , Daniel Vetter , USB list , Kernel development list , "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, Alan Stern , dri-devel@lists.freedesktop.org, linux-pci@vger.kernel.org, Bjorn Helgaas , Yinghai Lu , Thomas Meyer X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org On Mon, Mar 18, 2013 at 10:12:49AM +0100, Jiri Kosina wrote: > On Fri, 15 Mar 2013, Yinghai Lu wrote: > > > > Just a datapoint -- I have put a trivial debugging patch in place, and it > > > reveals that "nobody cared" for irq 16 happens long after last > > > > > > I915_WRITE(GMBUS4 + reg_offset, 0); > > > > > > has been performed in gmbus_wait_hw_status(). On the other hand, if I > > > comment out both GMBUS4 register offset writes in gmbus_wait_hw_status(), > > > then it of course falls back to GPIO bit-banging, but the "nobody cared" > > > for irq 16 is gone. > > > > > > So it seems like something gets severely confused by the I915_WRITE to > > > GMBUS4 + reg_offset. So far this seems to have been reported solely on > > > Lenovos as far as I can see (although a completely different types), so it > > > might be some platform-specific quirk? > > > > > > Honestly, I still don't understand how all the GMBUS stuff relates to IRQ > > > 16 at all. > > > > that device is using > > i915 0000:00:02.0: irq 44 for MSI/MSI-X > > > > so can you try to boot with pci=nomsi? > > Yes, switching from MSI to IO-APIC-fasteoi makes the report about lost > interrupts go away. > > My understanding from the other mail is that DAniel Vetter already has an > idea what might be going wrong with IRQ acking on GM45 chipsets; hopefully > this datapoint regarding MSI will fit into it. Yep, there's a big comment in the irq handler for that chipset that we have a gaping race with when using MSI interrupts. Although the comment bodly claims that the race is small enough to avoid the dreaded "nobody cared" message. Looks like gmbus is good at hitting that race - on newer chips it already brought up a similar race in handling pch interrupts. Can you please give the below patch a whirl? It removes the probably race msi race avoidance code and replaces it with the same trick Paulo used to fix pch irq handling races. Thanks, Daniel diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 3c7bb04..13de12e 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -2684,7 +2684,7 @@ static irqreturn_t i965_irq_handler(int irq, void *arg) { struct drm_device *dev = (struct drm_device *) arg; drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; - u32 iir, new_iir; + u32 iir, new_iir, ier; u32 pipe_stats[I915_MAX_PIPES]; unsigned long irqflags; int irq_received; @@ -2692,9 +2692,14 @@ static irqreturn_t i965_irq_handler(int irq, void *arg) atomic_inc(&dev_priv->irq_received); + /* irq race avoidance, copy&pasta from Paulo's PCH irq fix */ + ier = I915_READ(IER); + I915_WRITE(IER, 0); + POSTING_READ(IER); + iir = I915_READ(IIR); - for (;;) { + do { bool blc_event = false; irq_received = iir != 0; @@ -2792,7 +2797,10 @@ static irqreturn_t i965_irq_handler(int irq, void *arg) * stray interrupts. */ iir = new_iir; - } + } while (0); + + I915_WRITE(IER, ier); + POSTING_READ(IER); i915_update_dri1_breadcrumb(dev);