Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3654023pxb; Mon, 24 Jan 2022 14:31:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJwivubX3FynyJsR5ZAqmac74f75yjBeEaCC54Q62GV+h9W803CHyde306XgZSlFI+qLkcQu X-Received: by 2002:a17:90a:77c6:: with SMTP id e6mr450212pjs.115.1643063519580; Mon, 24 Jan 2022 14:31:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643063519; cv=none; d=google.com; s=arc-20160816; b=QTZ7Za41O2sjn9I/RyVgGx1B+dFORaV3m7fAvUErOEzBxSYvKPydR4hxHCPMKMEkW6 thZguLlvO3jnTkdzv7CW26YACkuZjbumT7AwiKC2bA7SPwMPbhFmbE/NUTGjX2uFI+Bs yzg9RA5CMvYn4GJP9Q9vJw7AzLb8XP3ze8yS5X1emn6Y3BsLSwGC+0BiN6lpbznK/7Ay r5EWvkBGAsmhi+AsE+ZhAUcg56XeRkHkFD9d0tBTQw5Jz/3q1nrtHvTKnOXhXReUkiJ2 0pMeAQ4jI50kN4amQ3ntUOTDIAiZN2Mz2VoMXKkmHFuErLV6mDBRrqnP8Gk1p2ps3vX7 X4rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9raAHRbnGijALsFX5LIprtrCIZ5Lgjdfc2/igw9Rggk=; b=NWAFXZrsKyzLObWbsnODcg2WKkoZD4ekUiWBkca/00e5FIm2zkU2Hpnqb26vHm7KMj CCpj1FJmBoZF21jiMlrTTYH0nJdyMxJmpvay9Qwm2U3hKclNHJ05U6eIsfCzn3DL05JO 1ZNSfkpfHZAM8FRgsndQXObvRNY1M5X6MrEg20UMx5Zs2T8nTUVPjbJwy6QrLOxrlugS zeWiHC+cdkaD5sRz+aTAMAZVRAWbwVUTZpz+C7UjJPaWFV7BEugLLuXhFR6zZJmveF4b YHSEJjtkOgR8PGch35awKQG8/ZnavjoxbWdTz7TuzqT02K/ggSDqrD6AomSL+WY3TD2l IccQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JryVdkoJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y1si492721pjb.70.2022.01.24.14.31.46; Mon, 24 Jan 2022 14:31:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JryVdkoJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1587201AbiAXW14 (ORCPT + 99 others); Mon, 24 Jan 2022 17:27:56 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:46782 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1454796AbiAXVdn (ORCPT ); Mon, 24 Jan 2022 16:33:43 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7F1D2B81233; Mon, 24 Jan 2022 21:33:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2FFAC340E4; Mon, 24 Jan 2022 21:33:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060020; bh=yg7nmv7uay7Pj6NDNSVSmBGl9495vlN68aIKhTtxQGw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JryVdkoJskiRSaJ+mlp07iig0a9C2hpf0YIyOTXj15pRJWrr3icUdCjH46gx9j3p3 pGirozeVxzco9MaI9ckdMuv3x0YyhHCSSq0Swt9xvQcLj0P1g1iBr0WSe1eriwAEB/ 9x3EvICcTczPm9CRhKSCpUL1bVEGv2yCP55SrzD8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lee Shawn C , Juston Li , Daniele Ceraolo Spurio , John Harrison , Tvrtko Ursulin , Sasha Levin Subject: [PATCH 5.16 0813/1039] drm/i915/pxp: Hold RPM wakelock during PXP unbind Date: Mon, 24 Jan 2022 19:43:22 +0100 Message-Id: <20220124184152.635190440@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Juston Li [ Upstream commit f9535d28ac93c3cc326f7215fccd0abe1d3a6083 ] Similar to commit b8d8436840ca ("drm/i915/gt: Hold RPM wakelock during PXP suspend") but to fix the same warning for unbind during shutdown: ------------[ cut here ]------------ RPM wakelock ref not held during HW access WARNING: CPU: 0 PID: 4139 at drivers/gpu/drm/i915/intel_runtime_pm.h:115 gen12_fwtable_write32+0x1b7/0 Modules linked in: 8021q ccm rfcomm cmac algif_hash algif_skcipher af_alg uinput snd_hda_codec_hdmi vf industrialio iwl7000_mac80211 cros_ec_sensorhub lzo_rle lzo_compress zram iwlwifi cfg80211 joydev CPU: 0 PID: 4139 Comm: halt Tainted: G U W 5.10.84 #13 344e11e079c4a03940d949e537eab645f6 RIP: 0010:gen12_fwtable_write32+0x1b7/0x200 Code: 48 c7 c7 fc b3 b5 89 31 c0 e8 2c f3 ad ff 0f 0b e9 04 ff ff ff c6 05 71 e9 1d 01 01 48 c7 c7 d67 RSP: 0018:ffffa09ec0bb3bb0 EFLAGS: 00010246 RAX: 12dde97bbd260300 RBX: 00000000000320f0 RCX: ffffffff89e60ea0 RDX: 0000000000000000 RSI: 00000000ffffdfff RDI: ffffffff89e60e70 RBP: ffffa09ec0bb3bd8 R08: 0000000000000000 R09: ffffa09ec0bb3950 R10: 00000000ffffdfff R11: ffffffff89e91160 R12: 0000000000000000 R13: 0000000028121969 R14: ffff9515c32f0990 R15: 0000000040000000 FS: 0000790dcf225740(0000) GS:ffff951737800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000058b25efae147 CR3: 0000000133ea6001 CR4: 0000000000770ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: intel_pxp_fini_hw+0x2f/0x39 i915_pxp_tee_component_unbind+0x1c/0x42 component_unbind+0x32/0x48 component_unbind_all+0x80/0x9d take_down_master+0x24/0x36 component_master_del+0x56/0x70 mei_pxp_remove+0x2c/0x68 mei_cl_device_remove+0x35/0x68 device_release_driver_internal+0x100/0x1a1 mei_cl_bus_remove_device+0x21/0x79 mei_cl_bus_remove_devices+0x3b/0x51 mei_stop+0x3b/0xae mei_me_shutdown+0x23/0x58 device_shutdown+0x144/0x1d3 kernel_power_off+0x13/0x4c __se_sys_reboot+0x1d4/0x1e9 do_syscall_64+0x43/0x55 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x790dcf316273 Code: 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 89 fa be 69 19 12 28 bf ad8 RSP: 002b:00007ffca0df9198 EFLAGS: 00000202 ORIG_RAX: 00000000000000a9 RAX: ffffffffffffffda RBX: 000000004321fedc RCX: 0000790dcf316273 RDX: 000000004321fedc RSI: 0000000028121969 RDI: 00000000fee1dead RBP: 00007ffca0df9200 R08: 0000000000000007 R09: 0000563ce8cd8970 R10: 0000000000000000 R11: 0000000000000202 R12: 00007ffca0df9308 R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000003 ---[ end trace 2f501b01b348f114 ]--- ACPI: Preparing to enter system sleep state S5 reboot: Power down Changes since v1: - Rebase to latest drm-tip Fixes: 0cfab4cb3c4e ("drm/i915/pxp: Enable PXP power management") Suggested-by: Lee Shawn C Signed-off-by: Juston Li Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220106200236.489656-2-juston.li@intel.com (cherry picked from commit 57ded5fc98b11d76dae505ca3591b61c9dbbbda7) Signed-off-by: Tvrtko Ursulin Signed-off-by: Sasha Levin --- drivers/gpu/drm/i915/pxp/intel_pxp_tee.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c b/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c index 49508f31dcb73..d2980370d9297 100644 --- a/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c +++ b/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c @@ -103,9 +103,12 @@ static int i915_pxp_tee_component_bind(struct device *i915_kdev, static void i915_pxp_tee_component_unbind(struct device *i915_kdev, struct device *tee_kdev, void *data) { + struct drm_i915_private *i915 = kdev_to_i915(i915_kdev); struct intel_pxp *pxp = i915_dev_to_pxp(i915_kdev); + intel_wakeref_t wakeref; - intel_pxp_fini_hw(pxp); + with_intel_runtime_pm_if_in_use(&i915->runtime_pm, wakeref) + intel_pxp_fini_hw(pxp); mutex_lock(&pxp->tee_mutex); pxp->pxp_component = NULL; -- 2.34.1