From patchwork Wed Aug 11 21:34:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 12432009 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FF9CC4338F for ; Wed, 11 Aug 2021 21:34:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BE3E36105A for ; Wed, 11 Aug 2021 21:34:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BE3E36105A Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 983006E1CF; Wed, 11 Aug 2021 21:34:14 +0000 (UTC) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2047.outbound.protection.outlook.com [40.107.243.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1C6776E1CF; Wed, 11 Aug 2021 21:34:12 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DxBQpQM5opzDm0HCGM0EhM8rWKjYzUXeLf3tqctDyJZ0LVQzDcsLWBNXOw4cAO5XV7npxES20zfZ+asiZgORLYTJxWDmXt7Zr76QM/nPRYZIVXIQzzI07nkWIkbEikL9sZ4/WJYc3HBfDkdS+0BhRQOUGmlbb9zHpAvcq4m6kqOKQjVBhTHxc2pqLAAGeEdh5DszPzA+aWd/vxyx1lAqQb8v7VJtKJDaGY6fTndfSg0Oouj4lNGt6XCui8xbvKSAFHBAjbdnTpgmssil5U3n5hqJkUyWWkdNJ0LEIhtmkgMVacyBmsuZnIEhjNn7dex0nI3mLty38fcFlSLz8f5WbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=61I+zyTg8uWqeVul0hqJQKba5zsWcdFNUoB65+SCRrA=; b=eqAsnp5f0fr8ceE37X1a/Xn31e/KwEjv9demjHbjfpsjm4hbIaW+ZDaH06WSNQEbxuYE4lvvJKrXaH0MBEo4Ku5VvtoTUzxlsCsLHxMq5CGgB5kQtGBaGX7CBw7fAknLMZplQS3+a2a2cGAELiw1e3mBQhtDJElCXoWBdEwHNdVNZo1qnJSkgGF4IB54cpUvGItUsOqnmvYWW6iu7nuy4+S8P6oDypK7gpZrzLxT2xEe2xbvMiLOKB9UyCLQnZ6eqIhYJjmq4OltqOqlNsx3BZiKO5Oz5lHFhdnfxkAO+8wwfL5e8R27eNe9OsMI3taFbR7xHsYq4+DNv6YRXctjZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=61I+zyTg8uWqeVul0hqJQKba5zsWcdFNUoB65+SCRrA=; b=QKyeFgOq/Egd/dJcPpEHOz/kv8CoNMrxLAGARY76Upksy7YXyU4boqMo55BrugXcCpyDjihQX7goGqyM0Mm2lcnT4Sc6xkVpngA4eESTGX/hQ34UfDCEz3VS4zUZnM3ZYx60V80vFYWyfX0xM89IeIAd2XUB73t6b/v57Vk5T6Q= Received: from MN2PR12MB3775.namprd12.prod.outlook.com (2603:10b6:208:159::19) by MN2PR12MB4518.namprd12.prod.outlook.com (2603:10b6:208:266::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15; Wed, 11 Aug 2021 21:34:10 +0000 Received: from MN2PR12MB3775.namprd12.prod.outlook.com ([fe80::6c9e:1e08:7617:f756]) by MN2PR12MB3775.namprd12.prod.outlook.com ([fe80::6c9e:1e08:7617:f756%5]) with mapi id 15.20.4394.023; Wed, 11 Aug 2021 21:34:10 +0000 From: "Koenig, Christian" To: =?iso-8859-1?q?Michel_D=E4nzer?= , "Deucher, Alexander" CC: "Liu, Leo" , "Zhu, James" , "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" Subject: AW: [PATCH 2/2] drm/amdgpu: Use mod_delayed_work in JPEG/UVD/VCE/VCN ring_end_use hooks Thread-Topic: [PATCH 2/2] drm/amdgpu: Use mod_delayed_work in JPEG/UVD/VCE/VCN ring_end_use hooks Thread-Index: AQHXjtE+BWy+t4LDY06JadgZjDnxmatu0Vw/ Date: Wed, 11 Aug 2021 21:34:10 +0000 Message-ID: References: <20210811165211.6811-1-michel@daenzer.net>, <20210811165211.6811-2-michel@daenzer.net> In-Reply-To: <20210811165211.6811-2-michel@daenzer.net> Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: daenzer.net; dkim=none (message not signed) header.d=none;daenzer.net; dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 05f0994b-caa0-4c13-2567-08d95d0fc1bd x-ms-traffictypediagnostic: MN2PR12MB4518: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: QkAyYQJ0eTNVB+ooxgrSoB4FW6DxZLYTeeIZ0nx/eGxlGU/VULuVS9w8yIo35MWiJ/vfx31psuPiGyAQYzxflD2qBRzXQiC7Bilrx7+XeuQsmOZTQHLlrlv/nFXiZW5mCurr6SjWoNE16NHvxFbXmuPTptK+z1Kj5PVW8QIoQlKnYBH5p0s8zIotohP6IAqf8JBwscWlcwLVj9fUmZwtdOfdmalLFpbX1UOYtswkqYCsaGVryOH4XiduztCKgCmRvDdi2e5LDkS7j7Vrzku46RTRVUvW3+sz2fKIgXC+YtDk++w1AFryfxLmAHQXlTOXIswaR/Q4P2Z4SZ8SlovLtph3zm+Q05EkLYnRYX1aSqWPh5nyxoxiw8wXsUA1lLPgu1OLnWfG9koWc3p+YL15NEv6uUawLMyR0hpZT6QAB8LlFYdFLpXSd06cWVmC6JZHIfuwNrS7WXA1apam71e3H5Li92Jz/XW5/AHgu1bW9mJC89IaobgZYgeuouIfElVdPT4j4UBLJ4+fISxrlsaYiXDnMusZ8Hyo3NpS1ABj2gr2kKNibFTQW/34WuLH+L10W6EHa0eaGcJewoI1hQmhCku9ryjh4PdV7iZMaXK8V+NzpWePeBSgbFhrTf9XfS+87XVZBGNI5K3KRIv3HrzK3pKBJyuvjmdq0AZskuwqeiuhr8OT9G+zZqYwppU589/JDQBWEx3nYV+yDSIebicqKw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR12MB3775.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(366004)(396003)(346002)(136003)(376002)(54906003)(9686003)(55016002)(316002)(66946007)(91956017)(110136005)(76116006)(6506007)(122000001)(478600001)(186003)(38100700002)(7696005)(26005)(38070700005)(71200400001)(83380400001)(5660300002)(52536014)(6636002)(33656002)(8676002)(8936002)(66446008)(2906002)(4326008)(86362001)(66476007)(66556008)(64756008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?MtZkKHdtPz5BRk+Et25Bwi7?= =?iso-8859-1?q?omo+S9dsCJJCd2Eg6r7sjXlNjjj7qQucZQ8aLcx3fndhxSazrlAiQTWEKYnn?= =?iso-8859-1?q?MUSWZ+3qFe73VUyogQRAz/BpHYtRLq0Bau/tvQEcL2axlXSSh5E5DfHvKBb4?= =?iso-8859-1?q?VXsMzUsJkfXE84a/Ge/MoLfn9MhqvWE54jhU/TFjYMv/wcmFReyAC0ibax/v?= =?iso-8859-1?q?5grUI9o//4o6AmTdptUVHegYQ/AYURvFqmjAATGgUoatL0I+tGifMIPgzVAV?= =?iso-8859-1?q?ub1y/idLKJU06RsY60psgg3qE9oAWcs7gX0TgrLs9GGHO30fDprvBjUH1S01?= =?iso-8859-1?q?tijrPKKpXwe5nkN8KjHfCbTDwfdhfa8jGyyD6YlW2+9Zm69qPLigtBc3rRIt?= =?iso-8859-1?q?I6sQjFg2zSPk6ABza0F5qibQP1gjLNbEzN0nMfDOcrGuYz7tG0hSOZs+7AHc?= =?iso-8859-1?q?s/L2y0QaSEfku1o1dMT+dLK6L7VabDP6g4Mw4J06kvVWhehYCV/fMaQPOLpx?= =?iso-8859-1?q?ZSNI8lWyv0QEWCuU/ggNVgnXZI/How6xSPgDjAbw320KIrynJOhPQMdkLBUN?= =?iso-8859-1?q?N5ip0aKgKQTRNG63j8JqoZG9oRoNf96mV4HXH+6yO48INA8XX4gZi9ZWjLFe?= =?iso-8859-1?q?mtEPnzrKCwlTU6KM0EIaU/x7vg5uq7KHLWtWiSAqrnqbpRWgjO0+HhEhgrJ3?= =?iso-8859-1?q?5xHi20kzCBytEUq38QHsFXl1w8sJsnI/lwWEA651rC9igA493MIJFLog8yRl?= =?iso-8859-1?q?bgW1IQzNAuq/iwAWaHJgrcwCxZItaAopGP8ALz9+4p1nSktZ6YuczNOR8JCc?= =?iso-8859-1?q?kiMJS0/uSP7bB5EIzbcYc06c+XrhqtBwhvl3G5QWkQBt4rQ4KkhxVqkVNClj?= =?iso-8859-1?q?+xkmZNgikxARsmsX8rMvfyX6kLqkF3qUia3X9MMQ3NXs1Fha+ber6yKJYu+y?= =?iso-8859-1?q?01u+49rZ4YqkPcTzVCxmQFzlpLgdi5xKCTPOnXb82yphOegQ/tlp73WWojLX?= =?iso-8859-1?q?PJqsNLDjD4ePpLFujBC53Qq8AxIOEnvr81pI3BVeNnVENWi/O7scBxUrlUge?= =?iso-8859-1?q?oX9dq4D1errUYiPJeVY9DBwZQdiXVp3Sa1X7WEmGFgzonmLASTRBVWb6BRV/?= =?iso-8859-1?q?F1jo+DHz7oUCbpVigOkaKVsTvXHAKD25avOehXvgh4/FkLNDnr6be0bWzqDQ?= =?iso-8859-1?q?2K/l4oo6bWJ43SdLmKF8lVfih4I3GOLL0CUv/U6NGOF1hvDBDS/Z1ZbHKE21?= =?iso-8859-1?q?EnW6syoxCQWfnwqjg1AqnnmGBvdA/aFEO5rgv86n8VxHfmszMJfkaZm63txH?= =?iso-8859-1?q?j6diG7VPWtCT2u5p+eDcCdoAl7NuHIzPgOM5/EzE=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3775.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05f0994b-caa0-4c13-2567-08d95d0fc1bd X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Aug 2021 21:34:10.4497 (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: jWWXKagG3ZquqGlJD0NQ9FbnWaqitJ7+4ZaERuQfbdDLvQ2Q7/YLPuBEFGYiaO9N X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4518 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 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" NAK to at least this patch. Since activating power management while submitting work is problematic cancel_delayed_work() must have been called during begin use or otherwise we have a serious coding problem in the first place. So this change shouldn't make a difference and I suggest to really stick with schedule_delayed_work(). Maybe add a comment how this works? Need to take a closer look at the first patch when I'm back from vacation, but it could be that this applies there as well. Regards, Christian. diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c index 8996cb4ed57a..2c0040153f6c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c @@ -110,7 +110,7 @@ void amdgpu_jpeg_ring_begin_use(struct amdgpu_ring *ring) void amdgpu_jpeg_ring_end_use(struct amdgpu_ring *ring) { atomic_dec(&ring->adev->jpeg.total_submission_cnt); - schedule_delayed_work(&ring->adev->jpeg.idle_work, JPEG_IDLE_TIMEOUT); + mod_delayed_work(system_wq, &ring->adev->jpeg.idle_work, JPEG_IDLE_TIMEOUT); } int amdgpu_jpeg_dec_ring_test_ring(struct amdgpu_ring *ring) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c index 0f576f294d8a..b6b1d7eeb8e5 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c @@ -1283,7 +1283,7 @@ void amdgpu_uvd_ring_begin_use(struct amdgpu_ring *ring) void amdgpu_uvd_ring_end_use(struct amdgpu_ring *ring) { if (!amdgpu_sriov_vf(ring->adev)) - schedule_delayed_work(&ring->adev->uvd.idle_work, UVD_IDLE_TIMEOUT); + mod_delayed_work(system_wq, &ring->adev->uvd.idle_work, UVD_IDLE_TIMEOUT); } /** diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c index 1ae7f824adc7..2253c18a6688 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c @@ -401,7 +401,7 @@ void amdgpu_vce_ring_begin_use(struct amdgpu_ring *ring) void amdgpu_vce_ring_end_use(struct amdgpu_ring *ring) { if (!amdgpu_sriov_vf(ring->adev)) - schedule_delayed_work(&ring->adev->vce.idle_work, VCE_IDLE_TIMEOUT); + mod_delayed_work(system_wq, &ring->adev->vce.idle_work, VCE_IDLE_TIMEOUT); } /** diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c index 284bb42d6c86..d5937ab5ac80 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c @@ -1874,7 +1874,7 @@ void vcn_v1_0_set_pg_for_begin_use(struct amdgpu_ring *ring, bool set_clocks) void vcn_v1_0_ring_end_use(struct amdgpu_ring *ring) { - schedule_delayed_work(&ring->adev->vcn.idle_work, VCN_IDLE_TIMEOUT); + mod_delayed_work(system_wq, &ring->adev->vcn.idle_work, VCN_IDLE_TIMEOUT); mutex_unlock(&ring->adev->vcn.vcn1_jpeg1_workaround); }