From patchwork Thu Sep 13 11:58:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 10599327 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 16510921 for ; Thu, 13 Sep 2018 11:59:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 056242AA29 for ; Thu, 13 Sep 2018 11:59:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EDA2E2AA39; Thu, 13 Sep 2018 11:59:32 +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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 9CBB12AA29 for ; Thu, 13 Sep 2018 11:59:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 87EC36E680; Thu, 13 Sep 2018 11:59:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680083.outbound.protection.outlook.com [40.107.68.83]) by gabe.freedesktop.org (Postfix) with ESMTPS id 593516E673 for ; Thu, 13 Sep 2018 11:59:23 +0000 (UTC) Received: from fedoratest.localdomain (155.4.205.56) by SN6PR05MB4589.namprd05.prod.outlook.com (2603:10b6:805:38::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.11; Thu, 13 Sep 2018 11:59:18 +0000 From: Thomas Hellstrom To: dri-devel@lists.freedesktop.org, linux-graphics-maintainer@vmware.com Subject: [PATCH -fixes 5/5] drm/vmwgfx: Fix a buffer object eviction regression Date: Thu, 13 Sep 2018 13:58:37 +0200 Message-Id: <20180913115837.7746-5-thellstrom@vmware.com> X-Mailer: git-send-email 2.19.0.rc1 In-Reply-To: <20180913115837.7746-1-thellstrom@vmware.com> References: <20180913115837.7746-1-thellstrom@vmware.com> MIME-Version: 1.0 X-Originating-IP: [155.4.205.56] X-ClientProxiedBy: PR0P264CA0003.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100::15) To SN6PR05MB4589.namprd05.prod.outlook.com (2603:10b6:805:38::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 013fc485-351e-4233-df10-08d619705677 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN6PR05MB4589; X-Microsoft-Exchange-Diagnostics: 1; SN6PR05MB4589; 3:jxsvfcUnSAK9Sj3YjsF4SJqKVp05zR5xXqsI6KuD/bMZ6+evvtTITWk37lIdEAbkyYx78SQzQexIOEj6ygNbAE3GkqDs/0es7LxMFB9Z7awGnuWOo6AK59AOmezRTYRi+ohdHOtqgoNzKL8ofvZQ1f7TUGmS55AHKcvLL+qGCGhNv6Bhmn2WSxr3EDLwauhfEMAcBx36GpMlcZ66jzMWwrOvpQviusUE5oLHMf7E7QxdUNYbTUTuqd3+1vIYcEFt; 25:PEAo3AZNnzijYaPHyQRv5J63IG7+qBQH5vsoftrmQOmK76x70YUkxhktX0O9ievqoY9Cn7+6CtPI3n+NU1shpvpqAXEQ1/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DAyUz9Hi0/eetRTtBkXoH2p4FnR75ZRVVRym5ah2HbFiD3U7qzYKC+bzI3z0YnQb4ecQEFZpb2QA5EBiVLZRTXBjxfBZKzdHANnE7SqU/xyzUQu+EbG7WQC9QkBtvqDEA3J4fyyEZw+efPKvUOqXjBvuq/LKKw0=; 4:gzv2gfwh1YC4cn8u0f8OK9S3OJR1PNEU3f7X57mntSKyWBOAh9EfC2WvV3gU7y2pFfhQCEwCWuqJ0zlY57QIp1FXB1gpMe05Xw6l4Nn/h1tWzZhZlTswN4j30umSrdvQdH1B4/ncT11CRtC05DNZpRwQS0zeNKIFKhGn4JcN0Vsm5WvpJsjna9OPiTgZhmavjWWQ+PNaR1U2ynbTuocXPamIDbUUJ2ScAcL3WKVakTGcaZmW0NPqDmaBhNJ3vc9sfZZSCHMHPfe+UKz09xD457P6KeoT8r+ol0/7JLkDB5zWyATd0br4EBIX9tt/j8+Q X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(61668805478150); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823301075)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(201708071742011)(7699050); SRVR:SN6PR05MB4589; BCL:0; PCL:0; RULEID:; SRVR:SN6PR05MB4589; X-Forefront-PRVS: 07943272E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(376002)(39860400002)(136003)(366004)(346002)(199004)(189003)(2906002)(6512007)(81156014)(5660300001)(386003)(106356001)(105586002)(6506007)(53936002)(2870700001)(26005)(6666003)(6636002)(97736004)(36756003)(16526019)(51416003)(186003)(486006)(76176011)(11346002)(50466002)(81166006)(52116002)(956004)(8676002)(446003)(476003)(6486002)(48376002)(478600001)(316002)(2616005)(68736007)(66066001)(305945005)(4326008)(14444005)(1076002)(575784001)(50226002)(47776003)(8936002)(86362001)(6116002)(7736002)(54906003)(3846002)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR05MB4589; H:fedoratest.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN6PR05MB4589; 23:V2KyWZFDYd0EfI67XUrz/ut9yRPi/sRw4uax8E4nL?= 8RsL/BT+SKyT3X6lpoM1n/TlAF+Yc9fK83lk4wDZwmHX7MojwrmlVR8N3e9Inqks3At/eMyqBjkCWaFxhc5qo7nictOX/f2L4xBL7uglG8D02UhZEpt1Uwn0ASgWRTX6Uc6IuAVzx+JY4bFcqjhFkM3g28SzIk1kSqFypNY4Af9c0u5QCE/hi6NXxvED7UkTnLAsdRDH+w+Xx+UQ0MHbkIkiKmmplp0gRsEeHPRpB+zC0avg6Cjsyj4S57qfgk18dc5QKgCNmcLEYtF4bYY7yjCtVnfL4Jl//y86O56YB4F35EzsPDFFT4WS2WUBJR47yzcCkig4manreVBZrx1x3yhA+wLCKO71IEIaJ4rjT5TYSy+i2Nk9zb1Kh5G5Cm4zv9xKOTTs3dptOI2n9GtkY3a/yYXx686qwlJ4S43S4h7bg05FldkLSyLloy/dhXm1CoAUvC9A00aLC7QhXchTlgncOmvzmenex2PIaB0laMv5KrFmdWFXiatyca9q59/39h89HkJQ/8AqKNRwtuVnB3G4zH0M/C1yvspWy3FL9esHRRGKT4I5r4GwGTSIoN5yJVB5MpPPjYtQH/lSd1ZVtVTP07EEy/lIbwLU72S/4uBZxv3Z0OL/6u8Gb+vUhUTzSENs2lgDviWkAbGTKFk6364Sk4C3zuVi6ZctCz38a36KLmraatK5bgjCGUM9ljMaEeF7X+8JeZdPWNHYOPHN0C9ACrV0EvgP5CiTTwxBXDdHJH9VGQdd6FYD2IW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RWWGaG6ztjQ3Br5BCwLTWUBo4rzBhvv3mvKRpYWs3O4P+f4WhBI7S06kh9ilXxOWeHOk3iJ5ACQd4q8A302gk7y1BPRKKKxdq0sgAVmyQFbyY+SNqQevriopmItDoFYXMCW54wAOOK7f/sNHXgaTxyrrVpoonEfbEcubPY7aNRWqYv4TZ3wlM1Tl/MXMb7uzhPKmRLCHmKN28ImBhn0iefB8kvohEkI6bEQG61osDYVzJCy3BfMzbV+o7egm5iBd+ftFRLkjlR7tW8KrQg==; 5:D8L9uFDnOXj27+4ecgGduczMPFQDqU90IbnOO7+bUnE2/253C549L5iaQNCcyYOW7ALRsRzSylqn4v5C1pIuPSUuX43bEwBfiiFSuTCoiXcqCbbOpq4jsEJSlQd2EpyvI1iwLqvrqxIVN+8sKVnS7RVhUkNYEMtwFT8CNSz8I2c=; 7:u7lMIwaqEDiKzzJDrFh92WU2k+EE/f8J8t73vEFNSaV4jdkpigGvDyTaIwbXH8/pgZJXaeUTmwHiW3Z38Eevb+CqgnS+BbeMT2qsrEK26vmm+fi/nY3f8xS2eC3G4IYCMys2nrgurxX+rtXsBUH1Hmbfm5fV9HRgqmc/SOV4rmdUfUel9i7py6NdEL6b4IMNMNAK7aD7Swm8iD8rSJMOu8oeq0i2IZRzX15UjCD15gRXoLpqHi44miCywCE15m+7 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN6PR05MB4589; 20:/aMDE1/csqppEGCLjlmpDTJQmxCTx+zrBKmKUAdWQxKhtpa4d+HRb3L1UEOUw17v1ljHEDz6bw6l0fj8XheD6tiHdvba2b2oPnRB+kDy22+iEMgvhtMmjLF5CIk0lpoOmU77DsEAE2i7qtCeC/rOpRiQPmWB7geWOYL4s2/uG2Q= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2018 11:59:18.6844 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 013fc485-351e-4233-df10-08d619705677 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR05MB4589 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: pv-drivers@vmware.com, Thomas Hellstrom , Matthew Wilcox Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Commit 4eb085e42fde ("drm/vmwgfx: Convert to new IDA API") indroduced an incorrect return value from the function vmw_gmrid_man_get_node(), when we run out if integer ids. Instead of returning 0 (meaning non-fatal error) we forward the ida_simple_get error code -ENOSPC. This causes TTM not to retry allocation after buffer eviction and instead return -ENOSPC to user-space. Fix this by returning 0 when ida_simple_get() returns -ENOSPC. Tested using glretrace. Cc: Matthew Wilcox Signed-off-by: Thomas Hellstrom Reviewed-by: Charmaine Lee Reviewed-by: Deepak Rawat --- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c index b93c558dd86e..a38a0c3777f7 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c @@ -57,7 +57,7 @@ static int vmw_gmrid_man_get_node(struct ttm_mem_type_manager *man, id = ida_alloc_max(&gman->gmr_ida, gman->max_gmr_ids - 1, GFP_KERNEL); if (id < 0) - return id; + return (id == -ENOSPC ? 0 : id); spin_lock(&gman->lock);