From patchwork Fri Sep 28 07:29:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 1517191 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 975A43FC71 for ; Fri, 28 Sep 2012 07:29:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753342Ab2I1H3v (ORCPT ); Fri, 28 Sep 2012 03:29:51 -0400 Received: from mail-oa0-f46.google.com ([209.85.219.46]:36783 "EHLO mail-oa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752619Ab2I1H3u (ORCPT ); Fri, 28 Sep 2012 03:29:50 -0400 Received: by oagh16 with SMTP id h16so2672936oag.19 for ; Fri, 28 Sep 2012 00:29:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=eUNRI0Z2roWu4GKwN+UAMILAh26ckT4K8S3QNRwca3E=; b=Z3HQ4moN1qpsuBkKRq3y15tJCr6tFdHprNJw+aI2Ctxy3nC2815pJNav72yawLHcy1 QkpheczeDa+JWkYGgP0JHtufD5uexrRcl+ssFiWZrHDUP6TrcW+KQQkaLuGDfzoITOMY T9L0FKJnFYcx0ROztO1vHh80bdbVjKl5+phempvEWgDcfQ91UyIo/f5zLOaGdcmrhhn2 0BLmxGEsKGwGy07YioCe2FF9cM19z4HSrWOZV/yA/ri8pJi6N4DFGAwSTA2/BUm33Vx1 BA9pWhgHgGSq8rpaDy+pW209HoOO1IWRkHh7w05mEdNW6ECkO7bwfmrZaBli9EVyoHnh Zj8A== Received: by 10.60.170.241 with SMTP id ap17mr5341998oec.4.1348817390314; Fri, 28 Sep 2012 00:29:50 -0700 (PDT) Received: from localhost (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id th3sm7804592obb.6.2012.09.28.00.29.48 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 28 Sep 2012 00:29:49 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org Cc: patches@linaro.org, daniel.vetter@ffwll.ch, sumit.semwal@linaro.org, maarten.lankhorst@canonical.com, Rob Clark Subject: [PATCH] dma-buf: might_sleep() in dma_buf_unmap_attachment() Date: Fri, 28 Sep 2012 09:29:43 +0200 Message-Id: <1348817383-30286-1-git-send-email-rob.clark@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Rob Clark We never really clarified if unmap could be done in atomic context. But since mapping might require sleeping, this implies mutex in use to synchronize mapping/unmapping, so unmap could sleep as well. Add a might_sleep() to clarify this. Signed-off-by: Rob Clark Acked-by: Daniel Vetter Reviewed-by: Maarten Lankhorst --- drivers/base/dma-buf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c index c30f3e1..877eacb 100644 --- a/drivers/base/dma-buf.c +++ b/drivers/base/dma-buf.c @@ -298,6 +298,8 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *attach, struct sg_table *sg_table, enum dma_data_direction direction) { + might_sleep(); + if (WARN_ON(!attach || !attach->dmabuf || !sg_table)) return;