Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1675527pxp; Thu, 17 Mar 2022 14:14:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx2Cad3wjp2Z00I3QNh1p2V5dm248TRXTWndQ2INWn2RBsW3IRvA506eQRD8d/e7V09OmZ X-Received: by 2002:a05:6a00:c8a:b0:4f7:a02d:2706 with SMTP id a10-20020a056a000c8a00b004f7a02d2706mr7024642pfv.32.1647551651180; Thu, 17 Mar 2022 14:14:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647551651; cv=none; d=google.com; s=arc-20160816; b=kEr3yC1V+k+SSGqSvhhfY4/39vL11eKZmzRajStoJhY0a6Jp/WGVRj1D3eKQxL8e9M KQoK1SYl6C0owvGQ0Oh3Av1hXX1SHQUhyKjMvv1UQINs5u2A7WVjoovQj3XM3hknfTBI s45nmT9G+Kr3PEO0mCDLwFruerbCgvmGJmWitgOq2+B8w4fGaIs772FDXwWiwgE4oCzm MMV6oWaILGEYNzHo8oN8WkK8LJ7RQQ8QlMXEJejgPLqowltlmwTJ2vrHlAGqZz3XIuIh QUAo0VPlWLbL247l9otbjJRUnhNWDr6vBmizo/KuDVk+ZcYeDvaji2pbeHQ3gkp1g0AB tGPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=hl8P+qRLRH8B9uYa1kVh8yuL9rMFyQViq9H9Yb65PJM=; b=mn3MDY3w6AKZ9dvS9f4tet2o6M/E1G6jNutqwlrrfka3KP+L7tRqF6OHVXlOtOXRtZ QAExPMq8VKUcusJ0EVJqgmtFtPsLwqryT2Z48GVbDF4fGbQu19niadsYVKxSOggReFyp Dc4phFwOlvpsA8UMr0MaN003dUs/2JYCC+AQ7tMHqQ2uWboEl+/XXGjxc3ieek4BYWWX dUJEne8m/PeqRIXh/nqsKwW60pmv6IFMO+rFb0p5O8qXQIoM5WteQZjJqub29zTrpJDs SpG9+1sM6XQzO2AFpQTwmbKnH87IMwwlwXDi7eaP5wNUJUkku8QPQRM5ZABN0ko+K6ad 7vig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=vE5TOZz1; 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=quicinc.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id m20-20020a634c54000000b003816043eef0si3091833pgl.229.2022.03.17.14.14.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 14:14:11 -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=@quicinc.com header.s=qcdkim header.b=vE5TOZz1; 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=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 12D1112E15A; Thu, 17 Mar 2022 13:45:58 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229890AbiCQUrE (ORCPT + 99 others); Thu, 17 Mar 2022 16:47:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229887AbiCQUrC (ORCPT ); Thu, 17 Mar 2022 16:47:02 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ACCA19D61A; Thu, 17 Mar 2022 13:45:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1647549944; x=1679085944; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=hl8P+qRLRH8B9uYa1kVh8yuL9rMFyQViq9H9Yb65PJM=; b=vE5TOZz1Gk0i3j52GTzgvr0DXUksiyaTynqh4zMNIn2x7iUQqk8rjOvu dlcbNnSjNg5duqEApe10Ny1h5BosQa4ipCbxAFsxfcyTHBTcgT6YR9XES EwqDy6BZoNgc3plVpljsxsvkD2XZkFhbe8WP6fTJxifkP2YIc26LeaBBX k=; Received: from unknown (HELO ironmsg02-sd.qualcomm.com) ([10.53.140.142]) by alexa-out-sd-02.qualcomm.com with ESMTP; 17 Mar 2022 13:45:44 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg02-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2022 13:45:42 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 17 Mar 2022 13:45:42 -0700 Received: from [10.216.15.137] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 17 Mar 2022 13:45:37 -0700 Message-ID: <3b066b63-c180-09c6-e39f-b408464b5bc1@quicinc.com> Date: Fri, 18 Mar 2022 02:15:34 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [Freedreno] [PATCH 3/3] drm/msm/gpu: Remove mutex from wait_event condition Content-Language: en-US To: Rob Clark , CC: Rob Clark , Jonathan Marek , David Airlie , , "Vladimir Lypak" , Abhinav Kumar , Bjorn Andersson , Sean Paul , Daniel Vetter , , open list , AngeloGioacchino Del Regno References: <20220310234611.424743-1-robdclark@gmail.com> <20220310234611.424743-4-robdclark@gmail.com> From: Akhil P Oommen In-Reply-To: <20220310234611.424743-4-robdclark@gmail.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 3/11/2022 5:16 AM, Rob Clark wrote: > From: Rob Clark > > 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 > --- > 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 0440a98988fc..661dfa7681fb 100644 > --- a/drivers/gpu/drm/msm/adreno/adreno_device.c > +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c > @@ -607,15 +607,6 @@ 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); I assumed that this lock here was to ensure proper barriers while reading active_submits. Is that not required? -Akhil. > - return active_submits; > -} > - > static int adreno_runtime_suspend(struct device *dev) > { > struct msm_gpu *gpu = dev_to_gpu(dev); > @@ -669,7 +660,7 @@ static int adreno_system_suspend(struct device *dev) > suspend_scheduler(gpu); > > 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");