From patchwork Tue Mar 12 16:57:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10849543 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 2AADE13B5 for ; Tue, 12 Mar 2019 16:57:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13E9B2980A for ; Tue, 12 Mar 2019 16:57:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 125A22981E; Tue, 12 Mar 2019 16:57:21 +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 8520F29826 for ; Tue, 12 Mar 2019 16:57:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5167489F89; Tue, 12 Mar 2019 16:57:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-eopbgr790050.outbound.protection.outlook.com [40.107.79.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3B2FD89C16; Tue, 12 Mar 2019 16:57:16 +0000 (UTC) Received: from BN6PR1201CA0019.namprd12.prod.outlook.com (2603:10b6:405:4c::29) by BY2PR12MB0583.namprd12.prod.outlook.com (2a01:111:e400:52dd::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.20; Tue, 12 Mar 2019 16:57:14 +0000 Received: from CO1NAM03FT020.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::209) by BN6PR1201CA0019.outlook.office365.com (2603:10b6:405:4c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.13 via Frontend Transport; Tue, 12 Mar 2019 16:57:13 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT020.mail.protection.outlook.com (10.152.80.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1686.19 via Frontend Transport; Tue, 12 Mar 2019 16:57:13 +0000 Received: from agrodzovsky-All-Series.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Tue, 12 Mar 2019 11:57:11 -0500 From: Andrey Grodzovsky To: , , , Subject: [PATCH] drm/v3d: Fix calling drm_sched_resubmit_jobs for same sched. Date: Tue, 12 Mar 2019 12:57:02 -0400 Message-ID: <1552409822-17230-1-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(396003)(136003)(376002)(346002)(2980300002)(428003)(199004)(189003)(48376002)(50466002)(2201001)(86362001)(4326008)(50226002)(305945005)(68736007)(476003)(486006)(44832011)(126002)(426003)(106466001)(2906002)(72206003)(53936002)(97736004)(2616005)(14444005)(356004)(6666004)(478600001)(336012)(104016004)(16586007)(316002)(81166006)(186003)(77096007)(47776003)(26005)(110136005)(8676002)(81156014)(53416004)(5660300002)(105586002)(8936002)(51416003)(7696005)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR12MB0583; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 75941a3a-6b10-4d20-28e3-08d6a70bc662 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060); SRVR:BY2PR12MB0583; X-MS-TrafficTypeDiagnostic: BY2PR12MB0583: X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0583; 20:00jwNm8dKkIhaby4u8NOaKVOLJFubXNNGShvAHvyx19Y20YOfegsDcHUFyeXArvZqKkOUS7F5Mg01fFfzoROScrdhACSLaEuwjrfilkf4zn3cWcg1FhJ+DzttuBqdKGWFI556KE/fGRH5jXOwou1sN2t4ogSeUne1ysSailDgb6jSsMJoRB/LHrJHItOrrr9rTWeZNbuFrgxclFTifGcBjDuFSnYoXexSoLwjRhMGXL1W7cMMQLPfWIiylGDmXebYADIGtNJcIAPnjI60LjcMun+BCNKsrzR0CbYTxqfEseqysjXGyoigfX6jCfpHZ2at34H4epcDhKJtdZrZ3BFRKaGHo8GN4p0ZTSpGkgubID2/3EPFuDqcSnO+XD1r3ZDbEthh7bCColn0GInvn0x6cqu84mBXR5DqkkhBGNGPRLtG5Yp2yKhsM69lqRQcwNbw/E6v82XSaWvzfJS6zXVSoctqpTK3n1LmIJo7vdk6f8aLKzvgMTY/fVHy1lwNUST X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 09749A275C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR12MB0583; 23:iLXlU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vFJ9fM96zfFSZZ5AZLqS9U2WD9n0++Kzk/KLuSH2OTEXZL+V/5K03hUuRurlb+FkIAX9Vhi X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: l/FUv5RLeQcA0KBSY+zyn5hU7s0kmeZCGCU4cVIhFQuqfhtUxMP1inDVZkn7yPC/6cDNHBylEI0SMtRAQjeU/B2LWY05sutVGq28rzDTuLNnYywzH5UeWnwVit0BLDf5EfhU+pCp3SuzEBWtpIAAsI7oNGv8v2FTwFkP6ABaxsnZULUy/wdKfM4A0ilPhc1RIyVoTG6sBY4tCSIcgPdemsxqUucxL6LPjA83fVGDLLtEUnLYjyEV5nk7DaokWwRkCk70G08GspyMHqpziUix7ew6NjL2+vVUdW2ObxenDHNaqVo1o6nYnbxuM4OLdidA9JKqdR66n/ur4wg5I50z2PUCsE8UVwR/iVj3rFFpgP4zorO51AAPjQXPx4OWHhFTY6IaYij0khHqWAE4vj2cOjsRJgwT3hLnBOORmdZ+Nn0= X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0583; 20:8YLVe5H9+WnGyFmyXOYvUDPymMs8FvkyohIAIExhPkBO7F9eBMP8LHs5mK9vmFl6GAc3nrPlX98CcMGcL41e2yDiLTzal6EbiOb4i8ZkOWHP+gz552fV6Zwu1DobZzrnXzVLXCI+AGOt/fYjTJUv86uAz8vMxmDWmAlNIe141lLoUV1LWJGixUTLu0qbQCbn9FkWV8m3pigikjwC0ETpWG0diIWcwFFAtKbvV0jF2Vh3hw72EXmIl9mSrCM9t7Z8 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2019 16:57:13.2152 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 75941a3a-6b10-4d20-28e3-08d6a70bc662 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR12MB0583 X-Mailman-Original-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:X-MS-Exchange-SenderADCheck; bh=vmG0RwBMeiHPlTxJyoRrI7TupvffNqGcJYxxSg3gtMU=; b=t7UHuE4jYrOsXI8jS30sTJfm14f6frYdkuGrnaOCSbxlNgqvZTPPl80DZJ34a6ZdwR2BNFu/cGcAtdflkUxyCc4cCDDfJrZrYAlupWL3JmW7QE8afsEyzOfvJ2dYN0SFROvrbk0wt0tpowLhBWdycljW53vaa2DECNnV57R10cE= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; tomeuvizoso.net; dkim=none (message not signed) header.d=none;tomeuvizoso.net; dmarc=permerror action=none header.from=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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Also stop calling drm_sched_increase_karma multiple times. Signed-off-by: Andrey Grodzovsky Acked-by: Christian König --- drivers/gpu/drm/v3d/v3d_sched.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/v3d/v3d_sched.c b/drivers/gpu/drm/v3d/v3d_sched.c index 4704b2d..ce7c737b 100644 --- a/drivers/gpu/drm/v3d/v3d_sched.c +++ b/drivers/gpu/drm/v3d/v3d_sched.c @@ -231,20 +231,17 @@ v3d_gpu_reset_for_timeout(struct v3d_dev *v3d, struct drm_sched_job *sched_job) mutex_lock(&v3d->reset_lock); /* block scheduler */ - for (q = 0; q < V3D_MAX_QUEUES; q++) { - struct drm_gpu_scheduler *sched = &v3d->queue[q].sched; - - drm_sched_stop(sched); + for (q = 0; q < V3D_MAX_QUEUES; q++) + drm_sched_stop(&v3d->queue[q].sched); - if(sched_job) - drm_sched_increase_karma(sched_job); - } + if(sched_job) + drm_sched_increase_karma(sched_job); /* get the GPU back into the init state */ v3d_reset(v3d); for (q = 0; q < V3D_MAX_QUEUES; q++) - drm_sched_resubmit_jobs(sched_job->sched); + drm_sched_resubmit_jobs(&v3d->queue[q].sched); /* Unblock schedulers and restart their jobs. */ for (q = 0; q < V3D_MAX_QUEUES; q++) {