Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4466525rwb; Tue, 6 Sep 2022 07:58:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR4AhT0/u00TzPy0B52yrHRuBcTTQTX0LWRicW03faIU54Vs/v4EYYoL62vjlMaI/JFTC2P4 X-Received: by 2002:a17:906:a219:b0:6e4:86a3:44ea with SMTP id r25-20020a170906a21900b006e486a344eamr41458504ejy.385.1662476299527; Tue, 06 Sep 2022 07:58:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662476299; cv=none; d=google.com; s=arc-20160816; b=MTF2DIRIj4/pBQ+6Ah5b/vLMUgh6EKd9sV1ZFFWIXddQTVPglFI4sPQlnEgy/tjlcs MYQ3fBLTcT9u67P7Boa1IgnjrsuF6hKNIuobDB1KtS3Xi6+IkuODwT9HkoTHcWe68JWK RB0NN1HJ3KYDPQR+yntuYchW6u4l54qwzgcZ+TXHZ6pZq+1k9JntGPdEW93dBlyC1juE 6HfXs1Zpgi2Be1Wl2nA+1t8hanEIezh8XH7QBQnduDrJEaZOF07YkPB5On95VPUvDOGC H/x/hP7oKaMx2rQ3asSb8MY0ilMUliRdheUxDXEC4c7d007KdT8EBMU31yrpKsGOpS6/ SQUg== 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=WhQt5S3w2QfpRyk97S25aHuH2GOJrYOMdDe4DZHJEBQ=; b=dl1zOMRVAslHlU7pwCXLefBVQ0y9XRpya9DUAoZiDZ/Wh2USCiCorhqmwFUwLUPw9S /RCH0hRQKOw0jPGThWTp/ymrvphBGA88SrC/+qG8wtVn/CCbs0eAdhl4aBgcnBmasoLU Q/SjclHVCr5cFg5pa+KuTVd3ZOOS7GGye4+CBG37VAwX2gREx5r/pLXKIYUMA9gmujTT zAGYrjYtvLdc9FMZjM2yx6RWM2Tr4JRUP+/oUW461iYOLkQjEX1ifVpis5lWdxyL6lKB LpR7Dj49U6flanf+ZEkKsjV6HNMzl5MkTeD14hjatKmFUQe5j87roeSNDHRYh9IUD24l mrGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=leIKeICS; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne3-20020a1709077b8300b007312789a037si10944354ejc.144.2022.09.06.07.57.54; Tue, 06 Sep 2022 07:58:19 -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=@linuxfoundation.org header.s=korg header.b=leIKeICS; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241773AbiIFOVy (ORCPT + 99 others); Tue, 6 Sep 2022 10:21:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241966AbiIFOTI (ORCPT ); Tue, 6 Sep 2022 10:19:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D975AE1E; Tue, 6 Sep 2022 06:50:08 -0700 (PDT) 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 0354CB818D0; Tue, 6 Sep 2022 13:48:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D52BC433D6; Tue, 6 Sep 2022 13:48:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662472101; bh=VQLh+a20xEIZQ+P8D/7MgSC1pEMZ2OICGNln5U9ZaTU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=leIKeICS4LQIoZQloqVLRbPuUcWdqp8Fgl1oxxvDcQpoWyAfwEkwoczvwAYKoGvc6 w3EAT7DMH4KIu11Pizb220EzUAzScDtYGc43wR1vwytVA0epb2vvxVVvDYS4crvQpA 1x1Z6FvX7avdBslam7CiqQGJ3AsKN+QxpC3hIB+E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniele Ceraolo Spurio , Matthew Brost , John Harrison , John Harrison , Rodrigo Vivi Subject: [PATCH 5.19 149/155] drm/i915/guc: clear stalled request after a reset Date: Tue, 6 Sep 2022 15:31:37 +0200 Message-Id: <20220906132835.711944497@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220906132829.417117002@linuxfoundation.org> References: <20220906132829.417117002@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 From: Daniele Ceraolo Spurio commit 4595a25443447b9542b2a5ee7961eb290e94b496 upstream. If the GuC CTs are full and we need to stall the request submission while waiting for space, we save the stalled request and where the stall occurred; when the CTs have space again we pick up the request submission from where we left off. If a full GT reset occurs, the state of all contexts is cleared and all non-guilty requests are unsubmitted, therefore we need to restart the stalled request submission from scratch. To make sure that we do so, clear the saved request after a reset. Fixes note: the patch that introduced the bug is in 5.15, but no officially supported platform had GuC submission enabled by default in that kernel, so the backport to that particular version (and only that one) can potentially be skipped. Fixes: 925dc1cf58ed ("drm/i915/guc: Implement GuC submission tasklet") Signed-off-by: Daniele Ceraolo Spurio Cc: Matthew Brost Cc: John Harrison Cc: # v5.15+ Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220811210812.3239621-1-daniele.ceraolospurio@intel.com (cherry picked from commit f922fbb0f2ad1fd3e3186f39c46673419e6d9281) Signed-off-by: Rodrigo Vivi Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c @@ -4011,6 +4011,13 @@ static inline void guc_init_lrc_mapping( xa_destroy(&guc->context_lookup); /* + * A reset might have occurred while we had a pending stalled request, + * so make sure we clean that up. + */ + guc->stalled_request = NULL; + guc->submission_stall_reason = STALL_NONE; + + /* * Some contexts might have been pinned before we enabled GuC * submission, so we need to add them to the GuC bookeeping. * Also, after a reset the of the GuC we want to make sure that the