Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4429839ioa; Wed, 27 Apr 2022 03:48:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzY7KnCS5QnB4smqqi5VAUxz2OcphHiUMlXIOIp5Gj9MtTYAPxzNYl1bG0qNUGkDRiCXk2D X-Received: by 2002:a05:6a00:894:b0:4fe:25d7:f59e with SMTP id q20-20020a056a00089400b004fe25d7f59emr29546792pfj.58.1651056529069; Wed, 27 Apr 2022 03:48:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651056529; cv=none; d=google.com; s=arc-20160816; b=xOOgr/rpb6rIXsvvo1wL2yfYPaElNLD71E9NL45G32gNlrdZKnkL6u5fZxoTDHQ+5l 5lKmfYmD0t810tYoArJjssRIgSiPtP/Zmj22NwbySRVoBa44yLI1fRRVY5JvtpOG3bUg gGEhVJ7lThAfZ8yU4keRcPWfH2GpVvWmgBm2x2RFyWdtQZS9Jbo2WH6R8I5ZGSiu8045 dRToYrPwEXLZ3RWfFK6tXVEAaRtuHpAvpcOjWMZ9BcMUYr99oJxGf2L4bFWp0sq+gcCR DrCbYHbE41ThzmsLmTXZqlqVyo4XvMSw3oryOE7cXhMCdeq1WLUPdWQ3Zr1f1J2y9shr Tp9Q== 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=5r2r4SV2C5zWDnGjIRtSiqWlRoOjvGfN2uCQb7pW2wo=; b=hg1cX9UFKhVjvueOQ5+BbItXBfpcQdhJQQ1bBJGMcFs4fJQsqX6BbXIKncVsRTW/sF laSL/eIBkX9YCRly55lFu2wJjwVhUmOLPjob1tLpeMZpxUidi0nQkP+Y6RKwd8Zq3jxq rqqHlkS++QtxEpLeho5Miq6yUoRcYZOro36u17bHnIJi/NKrY+WT/bWJ9g6SDMiBKzBn gMaHZpEi2vJB10Hva3Jl4MaBh5x09NYgzqU2RaCLJqvhSB0HhN3MHHqLtxS8k2KrJn9G EKeU3tihIgUzWJrOdQmpeCE9XxaggqRM7dx/QeYCKJ6gFqIzC85XCtN1mB+CWX+niFs3 jUBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cauXoI3Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c1-20020a170902848100b001588a10836bsi1178592plo.9.2022.04.27.03.48.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 03:48:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cauXoI3Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 923884122A1; Wed, 27 Apr 2022 02:55:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344785AbiDZJdo (ORCPT + 99 others); Tue, 26 Apr 2022 05:33:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347856AbiDZJGQ (ORCPT ); Tue, 26 Apr 2022 05:06:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0396F167F1E; Tue, 26 Apr 2022 01:46:19 -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 dfw.source.kernel.org (Postfix) with ESMTPS id A75E1604F5; Tue, 26 Apr 2022 08:46:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97777C385A4; Tue, 26 Apr 2022 08:46:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650962778; bh=HHSBzrlIipK0nujA927z1nFCcxi1J+e1mhmEtz+5L5w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cauXoI3ZmrqtyU8cdJO+L7m7yPyHXwoi+TY8SZpmuUsJwGP+DNIgYh2jOjzryYU42 9l0BBUwM4/g0KqITrGwNQsfOYu/CjT9TWA58cMlVYcNuWueKtWmX74gJGK+9JkeaK+ p7EaZWyZDnonLlDynN5bQe4DoT5oDzx9gpbuCNEw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rob Clark , Sasha Levin Subject: [PATCH 5.17 059/146] drm/msm/gpu: Remove mutex from wait_event condition Date: Tue, 26 Apr 2022 10:20:54 +0200 Message-Id: <20220426081751.726569557@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220426081750.051179617@linuxfoundation.org> References: <20220426081750.051179617@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable 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: Rob Clark [ Upstream commit 7242795d520d3fb48e005e3c96ba54bb59639d6e ] The mutex wasn't really protecting anything before. Before the previous patch we could still be racing with the scheduler's kthread, as that is not necessarily frozen yet. Now that we've parked the sched threads, the only race is with jobs retiring, and that is harmless, ie. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20220310234611.424743-4-robdclark@gmail.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/adreno/adreno_device.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c index b93de79000e1..e8a8240a6868 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_device.c +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c @@ -608,22 +608,13 @@ static int adreno_runtime_resume(struct device *dev) return gpu->funcs->pm_resume(gpu); } -static int active_submits(struct msm_gpu *gpu) -{ - int active_submits; - mutex_lock(&gpu->active_lock); - active_submits = gpu->active_submits; - mutex_unlock(&gpu->active_lock); - return active_submits; -} - static int adreno_runtime_suspend(struct device *dev) { struct msm_gpu *gpu = dev_to_gpu(dev); int remaining; remaining = wait_event_timeout(gpu->retire_event, - active_submits(gpu) == 0, + gpu->active_submits == 0, msecs_to_jiffies(1000)); if (remaining == 0) { dev_err(dev, "Timeout waiting for GPU to suspend\n"); -- 2.35.1