From patchwork Thu Aug 9 00:15:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Souza, Jose" X-Patchwork-Id: 10560647 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 3D18F90E3 for ; Thu, 9 Aug 2018 00:17:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3013120952 for ; Thu, 9 Aug 2018 00:17:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 24A0F2AC60; Thu, 9 Aug 2018 00:17:04 +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=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 B93FF20952 for ; Thu, 9 Aug 2018 00:17:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ADCF46E62E; Thu, 9 Aug 2018 00:16:55 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 849D66E61B for ; Thu, 9 Aug 2018 00:16:54 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Aug 2018 17:16:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,212,1531810800"; d="scan'208";a="60976898" Received: from josouza-mobl.jf.intel.com ([10.24.11.40]) by fmsmga007.fm.intel.com with ESMTP; 08 Aug 2018 17:16:54 -0700 From: =?utf-8?q?Jos=C3=A9_Roberto_de_Souza?= To: intel-gfx@lists.freedesktop.org Date: Wed, 8 Aug 2018 17:15:57 -0700 Message-Id: <20180809001606.26876-11-jose.souza@intel.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180809001606.26876-1-jose.souza@intel.com> References: <20180809001606.26876-1-jose.souza@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 11/20] drm/i915: Grab a runtime pm reference before run live selftests X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Now that modeset stuff is not being initialized when display is disabled nothing is holding a power well or runtime pm reference when running live selftests. And IGT runs live selftests with display on and off, causing the below warning: [ 473.586533] Setting dangerous option live_selftests - tainting kernel [ 484.219068] ------------[ cut here ]------------ [ 484.219070] RPM wakelock ref not held during HW access [ 484.219126] WARNING: CPU: 3 PID: 4659 at drivers/gpu/drm/i915/intel_drv.h:1986 intel_runtime_pm_get_noresume+0x6c/0x70 [i915] [ 484.219128] Modules linked in: i915(+) amdgpu chash gpu_sched ttm vgem snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic btusb btrtl btbcm x86_pkg_temp_thermal btintel coretemp snd_hda_codec asix crct10dif_pclmul bluetooth crc32_pclmul usbnet snd_hwdep mii snd_hda_core ghash_clmulni_intel e1000e snd_pcm ecdh_generic mei_me mei prime_numbers pinctrl_sunrisepoint pinctrl_intel [last unloaded: i915] [ 484.219173] CPU: 3 PID: 4659 Comm: drv_selftest Tainted: G U 4.18.0-rc8-CI-Trybot_2696+ #1 [ 484.219174] Hardware name: Intel Corporation Kabylake Client platform/Kabylake R DDR4 RVP, BIOS KBLSE2R1.R00.X078.P02.1703030515 03/03/2017 [ 484.219205] RIP: 0010:intel_runtime_pm_get_noresume+0x6c/0x70 [i915] [ 484.219206] Code: 94 77 20 00 01 e8 04 bf 53 e0 0f 0b eb c5 80 3d 83 77 20 00 00 75 c6 48 c7 c7 50 b4 ca a0 c6 05 73 77 20 00 01 e8 e4 be 53 e0 <0f> 0b eb af 41 54 55 53 80 bf e4 ab 00 00 00 48 89 fb 48 8b af e0 [ 484.219277] RSP: 0018:ffffc900003bfa10 EFLAGS: 00010286 [ 484.219279] RAX: 0000000000000000 RBX: ffff88023c160000 RCX: 0000000000000001 [ 484.219281] RDX: 0000000080000001 RSI: ffffffff820c708c RDI: 00000000ffffffff [ 484.219282] RBP: ffff8802b4ceb3f8 R08: 00000000afcc94fa R09: 0000000000000000 [ 484.219284] R10: ffff8802b5820358 R11: 0000000000000000 R12: ffff88023c160068 [ 484.219285] R13: ffffffffa0c80e30 R14: ffffffffa0cce2a0 R15: ffff88023c160000 [ 484.219287] FS: 00007f4d95a83980(0000) GS:ffff8802becc0000(0000) knlGS:0000000000000000 [ 484.219288] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 484.219290] CR2: 00007f4d953257a0 CR3: 00000001fa1d8001 CR4: 00000000003606e0 [ 484.219291] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 484.219292] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 484.219294] Call Trace: [ 484.219328] i915_gem_unpark+0xb9/0x170 [i915] [ 484.219361] igt_mmap_offset_exhaustion+0x365/0x6e0 [i915] [ 484.219400] ? __i915_subtests+0x39/0xf0 [i915] [ 484.219403] ? ring_buffer_unlock_commit+0x20/0xd0 [ 484.219406] ? trace_vbprintk+0x171/0x220 [ 484.219411] ? __trace_bprintk+0x57/0x80 [ 484.219450] __i915_subtests+0x5e/0xf0 [i915] [ 484.219487] __run_selftests+0x10b/0x190 [i915] [ 484.219522] i915_live_selftests+0x2c/0x60 [i915] [ 484.219552] i915_pci_probe+0x50/0xa0 [i915] [ 484.219556] pci_device_probe+0xa1/0x130 [ 484.219560] driver_probe_device+0x2f5/0x470 So now grabbing and releasing a runtime pm reference around i915_live_selftests() call. Signed-off-by: José Roberto de Souza --- drivers/gpu/drm/i915/i915_pci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c index e931b48369dd..d43b950c2798 100644 --- a/drivers/gpu/drm/i915/i915_pci.c +++ b/drivers/gpu/drm/i915/i915_pci.c @@ -695,6 +695,7 @@ static void i915_pci_remove(struct pci_dev *pdev) static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { + struct drm_i915_private *dev_priv; struct intel_device_info *intel_info = (struct intel_device_info *) ent->driver_data; int err; @@ -730,7 +731,10 @@ static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) return -ENODEV; } + dev_priv = to_i915(pci_get_drvdata(pdev)); + intel_runtime_pm_get(dev_priv); err = i915_live_selftests(pdev); + intel_runtime_pm_put(dev_priv); if (err) { i915_pci_remove(pdev); return err > 0 ? -ENOTTY : err;