Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35145564rwd; Mon, 10 Jul 2023 03:18:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlHgeq+tuAGHAHIsRZ4/YJ5pOuRLjO+D21QuKdfJ6HF8Ba8OhVv8SRSjFGg6seuf/SO6eona X-Received: by 2002:a05:6808:2a55:b0:3a3:b058:6cb2 with SMTP id fa21-20020a0568082a5500b003a3b0586cb2mr11003981oib.0.1688984330781; Mon, 10 Jul 2023 03:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688984330; cv=none; d=google.com; s=arc-20160816; b=ifCVp/ZZSBHf4yWC6BP2eeiIH89RdzXGQoyY/c4Y7H1h9mpGDmEtCMjkArJnc04G2m YWvftzHnamYLv9tOFEP1WlQdcZjrZ03aAZD8ZvRR2OVPNNaBu84aHw+nTOJb4HX8LlV/ llIY8PJbhkT6bUUPGc+Od/uXxEco9yJTCBp2k/E/+LJ1EFCu6YKg8EqIjcfeJjuGnho4 nhsHYTJZzJpGJRLfH4RAJSSVVGvdQh5EJ40K3Z/V4ZjJULHOyvzCchjqlJmceKMqKQTP cTKwPUtwlMxsKyhUsOpf6goWpaDwWLviIKFn5Hz5F75a8wqfO1+opoKbxicsZ4FNJBoY 0zIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :mime-version:user-agent:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=bZfNY1amcFeIbqzozwDJI+7WFPlptOjVffrbsSqWngc=; fh=APacgMF0JNai9+ByF0nrwwwS60g1pkz1zlt775dTpe4=; b=tujUlsULw+jS8P3cPuh1umTsEulkqj3btvnV/yGWnd04l04FG/g8NZ8Y8bpHACRKEz SYom5rX594b7iaCAvNdZFd512l5ZMRAjliFGk3ZNBgsJqXwX44EeeghhplORBQwlp71S KanW2UB21sUBjFmDDURQUnfPPRGnsFqxB93fMpLtr5cPIcV3n5wo/flQMJzB9Myb5Qc/ 11vvQxbuAEczZgrNfRXDG3/q/lvFO8piCIqDu0PHuIbVOzEG4Sz91bbR5C0wxkCEVDwL Ym4H0Z4RaW9sO/IWj/j1l7VqS/ZZvyhuNe9DtZ642iBEB+xIPRBY3J3k3Z6P1TyHBS+e QO7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=acKTHLDG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a38-20020a631a26000000b0055b52a7959esi8783621pga.195.2023.07.10.03.18.38; Mon, 10 Jul 2023 03:18:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=acKTHLDG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233241AbjGJKMe (ORCPT + 99 others); Mon, 10 Jul 2023 06:12:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233313AbjGJKMM (ORCPT ); Mon, 10 Jul 2023 06:12:12 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 807BB30CB; Mon, 10 Jul 2023 03:10:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1688983789; x=1689588589; i=efault@gmx.de; bh=vWxlwa4RN2N9hCfbf+/JCap4SdbQGfrMduX8vY3ZB1Q=; h=X-UI-Sender-Class:Subject:From:To:Cc:Date:In-Reply-To:References; b=acKTHLDGhEpYgiiLy05zde2QBnjexFuWwDShuva21z5qMEuZfxFfKmBWsRzizkCJh9ugjMm sLsmL1eczBjg8lHlHU3UQPsoD3at85qzTvgop9Va/Ps1dnRp60gDh3jUfUuDFW7ZavmHfOLdA NBxkzMQDF/tNCG2IFrMOtScXiOq6xQWpBywATC76t+CDawDEBNAKpAPtEfc4MNnKPI1c730Jq agh8L64VC+evOa5O3R6NfTbdCzmmnsrN+nEg/P8tBUVS+YgzGPNd3eVet9TIe6I8EDwqwmy25 LsnarIp/VPY9lcB3oojhiDOJ0kDd+dP+Zf5Ud+jTiSboCUbbvABg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from homer.fritz.box ([212.114.172.150]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MXp9i-1qUqVF0shw-00Y7JF; Mon, 10 Jul 2023 12:09:49 +0200 Message-ID: Subject: Re: [RT] i915 sleeping function from atomic in gen6_reset_engines() From: Mike Galbraith To: Juri Lelli , Sebastian Andrzej Siewior Cc: linux-rt-users , LKML Date: Mon, 10 Jul 2023 12:09:48 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:K+FXX+fFHhKvdViZsyA5JZWWh9/pnar6JS32Z8a7OeoTL9Zsocn BS417dzkhMqTFL0uDks1APmPaQ0etEePvvL2zRlS16uLLMhavZN7tDwlgVyNXVB8CY35JOj 1ZumGsh1v/rS/qL85Fw76WlasM0OzgeKNI8FIJX9oa4UkaFYslQUAfo6G7ClN1S0x51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JkxGqTHvfuZA= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2023-07-10 at 09:21 +0200, Juri Lelli wrote: > Hi! > > On 23/01/23 17:04, Juri Lelli wrote: > > Hi, > > > > I've just noticed the following while testing v6.2-rc3-rt1. > > I'm still seeing the following on v6.4-rt6. > > I believe 20211006164628.s2mtsdd2jdbfyf7g@linutronix.de=C2=A0should cure= it, > but I don't think it did go anywhere? The raw lock cyclictest deltas don't look great. I shut it up with the below. For my i915 equipped lappy, a raw lock fix would be just fine, its cyclictest numbers already being well south of 'oh dear'. Subject: drm,i915: Don't disable preemption in __intel_gt_reset() for PREE= MPT_RT From: Mike Galbraith Date: Wed Dec 7 10:13:21 CET 2022 BUG: sleeping function called from invalid context at kernel/locking/spin= lock_rt.c:46 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 330, name: systemd= -udevd preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 Preemption disabled at: [] __intel_gt_reset+0x6e/0xe0 [i915] CPU: 0 PID: 330 Comm: systemd-udevd Tainted: G I E 6.1.0.g8= ed710d-master-rt #27 Hardware name: HP HP Spectre x360 Convertible/804F, BIOS F.47 11/22/2017 Call Trace: dump_stack_lvl+0x33/0x46 ? __intel_gt_reset+0x6e/0xe0 [i915] __might_resched+0x162/0x1b0 ? __gen11_reset_engines.isra.21+0x2d0/0x2d0 [i915] rt_spin_lock+0x2d/0x70 gen8_reset_engines+0x33/0x220 [i915] ? __gen11_reset_engines.isra.21+0x2d0/0x2d0 [i915] __intel_gt_reset+0x79/0xe0 [i915] sanitize_gpu.part.17+0x2d/0x40 [i915] i915_driver_probe+0x7b8/0xf20 [i915] ... Replace the preempt_disable()/enable() with a local_lock()/unlock(). Signed-off-by: Mike Galbraith =2D-- drivers/gpu/drm/i915/gt/intel_reset.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) =2D-- a/drivers/gpu/drm/i915/gt/intel_reset.c +++ b/drivers/gpu/drm/i915/gt/intel_reset.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "display/intel_display_reset.h" #include "display/intel_overlay.h" @@ -766,6 +767,14 @@ wa_14015076503_end(struct intel_gt *gt, HECI_H_GS1_ER_PREP, 0); } +struct reset_lock { + local_lock_t lock; +}; + +static DEFINE_PER_CPU(struct reset_lock, reset_lock) =3D { + .lock =3D INIT_LOCAL_LOCK(lock), +}; + int __intel_gt_reset(struct intel_gt *gt, intel_engine_mask_t engine_mask= ) { const int retries =3D engine_mask =3D=3D ALL_ENGINES ? RESET_MAX_RETRIES= : 1; @@ -788,9 +797,9 @@ int __intel_gt_reset(struct intel_gt *gt reset_mask =3D wa_14015076503_start(gt, engine_mask, !retry); GT_TRACE(gt, "engine_mask=3D%x\n", reset_mask); - preempt_disable(); + local_lock(&reset_lock.lock); ret =3D reset(gt, reset_mask, retry); - preempt_enable(); + local_unlock(&reset_lock.lock); wa_14015076503_end(gt, reset_mask); }