All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Jiri Kosina <jkosina@suse.cz>
Cc: Daniel Vetter <daniel@ffwll.ch>, Greg KH <greg@kroah.com>,
	Harald Arnesen <skogtun.linux@gmail.com>,
	Kernel development list <linux-kernel@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Peter Hurley <peter@hurleysoftware.com>,
	Alan Stern <stern@rowland.harvard.edu>,
	Thomas Meyer <thomas@m3y3r.de>,
	Shawn Starr <shawn.starr@rogers.com>,
	USB list <linux-usb@vger.kernel.org>,
	linux-acpi@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, Yinghai Lu <yinghai@kernel.org>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Imre Deak <imre.deak@intel.com>,
	Daniel Kurtz <djkurtz@chromium.org>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: stop using GMBUS IRQs on Gen4 chips (was Re: [3.9-rc1] irq 16: nobody cared  (was [3.9-rc1] very poor interrupt responses))
Date: Tue, 19 Mar 2013 09:03:16 +0000	[thread overview]
Message-ID: <20130319090316.GB3872@cantiga.alporthouse.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1303190953010.9529@pobox.suse.cz>

On Tue, Mar 19, 2013 at 09:56:57AM +0100, Jiri Kosina wrote:
> On Mon, 18 Mar 2013, Chris Wilson wrote:
> 
> > > +#define HAS_GMBUS_IRQ(dev) (INTEL_INFO(dev)->gen >= 5)
> > >  void
> > >  intel_i2c_reset(struct drm_device *dev)
> > >  {
> > >  	struct drm_i915_private *dev_priv = dev->dev_private;
> > >  	I915_WRITE(dev_priv->gpio_mmio_base + GMBUS0, 0);
> > > -	I915_WRITE(dev_priv->gpio_mmio_base + GMBUS4, 0);
> > > +	if (HAS_GMBUS_IRQ(dev))
> > > +		I915_WRITE(dev_priv->gpio_mmio_base + GMBUS4, 0);
> > 
> > There should not be any harm in always clearing GMBUS4, it exists on all
> > platforms.
> > 
> > >  }
> > >  
> > >  static void intel_i2c_quirk_set(struct drm_i915_private *dev_priv, bool enable)
> > > @@ -203,7 +205,6 @@ intel_gpio_setup(struct intel_gmbus *bus, u32 pin)
> > >  	algo->data = bus;
> > >  }
> > >  
> > > -#define HAS_GMBUS_IRQ(dev) (INTEL_INFO(dev)->gen >= 4)
> > >  static int
> > >  gmbus_wait_hw_status(struct drm_i915_private *dev_priv,
> > >  		     u32 gmbus2_status,
> > > @@ -214,6 +215,13 @@ gmbus_wait_hw_status(struct drm_i915_private *dev_priv,
> > >  	u32 gmbus2 = 0;
> > >  	DEFINE_WAIT(wait);
> > >  
> > > +	if (!HAS_GMBUS_IRQ(dev_priv->dev)) {
> > > +		int ret;
> > > +		ret = wait_for((gmbus2 = I915_READ(GMBUS2 + reg_offset)) &
> > > +				(GMBUS_SATOER | gmbus2_status),
> > > +				50);
> > 
> > This should couple up to the normal return code that chooses the
> > appropriate return value based on gmbus2.
> > 
> > How about just using:
> >   if (!HAS_GMBUS_IRQ(dev_priv->dev)) gmbus4_irq_en = 0;
> > and the existing wait loop?
> 
> I explicitly wanted to avoid touching GMBUS4 register, as the real cause 
> of the failure is not clear.
> 
> But, as Yinghai Lu points out, the problem is most likely caused by 
> interrupt disabling not working properly (see his very good point 
> regarding DisINTx+ and INTx+ discrepancy), so zeroing the register out 
> should work .... and it indeed does in my case, hence the (tested) patch 
> below.
> 
> I think it's a 3.9-rc material, and I am all open to debug this further 
> for 3.10 so that the race is closed and gmbus irqs can be used on Gen4 
> platform properly.

Agreed. Using the IRQ for GMBUS is just a performance feature that can
be deferred until after we determine the root cause - and hope that the
failure is somehow peculiar to GMBUS.

Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

  reply	other threads:[~2013-03-19  9:03 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-08 19:12 [3.9-rc1] very poor interrupt responses Shawn Starr
2013-03-08 21:33 ` [3.9-rc1] irq 16: nobody cared (was [3.9-rc1] very poor interrupt responses) Peter Hurley
2013-03-09  2:19   ` Alan Stern
2013-03-09  8:53     ` Thomas Meyer
2013-03-09 13:07       ` Peter Hurley
2013-03-13 21:35         ` Jiri Kosina
2013-03-14 14:51           ` Alan Stern
2013-03-14 14:51             ` Alan Stern
2013-03-14 14:56             ` Jiri Kosina
2013-03-14 15:18               ` Alan Stern
2013-03-14 15:18                 ` Alan Stern
2013-03-14 15:39                 ` Jiri Kosina
2013-03-14 15:47                   ` Jiri Kosina
2013-03-14 16:10                   ` Alan Stern
2013-03-14 16:10                     ` Alan Stern
2013-03-14 16:13                   ` Alan Stern
2013-03-14 16:13                     ` Alan Stern
2013-03-14 16:09               ` Jiri Kosina
2013-03-14 16:42                 ` Peter Hurley
2013-03-14 16:46                 ` Rafael J. Wysocki
2013-03-14 17:06                   ` Peter Hurley
2013-03-14 17:22                     ` Rafael J. Wysocki
2013-03-14 17:26                       ` Peter Hurley
2013-03-15  7:59                       ` Jiri Kosina
2013-03-15  9:20                         ` Harald Arnesen
2013-03-15 13:33                           ` Jiri Kosina
2013-03-15 13:33                             ` Jiri Kosina
2013-03-15 15:14                             ` Jiri Kosina
2013-03-15 19:14                               ` Yinghai Lu
2013-03-18  2:41                                 ` Shawn Starr
2013-03-18  9:12                                 ` Jiri Kosina
2013-03-18 18:57                                   ` Yinghai Lu
2013-03-18 22:05                                     ` Jiri Kosina
2013-03-18 22:50                                       ` Yinghai Lu
     [not found]                                   ` <alpine.LNX.2.00.1303181010080.9529-ztGlSCb7Y1iN3ZZ/Hiejyg@public.gmane.org>
2013-03-18 19:19                                     ` Daniel Vetter
2013-03-18 19:19                                       ` Daniel Vetter
2013-03-18 19:57                                       ` Chris Wilson
2013-03-18 22:04                                       ` Jiri Kosina
2013-03-15 15:32                             ` Greg KH
2013-03-15 15:37                               ` Jiri Kosina
2013-03-15 15:47                                 ` Greg KH
2013-03-15 16:21                                   ` Jiri Kosina
2013-03-18  8:21                                   ` Daniel Vetter
2013-03-18 15:56                                     ` [PATCH] drm/i915: stop using GMBUS IRQs on Gen4 chips (was Re: [3.9-rc1] irq 16: nobody cared (was [3.9-rc1] very poor interrupt responses)) Jiri Kosina
2013-03-18 17:04                                       ` Chris Wilson
2013-03-19  8:56                                         ` Jiri Kosina
2013-03-19  9:03                                           ` Chris Wilson [this message]
2013-03-18 19:21                                       ` Daniel Vetter
2013-03-18 11:13                             ` [PATCH] drm/i915: Flush writes to GMBUS registers Chris Wilson
2013-03-18 11:51                               ` Jiri Kosina
2013-03-18 12:48                                 ` Chris Wilson
2013-03-14 18:48           ` [3.9-rc1] irq 16: nobody cared (was [3.9-rc1] very poor interrupt responses) Yinghai Lu
2013-03-11  3:38 ` [3.9-rc1] very poor interrupt responses Rafael J. Wysocki
2013-03-11 10:09   ` Harald Arnesen
2013-03-11 14:55     ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130319090316.GB3872@cantiga.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=bhelgaas@google.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel@ffwll.ch \
    --cc=djkurtz@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=greg@kroah.com \
    --cc=imre.deak@intel.com \
    --cc=jkosina@suse.cz \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter@hurleysoftware.com \
    --cc=rjw@sisk.pl \
    --cc=shawn.starr@rogers.com \
    --cc=skogtun.linux@gmail.com \
    --cc=stern@rowland.harvard.edu \
    --cc=thomas@m3y3r.de \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.