Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp433589rwd; Thu, 1 Jun 2023 02:13:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6AwuvfQd65h5kU9wAGYHoDEiZ4REwMvxZ2MjLRK26OHcMnm8pUq7bhbADtlDuL1qYjYG2P X-Received: by 2002:a17:90a:a595:b0:256:1441:95b5 with SMTP id b21-20020a17090aa59500b00256144195b5mr5663495pjq.29.1685610824940; Thu, 01 Jun 2023 02:13:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685610824; cv=none; d=google.com; s=arc-20160816; b=Pmetm0FrMMaudwiSSORqUmeDmYoQYJC3pVPkEcH1BV9CfJw1dcZFJXCW/y2HzqZp26 ApgLsPDjConadELhocdPzbXVlPLRc2lXBYOGHeNkm6/VgTHLyOOMWLbz4CiIkvuR+peM Ok87X70hi9xFxeZFYmVvBYQz4qTLoXc2+z8rMUKkNj8rHJPKXmxwb/dL2kqq2s9SatDU PDJahhr9IS0VsQ7kQp4W305uG20Q0/dr7ICuuXn/pcx0WViYGAAMw/PVjMLMiJ7HhUar dFXT7epaVivFjnGSXTnpAncWt1eeuSbX4JFlN19o4tNu1KChU6DImsP4G6Rvi1xIHyTN nW3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=uTTNvr1qhLMEkf9G1ffCkQXl7pSyLr5vqtrukSA7j18=; b=ZvPu1Zxn7YmQ1YaSzSHU2l/Z8mnNFtCHuaLk5RreioshmGmPaMS2iiDBsQ3r9hTtqP m3mpQtGuTFwMHNy2VcF1P8i17v87u/x4PuBwIds2ovxkc84cmcscCn5pwJP9rNXqmMtc n7JAjRQlyaYDOzFVUTm5kkLrz857KQHXv8U4o74pgq/H3gKkVEkiMM5a4IdceYyr1snQ 5ZT5vTytrgmUT/p5PjNT7OsVhkN4JkzmpQjogW0m9Xaw3LK6GGKu3tBTNmX3CADSCD5S b50HkPAKHLGRhqf10E5dYO43D8g5OjBOFuO+FV/OcpUOuzsIgqCdubeQsRvOiyYXL+J9 fIfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="SHPCH/ar"; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pc14-20020a17090b3b8e00b002568a675b65si804772pjb.141.2023.06.01.02.13.31; Thu, 01 Jun 2023 02:13:44 -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=@kernel.org header.s=k20201202 header.b="SHPCH/ar"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232601AbjFAJCy (ORCPT + 99 others); Thu, 1 Jun 2023 05:02:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232597AbjFAJCn (ORCPT ); Thu, 1 Jun 2023 05:02:43 -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 065E9E40; Thu, 1 Jun 2023 02:02: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 dfw.source.kernel.org (Postfix) with ESMTPS id A124864221; Thu, 1 Jun 2023 09:01:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F326EC433D2; Thu, 1 Jun 2023 09:01:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685610115; bh=4qQydQYRMrUOcNRnymjEdMYj9KOx6NIt5j1b1rQ06po=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SHPCH/armNDPorE+cc3Xb3TXoWoApNaKS29MS+NEXf6sQ/2Mz8KZnELAt6eo0JkFI vHBkYpsSVnV5qsc0rMP3PF5pfX7oUL4Sfp9fguKwNwff4N5gBx4XOB+fpR37F7VWEI h/3NZIwevah72IbNwlMfIC4R/Uwma5mW+3xUZYQ67/9WKX78D/AJ/NZYs/6PXnohCa dLsDaKPh6+A3FgQUiZh3lngNpdPts4aiXMMvaM5cUb5Xb028NhIneDbyKjdQXmPq3k 2JNyFfB1YzWXNVxBn4xbmVN+b0BifFzs70E0o30zjeC6VMTHBZO8doYnpQXnrLw+u1 QFoHrgiDb3iAg== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1q4eC0-0007BU-Sj; Thu, 01 Jun 2023 11:02:00 +0200 Date: Thu, 1 Jun 2023 11:02:00 +0200 From: Johan Hovold To: Doug Anderson , Rob Clark , Dmitry Baryshkov Cc: 'Johan Hovold , Abhinav Kumar , Sean Paul , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] drm/msm/a6xx: fix uninitialised lock in init error path Message-ID: References: <20230531075854.703-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 Wed, May 31, 2023 at 07:22:49AM -0700, Doug Anderson wrote: > Hi, > > On Wed, May 31, 2023 at 1:00 AM Johan Hovold wrote: > > > > A recent commit started taking the GMU lock in the GPU destroy path, > > which on GPU initialisation failure is called before the GMU and its > > lock have been initialised. > > > > Make sure that the GMU has been initialised before taking the lock in > > a6xx_destroy() and drop the now redundant check from a6xx_gmu_remove(). > > > > Fixes: 4cd15a3e8b36 ("drm/msm/a6xx: Make GPU destroy a bit safer") > > Cc: stable@vger.kernel.org # 6.3 > > Cc: Douglas Anderson > > Signed-off-by: Johan Hovold > > --- > > drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 3 --- > > drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 9 ++++++--- > > 2 files changed, 6 insertions(+), 6 deletions(-) > > I think Dmitry already posted a patch 1.5 months ago to fix this. > > https://lore.kernel.org/r/20230410165908.3094626-1-dmitry.baryshkov@linaro.org Bah, I checked if Bjorn had hit this with his recent A690 v3 series and posted a fix, but did not look further than that. > Can you confirm that works for you? That looks like it would work too, but I think I prefer my version which keeps the initialisation of the GMU struct in a6xx_gmu_init(). Dmitry or Rob, could you see to that either version gets merged soon so that we don't end up with even more people having to debug and fix the same issue? Johan