lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20130319090316.GB3872@cantiga.alporthouse.com>
Date:	Tue, 19 Mar 2013 09:03:16 +0000
From:	Chris Wilson <chris@...is-wilson.co.uk>
To:	Jiri Kosina <jkosina@...e.cz>
Cc:	Daniel Vetter <daniel@...ll.ch>, Greg KH <greg@...ah.com>,
	Harald Arnesen <skogtun.linux@...il.com>,
	Kernel development list <linux-kernel@...r.kernel.org>,
	"Rafael J. Wysocki" <rjw@...k.pl>,
	Peter Hurley <peter@...leysoftware.com>,
	Alan Stern <stern@...land.harvard.edu>,
	Thomas Meyer <thomas@...3r.de>,
	Shawn Starr <shawn.starr@...ers.com>,
	USB list <linux-usb@...r.kernel.org>,
	linux-acpi@...r.kernel.org, Bjorn Helgaas <bhelgaas@...gle.com>,
	linux-pci@...r.kernel.org, Yinghai Lu <yinghai@...nel.org>,
	Daniel Vetter <daniel.vetter@...ll.ch>,
	Imre Deak <imre.deak@...el.com>,
	Daniel Kurtz <djkurtz@...omium.org>,
	dri-devel@...ts.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))

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@...is-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ