From patchwork Fri Jan 19 03:19:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "He, Hongbo" X-Patchwork-Id: 10174631 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 4A21B60386 for ; Fri, 19 Jan 2018 06:31:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AB8E285DA for ; Fri, 19 Jan 2018 06:31:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FA57285F0; Fri, 19 Jan 2018 06:31:23 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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 303A1285DA for ; Fri, 19 Jan 2018 06:31:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E7B376E98E; Fri, 19 Jan 2018 06:24:03 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0048.outbound.protection.outlook.com [104.47.33.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id AB5286E00E; Fri, 19 Jan 2018 03:19:45 +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=LfZ5KRfkgVP+C6ZGmFbV4VzwV2CWgyNk2+1i/AlOKXA=; b=gYEMSKESeUJg+UgVlMYy1ry0N9AAUdImjm+jJq0WQzqr/9xzWymFPuX1893OGPVlnmuLUgZmWyoh2oiov7UsClgk7UJNH6rW6ABGeklbWJ/kYb54AxWub3yMTXHCyCAHRNKKNx1qmCDmcQRj+ata1XFP4K9dDFhLcRKR9sOOY38= Received: from MWHPR1201MB0127.namprd12.prod.outlook.com (10.174.98.142) by MWHPR1201MB0238.namprd12.prod.outlook.com (10.174.99.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Fri, 19 Jan 2018 03:19:43 +0000 Received: from MWHPR1201MB0127.namprd12.prod.outlook.com ([10.174.98.142]) by MWHPR1201MB0127.namprd12.prod.outlook.com ([10.174.98.142]) with mapi id 15.20.0407.012; Fri, 19 Jan 2018 03:19:42 +0000 From: "He, Roger" To: "Kuehling, Felix" , "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "Koenig, Christian" Subject: RE: [PATCH 2/2] drm/ttm: Don't unreserve swapped BOs that were previously reserved Thread-Topic: [PATCH 2/2] drm/ttm: Don't unreserve swapped BOs that were previously reserved Thread-Index: AQHTkH1Ur08fS3XzpEKnH4MZJvqAuqN6hvvQ Date: Fri, 19 Jan 2018 03:19:42 +0000 Message-ID: References: <1516294577-29078-1-git-send-email-Felix.Kuehling@amd.com> <1516294577-29078-2-git-send-email-Felix.Kuehling@amd.com> In-Reply-To: <1516294577-29078-2-git-send-email-Felix.Kuehling@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Hongbo.He@amd.com; x-originating-ip: [116.228.147.241] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; MWHPR1201MB0238; 7:uJHKRxUkrQgyzf2uu5FzXla8FmoZGVkwGDITRc77wAVi7zkORyragSq0myhPedbfVwVanRzYVK2gAxlxRpbYAgcpTZCV+uIMmaUVEsX3uNy+RXalWWI/vUPfBB2beYqMcDp+um4/4nLDFVihFFG9ZwLHxRfhJCSkF30Dd/krIwjr+w5M0n3UQwf0S7rw+tgETuGv31/m0ihpW62AYRt8bkLz45VeI9ya0lMcsuJ1MaLK83L3Ab69hPiJu7p2+aoA; 20:33vw0sgvD0QyHWaz453nclgDBitQvLt7EiyGDo7TJdL1/9mO7hZcSteLMsHXT4csy73fcAt/Lgg8LgNTSVZfe1O/3qQGCKzyCVV8sJTtvrL6fFPP41W3LaE4X0vcGYBbSEMpUBZiqWHVl/K0+xt+CZKxHuf7kxeazN/OXrzQNivBKufD0ciD2aRY/lxrwiNvkU7Fr7OliupmGWqMjB6pjmfzMq/oLvy6qBZGfv01kC+SwgHuEn9llJMkznSolt59 x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(396003)(39860400002)(376002)(366004)(346002)(39380400002)(13464003)(189003)(199004)(53546011)(5660300001)(305945005)(74316002)(105586002)(229853002)(6246003)(53936002)(9686003)(6436002)(478600001)(55016002)(25786009)(2906002)(7736002)(102836004)(6506007)(59450400001)(33656002)(81156014)(72206003)(450100002)(76176011)(3280700002)(99286004)(3846002)(316002)(68736007)(110136005)(14454004)(6636002)(81166006)(8676002)(2201001)(106356001)(2900100001)(66066001)(86362001)(97736004)(8936002)(6116002)(77096007)(7696005)(26005)(3660700001)(2501003)(2950100002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR1201MB0238; H:MWHPR1201MB0127.namprd12.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; x-ms-office365-filtering-correlation-id: 838d8dca-556a-4b99-1bf0-08d55eeb7b7c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(3008032)(48565401081)(2017052603307)(7153060)(7193020); SRVR:MWHPR1201MB0238; x-ms-traffictypediagnostic: MWHPR1201MB0238: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(767451399110)(217544274631240); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231023)(2400071)(944501161)(6055026)(6041268)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011); SRVR:MWHPR1201MB0238; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:MWHPR1201MB0238; x-forefront-prvs: 0557CBAD84 received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: T5Q/TX1nfbHaUBrYk856UQAjHU+wIPQGL04lLKjZ9sRipjLJOVxo8Yo7hBdN+esjILXRKXnMZ3Fdry3I4UkmNA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 838d8dca-556a-4b99-1bf0-08d55eeb7b7c X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jan 2018 03:19:42.3599 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0238 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 good catch! Thanks Roger(Hongbo.He) -----Original Message----- From: Kuehling, Felix Sent: Friday, January 19, 2018 12:56 AM To: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; Koenig, Christian ; He, Roger Cc: Kuehling, Felix Subject: [PATCH 2/2] drm/ttm: Don't unreserve swapped BOs that were previously reserved 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(-) -- 2.7.4 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; }