From patchwork Mon May 8 19:48:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Krisman Bertazi X-Patchwork-Id: 9716579 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4A61060365 for ; Mon, 8 May 2017 19:49:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40A2D2522B for ; Mon, 8 May 2017 19:49:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 355B325D9E; Mon, 8 May 2017 19:49:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 094432522B for ; Mon, 8 May 2017 19:49:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7210289DC2; Mon, 8 May 2017 19:48:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by gabe.freedesktop.org (Postfix) with ESMTPS id E747D89870 for ; Mon, 8 May 2017 19:48:56 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id A91B82657D5 From: Gabriel Krisman Bertazi To: Mike Galbraith Subject: Re: [drm:qxl] BUG: sleeping function called from invalid context - qxl_bo_kmap_atomic_page()...splat Organization: Collabora References: <1494239599.11523.21.camel@gmx.de> Date: Mon, 08 May 2017 16:48:50 -0300 In-Reply-To: <1494239599.11523.21.camel@gmx.de> (Mike Galbraith's message of "Mon, 08 May 2017 12:33:19 +0200") Message-ID: <87mvan9ljx.fsf@dilma.collabora.co.uk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Cc: Dave Airlie , LKML , dri-devel@lists.freedesktop.org, Gerd Hoffmann X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Mike Galbraith writes: > Greetings, > > I'm meeting this splat in master, call io_mapping_map_atomic_wc(), > then do something sleepy. In master-rt, I meet a variant of this > doing read_lock() in find_next_iomem_res(), due to rwlocks being > sleepy in RT. > Hi Mike, Thanks for reporting this. Can you confirm the following patch prevents the issue? >8 From 407213129ef4a687378563cbb6ca78faa23f33bd Mon Sep 17 00:00:00 2001 From: Gabriel Krisman Bertazi Date: Mon, 8 May 2017 16:47:22 -0300 Subject: [PATCH] drm: qxl: Suffle allocations in atomic cursor update Signed-off-by: Gabriel Krisman Bertazi --- drivers/gpu/drm/qxl/qxl_display.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 058340a002c2..e92d0feaf639 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -581,25 +581,25 @@ static void qxl_cursor_atomic_update(struct drm_plane *plane, obj = to_qxl_framebuffer(fb)->obj; user_bo = gem_to_qxl_bo(obj); - /* pinning is done in the prepare/cleanup framevbuffer */ - ret = qxl_bo_kmap(user_bo, &user_ptr); - if (ret) - goto out_free_release; - ret = qxl_alloc_bo_reserved(qdev, release, sizeof(struct qxl_cursor) + size, &cursor_bo); if (ret) - goto out_kunmap; + goto out_free_release; ret = qxl_release_reserve_list(release, true); if (ret) goto out_free_bo; - ret = qxl_bo_kmap(cursor_bo, (void **)&cursor); + /* pinning is done in the prepare/cleanup framevbuffer */ + ret = qxl_bo_kmap(user_bo, &user_ptr); if (ret) goto out_backoff; + ret = qxl_bo_kmap(cursor_bo, (void **)&cursor); + if (ret) + goto out_kunmap; + cursor->header.unique = 0; cursor->header.type = SPICE_CURSOR_TYPE_ALPHA; cursor->header.width = 64; @@ -636,12 +636,12 @@ static void qxl_cursor_atomic_update(struct drm_plane *plane, return; +out_kunmap: + qxl_bo_kunmap(user_bo); out_backoff: qxl_release_backoff_reserve_list(release); out_free_bo: qxl_bo_unref(&cursor_bo); -out_kunmap: - qxl_bo_kunmap(user_bo); out_free_release: qxl_release_free(qdev, release); return;