From patchwork Wed Jun 26 06:40:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Kuehling X-Patchwork-Id: 11017015 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AA0321398 for ; Wed, 26 Jun 2019 06:40:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96F99283B2 for ; Wed, 26 Jun 2019 06:40:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B21A286A2; Wed, 26 Jun 2019 06:40:24 +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=-3.7 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_WEB 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 478C6283B2 for ; Wed, 26 Jun 2019 06:40:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B49F86E28E; Wed, 26 Jun 2019 06:40:21 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-eopbgr800075.outbound.protection.outlook.com [40.107.80.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8A2256E28C; Wed, 26 Jun 2019 06:40:19 +0000 (UTC) Received: from DM6PR12MB3947.namprd12.prod.outlook.com (10.255.174.156) by DM6PR12MB3835.namprd12.prod.outlook.com (10.255.173.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2008.16; Wed, 26 Jun 2019 06:40:16 +0000 Received: from DM6PR12MB3947.namprd12.prod.outlook.com ([fe80::5964:8c3c:1b5b:c480]) by DM6PR12MB3947.namprd12.prod.outlook.com ([fe80::5964:8c3c:1b5b:c480%2]) with mapi id 15.20.2008.017; Wed, 26 Jun 2019 06:40:16 +0000 From: "Kuehling, Felix" To: "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" Subject: [PATCH 1/1] drm/ttm: return -EBUSY if waiting for busy BO fails Thread-Topic: [PATCH 1/1] drm/ttm: return -EBUSY if waiting for busy BO fails Thread-Index: AQHVK+oDNe/OvjJJB0qJniNoSHCIOQ== Date: Wed, 26 Jun 2019 06:40:16 +0000 Message-ID: <20190626063958.19941-1-Felix.Kuehling@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [165.204.55.251] x-mailer: git-send-email 2.17.1 x-clientproxiedby: YTXPR0101CA0064.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b00:1::41) To DM6PR12MB3947.namprd12.prod.outlook.com (2603:10b6:5:1cb::28) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3d3717ba-9eb6-4a1c-5f49-08d6fa0125e8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:DM6PR12MB3835; x-ms-traffictypediagnostic: DM6PR12MB3835: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2512; x-forefront-prvs: 00808B16F3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(396003)(346002)(136003)(39860400002)(199004)(189003)(71190400001)(81156014)(6512007)(36756003)(8936002)(53936002)(7736002)(305945005)(256004)(8676002)(52116002)(81166006)(386003)(99286004)(6506007)(6116002)(14444005)(26005)(5660300002)(3846002)(6486002)(6436002)(68736007)(50226002)(450100002)(54906003)(110136005)(2616005)(316002)(2906002)(25786009)(4326008)(1076003)(64756008)(14454004)(73956011)(66556008)(66946007)(66476007)(66446008)(102836004)(486006)(186003)(4744005)(72206003)(478600001)(66066001)(71200400001)(86362001)(2501003)(476003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR12MB3835; H:DM6PR12MB3947.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 0y1edPcHZaKBIA53pmKmO34qRs7uvV68auJCcynF7WHO3zl+sQUWuIsKW1du1XiipE/WFbP0AqYMlDlFx3Vb8HW8eTNiB5HNDzR3s9GhPMFxRSUnwGV9QBL+2NLAou3htU4gpPMP6ZbLW9YELbjC2rLSZdiXddZOvHFxW9EcC28Z+Sa2mzsrIuouqjwGH54YE2p7pKEPKIXCzFo4FMxnUke+UqW7xsIEuEFq4VpmKl34Jc+oa0fCZU0eWU/0m15aHHhcLii/VECm76dVPlMAEjyJr6cjLPhI70Qf84Ymw2Sk38d/p1Hh5v5PED2+VX4aJKASa2mQb9/pBwkhL0kd+sSHhDhpbJEeQMpJENqXxty+v+271fPGwXUSYe2K+Cw9+bwWG6PtHXDFfEgKdAQKfPNjubatquZgMTdDbBZ/Fpk= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3d3717ba-9eb6-4a1c-5f49-08d6fa0125e8 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Jun 2019 06:40:16.6125 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: fkuehlin@amd.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3835 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cm3oxMYUbXfaZLo3FWcvWpAooS9rBkBF5NLC4QXxN2Y=; b=qohTNFEzTda8OlzTXVnYo1An1e/lHbwDuGknlYoh5kqdQhop03fDn8NmQPSoNmrVC/NWV3v9Ge/IV1Ozd5XQOSHD1GGZG2YuvDXg6u/5wHYg39DFwoMNFTKPYqkfEMu3oWZmhFPYhoYBTwbH7bwcLPNuVzVQ0l80F4wiHtUK7ak= X-Mailman-Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Felix.Kuehling@amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Kuehling, Felix" , "Koenig, Christian" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Returning -EAGAIN prevents ttm_bo_mem_space from trying alternate placements and can lead to live-locks in amdgpu_cs, retrying indefinitely and never succeeding. Fixes: cfcc52e477e4 ("drm/ttm: fix busy memory to fail other user v10") CC: Christian Koenig Signed-off-by: Felix Kuehling --- drivers/gpu/drm/ttm/ttm_bo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index c7de667d482a..58c403eda04e 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -827,7 +827,7 @@ static int ttm_mem_evict_wait_busy(struct ttm_buffer_object *busy_bo, if (!r) reservation_object_unlock(busy_bo->resv); - return r == -EDEADLK ? -EAGAIN : r; + return r == -EDEADLK ? -EBUSY : r; } static int ttm_mem_evict_first(struct ttm_bo_device *bdev,