Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752801AbbB1QP4 (ORCPT ); Sat, 28 Feb 2015 11:15:56 -0500 Received: from mail.ispras.ru ([83.149.199.45]:50458 "EHLO mail.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752126AbbB1QPy (ORCPT ); Sat, 28 Feb 2015 11:15:54 -0500 Message-ID: <54F1D889.40207@ispras.ru> Date: Sat, 28 Feb 2015 18:02:33 +0300 From: Alexey Khoroshilov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Patrik Jakobsson , David Airlie CC: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: drm/gma500: Possible deadlock in gma_power_begin() Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1646 Lines: 49 gma_power_begin() starts with locking power_ctrl_lock spinlock and then, if gma_resume_pci(dev->pdev) succeed, it calls psb_irq_preinstall(dev); psb_irq_postinstall(dev); psb_irq_postinstall() does some pipestat enabling/disabling dance: if (dev->vblank[0].enabled) psb_enable_pipestat(dev_priv, 0, PIPE_VBLANK_INTERRUPT_ENABLE); else psb_disable_pipestat(dev_priv, 0, PIPE_VBLANK_INTERRUPT_ENABLE); where void psb_enable_pipestat(struct drm_psb_private *dev_priv, int pipe, u32 mask) { if ((dev_priv->pipestat[pipe] & mask) != mask) { u32 reg = psb_pipestat(pipe); dev_priv->pipestat[pipe] |= mask; /* Enable the interrupt, clear any pending status */ if (gma_power_begin(dev_priv->dev, false)) { u32 writeVal = PSB_RVDC32(reg); writeVal |= (mask | (mask >> 16)); PSB_WVDC32(writeVal, reg); (void) PSB_RVDC32(reg); gma_power_end(dev_priv->dev); } } } So, if a flag in dev_priv->pipestat[pipe] is not in agreement with dev->vblank[0].enabled, we will have a call to gma_power_begin() again and got an unavoidable deadlock. Thus it seems either some code is unneeded at all or we could have a deadlock from time to time. What do you think? Found by Linux Driver Verification project (linuxtesting.org). -- Alexey Khoroshilov Linux Verification Center, ISPRAS -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/