From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jani Nikula Subject: Re: [Intel-gfx] [PATCH] drm/i915: vlv: fix IRQ masking when uninstalling interrupts Date: Thu, 11 Dec 2014 16:09:03 +0200 Message-ID: <874mt28eio.fsf@intel.com> References: <1416492355-24818-1-git-send-email-imre.deak@intel.com> <20141210173712.GG10649@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <20141210173712.GG10649@intel.com> Sender: stable-owner@vger.kernel.org To: Ville =?utf-8?B?U3lyasOkbMOk?= , Imre Deak Cc: intel-gfx@lists.freedesktop.org, "v3.15+" List-Id: intel-gfx@lists.freedesktop.org On Wed, 10 Dec 2014, Ville Syrj=C3=A4l=C3=A4 wrote: > On Thu, Nov 20, 2014 at 04:05:55PM +0200, Imre Deak wrote: >> irq_mask should include all IRQ bits that we want to mask, but atm w= e >> set it incorrectly to the inverse of this. If the mask is used >> subsequently to enable/disable some IRQ bits, we may unintentionally >> unmask unrelated IRQs. I can't see any way that this can lead to a r= eal >> problem in the current -nightly code, since the first place the mask >> will be used next (after a suspend/resume cycle) is in >> valleyview_irq_postinstall(), but the mask is reset there to its pro= per >> value. >>=20 >> This causes a problem in the upstream kernel though, where - due to = another >> issue - the mask is used in the above way to disable only the displa= y IRQs. >> This other issue is fixed by: >>=20 >> commit 950eabaf5a87257040e0c207be09487954113f54 >> Author: Imre Deak >> Date: Mon Sep 8 15:21:09 2014 +0300 >>=20 >> drm/i915: vlv: fix display IRQ enable/disable >>=20 >> Interestingly, even with the above two bugs, we shouldn't in theory = have >> any real problems (arguably a famous last sentence:). That's because >> even if we unmask something unintentionally via the VLV_IMR/VLV_IER >> register the master IRQ masking bit in VLV_MASTER_IER is still set a= nd >> should prevent all i915 interrupts. According to my testing on an AS= US >> T100 with DSI output this isn't the case at least with the >> MIPIA_INTERRUPT. Leaving this one unmasked in IMR/IER, while having >> VLV_MASTER_IER set to 0 may lead to a lockup during system suspend a= s >> shown in the bugzilla ticket below. This fix should get rid of the >> problem reported there in upstream and older kernels. >>=20 >> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=3D85920 >> Cc: stable@vger.kernel.org (v3.15+) >> Signed-off-by: Imre Deak > > Reviewed-by: Ville Syrj=C3=A4l=C3=A4 Pushed to drm-intel-next-fixes, thanks for the patch and review. BR, Jani. > >> --- >> drivers/gpu/drm/i915/i915_irq.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >>=20 >> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/= i915_irq.c >> index 8d169e1..4601f53 100644 >> --- a/drivers/gpu/drm/i915/i915_irq.c >> +++ b/drivers/gpu/drm/i915/i915_irq.c >> @@ -3597,7 +3597,7 @@ static void vlv_display_irq_uninstall(struct d= rm_i915_private *dev_priv) >> =20 >> vlv_display_irq_reset(dev_priv); >> =20 >> - dev_priv->irq_mask =3D 0; >> + dev_priv->irq_mask =3D ~0; >> } >> =20 >> static void valleyview_irq_uninstall(struct drm_device *dev) >> --=20 >> 1.8.4 >>=20 >> _______________________________________________ >> Intel-gfx mailing list >> Intel-gfx@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/intel-gfx > > --=20 > Ville Syrj=C3=A4l=C3=A4 > Intel OTC > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx --=20 Jani Nikula, Intel Open Source Technology Center