From patchwork Thu Jan 18 16:56:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Kuehling X-Patchwork-Id: 10173721 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 9A8B4603B5 for ; Thu, 18 Jan 2018 16:56:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A10120572 for ; Thu, 18 Jan 2018 16:56:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7EEFF2839C; Thu, 18 Jan 2018 16:56:51 +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=-2.6 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, T_DKIM_INVALID 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 336762837D for ; Thu, 18 Jan 2018 16:56:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 316876E6A8; Thu, 18 Jan 2018 16:56:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0089.outbound.protection.outlook.com [104.47.36.89]) by gabe.freedesktop.org (Postfix) with ESMTPS id CDA0F6E6A8; Thu, 18 Jan 2018 16:56:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=s8jVMXqW7rZyzTd3riHD/J3opQM82KwizOdN31UO4yk=; b=ZWh8HisdNkvsQF8Nnpsyh8+XYQwjsb7XhWt5NdYOSmzwxyM0IXr4HuzRH20yhj0gp7u76UZo4xRKrDdXqUMUXg9a9kMTWAMp6zCGl4C0fcRf2+bEcNGypI3boMa505MRFaabJz5gKnltdW4g+CPwIwvcIoo/I+cCxJaVXuRtJUI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Felix.Kuehling@amd.com; Received: from Harpoon.amd.com (165.204.55.251) by DM5PR1201MB0235.namprd12.prod.outlook.com (10.174.107.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Thu, 18 Jan 2018 16:56:46 +0000 From: Felix Kuehling To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, christian.koenig@amd.com, Hongbo.He@amd.com Subject: [PATCH 2/2] drm/ttm: Don't unreserve swapped BOs that were previously reserved Date: Thu, 18 Jan 2018 11:56:17 -0500 Message-Id: <1516294577-29078-2-git-send-email-Felix.Kuehling@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516294577-29078-1-git-send-email-Felix.Kuehling@amd.com> References: <1516294577-29078-1-git-send-email-Felix.Kuehling@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.55.251] X-ClientProxiedBy: DM5PR0401CA0065.namprd04.prod.outlook.com (10.167.104.42) To DM5PR1201MB0235.namprd12.prod.outlook.com (10.174.107.23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e4bd7a7c-a6ca-42f5-7107-08d55e94761c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:DM5PR1201MB0235; X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0235; 3:POPu3wOWX4S67TAutsWYrjTQAtzFNq8F5TgYZ2bucd7Ca0LYWthuB2aTzEqbLRAckIaOdjyzlvlV0nZRmD/RkJMMxSRRvBqqBqpzxslyzL3mqPAlU2uDXEaUhHWxkRGwXnT7FSORG7+6TSI2w7i4i7av4WcGJpuy7nLOSKlj75B3CIEc6fdTMVekGG6W3odBNiN16O4VZ54jyhv4bEb70dmu950ZRDELWtmwQIxEPmsa7VsgEhPq/YJCek60psrS; 25:jBlSQWEFpOBb0iMVrAGeoNycygIKaTueJSuvaahYwK0k89b4pfY5UOPQbz4BtImRBe7Pvlx4A+orxaq9gX9EaZO5bcyJEYhOCexuIhTjKj4sl7z+9uUDsDNWpUrpLKLzQXhyYjCQ7P11t3cz4OJ95JVzCXy/3IAG+/yW0Tvyx4ST+iSiTVCTKwL02Bbdo2Vw9+mqHFqzISpgK8UTOU8XoPzmXFQ/kIbo3bJA5YiZ90waJYwpOgu9frikCVE2iyK9kIIhGrcbPQPVZe6JyVHodh3RJZAMrvFaGsVotww7AF4UmcihRaHQQXklgDC1nHTfFxcYmaau/AKNrlzHRgM4IQ==; 31:qSZy9TuN/AkOzlf+cqBulGqOBuKWw4ZL4UEh1iZcvpx5E9TNGCeOvY0VkgXMKyPTpOd8epuqdbkkDIFriWO3RndW+tvq0oAXxxmjGciIVWxI4WaD0EWAcyVDlwmc/LDORgOR7uGSnnnVlVH6pg71FusNFeskHsoLp8/bi63jZkIBrAdK2xixKsPsZx525xql6Zz28Hf1tAS8kdwXyRs5PSnD2s3UsnNxjvSEriIVILI= X-MS-TrafficTypeDiagnostic: DM5PR1201MB0235: X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0235; 20:2fbUWAqA7Qf5GIfF8JWJD5t68Y/50X3TNUoLwcXjZJE2n4WJa4+JmuJQhaCYslTsrS6FiqGRTfLyWwx5j8gqrU7xfG+6tgcin0TQ6bl7S1w/RvwzcjXvpnuu3XUN7Hz+uDErj8cBMw/ULciXzu0B4A/sVk/QhjtKk/Bo4nwc1pPLG0tR72yEsmCNm5hlWtEyjkkJfvHx1UAOc3ZTyOeQCnWmGYbHTGkTOZe9j1QZmkehcAuyNKZNy71jiTaMYsvfZ2hXn2s6cAMCV6F1BnQNZFB1sAamAz/+Jq/AlBc+7sJyK9uJkf8+gGQ6hdcZLBR/NOBh1OYp3vPFVhQzMshJEOX9q7EEQP8QfOqrqBL/DBJaNyTmewDpuxTUWTxm80uIUunXB2sHRwoOPxOZrcVv70+EW5EBJX9BLsQ1sLi4uLsxOeZn4AXxVCtrcBS6NfSDR9bOgoCvIA/0uo+tMczURL0SvYrNRWJ9i70QB3/EGAMjf7Ah/LTRx7UYWEpcG9lY; 4:uZe3gIweKOwrmxjA4s44XDXUU15jqO8RkNqO3p1httEtAFuOyCAYcpQXs8W+Ppnv2u/5Exa2/FusTulnvvazdWrggY9mY0tuxETqz0D1ZkKWCPy0+9bnFaN/qnY+VC5Q3/uTh1vIUH394lQ72/1d4qKlZrAiBt5DfIFM2C7TlXBj7JgCm+odeLy5eqp2QxLGx80gEfmp2ir4jh1l06t2wJapNgUW1JDll35Ix/yV5ciW3d4BQWdjnf79YXJ2SvOUK54pb3BAXOMDd7nAIB4e80CaMhPxJdn7Xrt3i1hhecWWhL6hLVgu2v1mfwTpIQ0W X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231023)(2400064)(944501161)(6055026)(6041268)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:DM5PR1201MB0235; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR1201MB0235; X-Forefront-PRVS: 05568D1FF7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(346002)(39380400002)(396003)(366004)(39860400002)(189003)(199004)(72206003)(5660300001)(478600001)(25786009)(97736004)(36756003)(53936002)(2906002)(450100002)(105586002)(53416004)(3846002)(6116002)(2950100002)(4326008)(106356001)(86362001)(6666003)(316002)(305945005)(81156014)(8936002)(7736002)(59450400001)(50226002)(47776003)(6486002)(66066001)(26005)(81166006)(6636002)(68736007)(51416003)(50466002)(16526018)(76176011)(52116002)(7696005)(386003)(16586007)(8676002)(48376002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR1201MB0235; H:Harpoon.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR1201MB0235; 23:z0hW5vAr9fDgkDFKoXLZPw1t9oRJbh3NCS4PHmy?= =?us-ascii?Q?nwdifaHBOWKyPz5+MHXK1v8qYzhQDHFbxF9BVanY5fZWrV2D7lSqVyhnfHQa?= =?us-ascii?Q?+rIJ/CNklghCaXa6qIREWJKJDF8Y3Ca/DZVww9tLaWQM1jl0Z9II9swFLoXy?= =?us-ascii?Q?bAkvg/TNwVgxVHUnRcwfCQ7NSrx851aTtY0PDLZ6Td7PeYPxDpyfv5w8kFZE?= =?us-ascii?Q?xlxxFhMNYQ95TwVbRAPXK6WDBQYxuBk3/ENFP+tBj3WkbUZF2NO9CpbS4YwF?= =?us-ascii?Q?LbY4VJrLsOT4I14mx0Cs+DkkfI3IF9mqziiTnzLWCL76f/ZdUtDB1dq/r4El?= =?us-ascii?Q?eT4apLSeiYmHT+NK693LKkUvupDL78Iw8UGg5JECqooAJdTaqfxlLR3inM48?= =?us-ascii?Q?PXYxJQVXeW9rerx8ewdtlTgOBSuVZxNPHE6N3/KgQR0o95JfMDF2Gl5BXmc/?= =?us-ascii?Q?OilP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pnne52VcGiIfBH9MMaZA6LhF X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2018 16:56:46.3789 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e4bd7a7c-a6ca-42f5-7107-08d55e94761c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0235 Cc: Felix Kuehling 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 If ttm_bo_swapout doesn't own the lock, don't release it. Someone else probably depends on it still being locked. Signed-off-by: Felix Kuehling --- drivers/gpu/drm/ttm/ttm_bo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 62518b6..893003f 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -1780,8 +1780,8 @@ int ttm_bo_swapout(struct ttm_bo_global *glob, struct ttm_operation_ctx *ctx) * Unreserve without putting on LRU to avoid swapping out an * already swapped buffer. */ - - reservation_object_unlock(bo->resv); + if (locked) + reservation_object_unlock(bo->resv); kref_put(&bo->list_kref, ttm_bo_release_list); return ret; }