From patchwork Thu Jun 27 11:38:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 2791941 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C700CC0AB1 for ; Thu, 27 Jun 2013 11:48:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9CA5F202DF for ; Thu, 27 Jun 2013 11:48:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BE4C5202B8 for ; Thu, 27 Jun 2013 11:47:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BB36CE642D for ; Thu, 27 Jun 2013 04:47:59 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by gabe.freedesktop.org (Postfix) with ESMTP id D91EFE627C for ; Thu, 27 Jun 2013 04:39:22 -0700 (PDT) Received: by mail-wi0-f176.google.com with SMTP id ey16so2995282wid.3 for ; Thu, 27 Jun 2013 04:39:22 -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=E7wM4nx2Wi0ZCHGqembkiA4aVMXjMiMtoHitHy1p+00=; b=GC2eKJDaNajkjjMgO7EyJ3zFODfWW8vH2Ur22ekwUpuVnrLb92BKpSe22m+rx2xwJ5 e/jjSX11P34nTghqRJTLmVXoCyuHQVZtaBKBO/BTrsr1AJUkX/uvXTcIbsE/ajbywbzJ /g39HmScDdUm1MKM2qa+fIIzYby+RCjkww9NCfGapTsr8zFNW0mt221bcvATkr1ChQgV LRntnigfJxYh4Pl6o4sus8d5J9o7mN2tHXwfQPahxmCy2NlHkRESypnKv4O31D7xce3U zFRLjxzTrwez+aYS6aH2y3NoIKkSDSGHocgAMVQeZ6EPKy35giFSQ9SP4L2MlVeijbYs qj6w== X-Received: by 10.194.63.46 with SMTP id d14mr6016117wjs.81.1372333162088; Thu, 27 Jun 2013 04:39:22 -0700 (PDT) Received: from localhost (5ED49945.cm-7-5c.dynamic.ziggo.nl. [94.212.153.69]) by mx.google.com with ESMTPSA id d8sm3077658wiz.0.2013.06.27.04.39.19 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 27 Jun 2013 04:39:20 -0700 (PDT) Received: by localhost (sSMTP sendmail emulation); Thu, 27 Jun 2013 13:39:18 +0200 From: Maarten Lankhorst To: Dave Airlie Subject: [PATCH 8/9] drm/mgag200: do not attempt to acquire a reservation while in an interrupt handler Date: Thu, 27 Jun 2013 13:38:25 +0200 Message-Id: <1372333106-28910-8-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/mgag200/mgag200_fb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c b/drivers/gpu/drm/mgag200/mgag200_fb.c index 5da824c..964f58c 100644 --- a/drivers/gpu/drm/mgag200/mgag200_fb.c +++ b/drivers/gpu/drm/mgag200/mgag200_fb.c @@ -27,7 +27,7 @@ static void mga_dirty_update(struct mga_fbdev *mfbdev, struct mgag200_bo *bo; int src_offset, dst_offset; int bpp = (mfbdev->mfb.base.bits_per_pixel + 7)/8; - int ret; + int ret = -EBUSY; bool unmap = false; bool store_for_later = false; int x2, y2; @@ -41,7 +41,8 @@ static void mga_dirty_update(struct mga_fbdev *mfbdev, * then the BO is being moved and we should * store up the damage until later. */ - ret = mgag200_bo_reserve(bo, true); + if (!in_interrupt()) + ret = mgag200_bo_reserve(bo, true); if (ret) { if (ret != -EBUSY) return;