From patchwork Thu Jun 27 11:38:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 2791951 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CD3D69F3A0 for ; Thu, 27 Jun 2013 11:49:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A92ED202DF for ; Thu, 27 Jun 2013 11:49:04 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BA54C202B8 for ; Thu, 27 Jun 2013 11:49:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A28FEE63C6 for ; Thu, 27 Jun 2013 04:49:03 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by gabe.freedesktop.org (Postfix) with ESMTP id 74853E6354 for ; Thu, 27 Jun 2013 04:39:28 -0700 (PDT) Received: by mail-wg0-f46.google.com with SMTP id c11so468060wgh.1 for ; Thu, 27 Jun 2013 04:39:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=5QdV3gWFnvPbiXC0a4AK8hhosaF8rHBY38hABWJqWU0=; b=EguKglB5a1A6XTalOUPfREqszUNIOIr8MWPKS/4gtuhtJ3XKEMHbofgqQ3fyu1JVwu +A3t5r6DlbKUPARhbX4fdSnDXbFLpnBr+yexjpxP74IAd/GrjmZh5Ao3HxTeMvfKkNm4 1cxDbDR1gGDALljSTyKS5zgkNAfNIRDkjz0Ep8z/G4W0Qsnb+gKpy8TGrQTBqaz/KUdH yf0//YDhWsm3T0a45/oMk0eVwetWkDQl9SfvGNIgSLPoB5bk+fqQ7HhxylK4rUDHkbmm s3+X6ClngXOdp5kEWRV95ie2AE5SOrUscoQYmxmzU5ARhAmqXsXTxqvqDmcc6XDNDOT4 0u1A== X-Received: by 10.180.100.35 with SMTP id ev3mr15459622wib.12.1372333167681; Thu, 27 Jun 2013 04:39:27 -0700 (PDT) Received: from localhost (5ED49945.cm-7-5c.dynamic.ziggo.nl. [94.212.153.69]) by mx.google.com with ESMTPSA id w4sm3003356wia.9.2013.06.27.04.39.22 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 27 Jun 2013 04:39:24 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Thu, 27 Jun 2013 13:39:22 +0200 From: Maarten Lankhorst To: Dave Airlie Subject: [PATCH 9/9] drm/ast: do not attempt to acquire a reservation while in an interrupt handler Date: Thu, 27 Jun 2013 13:38:26 +0200 Message-Id: <1372333106-28910-9-git-send-email-maarten.lankhorst@canonical.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1372333106-28910-1-git-send-email-maarten.lankhorst@canonical.com> References: <1372333106-28910-1-git-send-email-maarten.lankhorst@canonical.com> Cc: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Mutexes should not be acquired in interrupt context. While the trylock fastpath is arguably safe on all implementations, the slowpath unlock path definitely isn't. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/ast/ast_fb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/ast/ast_fb.c b/drivers/gpu/drm/ast/ast_fb.c index fbc0823..7b33e14 100644 --- a/drivers/gpu/drm/ast/ast_fb.c +++ b/drivers/gpu/drm/ast/ast_fb.c @@ -51,7 +51,7 @@ static void ast_dirty_update(struct ast_fbdev *afbdev, struct ast_bo *bo; int src_offset, dst_offset; int bpp = (afbdev->afb.base.bits_per_pixel + 7)/8; - int ret; + int ret = -EBUSY; bool unmap = false; bool store_for_later = false; int x2, y2; @@ -65,7 +65,8 @@ static void ast_dirty_update(struct ast_fbdev *afbdev, * then the BO is being moved and we should * store up the damage until later. */ - ret = ast_bo_reserve(bo, true); + if (!in_interrupt()) + ret = ast_bo_reserve(bo, true); if (ret) { if (ret != -EBUSY) return;