- Fix hotplug irq ack on i965/g4x (Ville)

-----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJbRSVYAAoJEPpiX2QO6xPKi9IH/ijPmDmo74CkIlvBPHvRaS6q
 rx19c2XMumzekjkl+UEGkkGSHEImuiuVG69HkyvmOY50gJtu1kkImzwSZOox4YJ+
 GpWefB1LrIjg6anb5q7JP6GpiXmTIbRCO/JZLiMLpOfGUHAgEorVShYwPPKFwyHL
 N6GBraWnVZAdJYTLAnaqGDmBA3JxhknjDrnLNgtPb6QXaMHp+OSpCT6I/tSYWbY4
 nw3EipbTcmHeMX2ngwfHGNR8xwvfIsiplQDUH2xxUqFSLg+CkQoHl8ZfDzI6N0+b
 wQYBH2j53AHccKxek6tpdi3g3sX/tF86UBEAPwgjRp3j8R8fhRigWr8lgldY7Yw=
 =CnuU
 -----END PGP SIGNATURE-----

Merge tag 'drm-intel-fixes-2018-07-10' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes

- Fix hotplug irq ack on i965/g4x (Ville)

Signed-off-by: Dave Airlie <airlied@redhat.com>

Link: https://patchwork.freedesktop.org/patch/msgid/20180710213249.GA16479@intel.com
This commit is contained in:
Dave Airlie 2018-07-16 09:42:48 +10:00
commit f88147e4e1
1 changed files with 30 additions and 2 deletions

View File

@ -1998,10 +1998,38 @@ static void valleyview_pipestat_irq_handler(struct drm_i915_private *dev_priv,
static u32 i9xx_hpd_irq_ack(struct drm_i915_private *dev_priv)
{
u32 hotplug_status = I915_READ(PORT_HOTPLUG_STAT);
u32 hotplug_status = 0, hotplug_status_mask;
int i;
if (hotplug_status)
if (IS_G4X(dev_priv) ||
IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
hotplug_status_mask = HOTPLUG_INT_STATUS_G4X |
DP_AUX_CHANNEL_MASK_INT_STATUS_G4X;
else
hotplug_status_mask = HOTPLUG_INT_STATUS_I915;
/*
* We absolutely have to clear all the pending interrupt
* bits in PORT_HOTPLUG_STAT. Otherwise the ISR port
* interrupt bit won't have an edge, and the i965/g4x
* edge triggered IIR will not notice that an interrupt
* is still pending. We can't use PORT_HOTPLUG_EN to
* guarantee the edge as the act of toggling the enable
* bits can itself generate a new hotplug interrupt :(
*/
for (i = 0; i < 10; i++) {
u32 tmp = I915_READ(PORT_HOTPLUG_STAT) & hotplug_status_mask;
if (tmp == 0)
return hotplug_status;
hotplug_status |= tmp;
I915_WRITE(PORT_HOTPLUG_STAT, hotplug_status);
}
WARN_ONCE(1,
"PORT_HOTPLUG_STAT did not clear (0x%08x)\n",
I915_READ(PORT_HOTPLUG_STAT));
return hotplug_status;
}