Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1949402rwb; Fri, 2 Dec 2022 03:30:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf724knw3hgsYvmuW3CTwMiNmxwnZFbKFfN9QdDeDqFevLxItuUha6HDCIK+6039Qo6iQdvW X-Received: by 2002:a05:6402:2993:b0:462:845:ba98 with SMTP id eq19-20020a056402299300b004620845ba98mr8685871edb.12.1669980636430; Fri, 02 Dec 2022 03:30:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669980636; cv=none; d=google.com; s=arc-20160816; b=EfNb6XQGxUG2B9EX5s2pbYeF3xQTRA0ulzcYLYH5cx9qLzC0g2C1gvhg7vVZ99VDZ5 ED45O7VHU0VIQqX1+lhqwqU8gEsOawNwJKOn0wX2vPrC8cYUx+zFt0JTVAaJzGgNoEnR JNkxqlosJgUyStQzY+o/DkStSXU98OjEx1VowcJAlsiTrmbcLm77AoSXNs/vSqebsf+p 5GF9vFHtOuqItgz+AKsVyEQm7GRP8L4Gr78qHFTi4ixRukw6Ws+lGRQff6uPe/zumIBi muwKhhPef87ps3ZSurZ/9lAzCNMu8Fw93/M8irToH72txQjegbQSC8/WSSaZsTht8dba 9xkA== 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=87xJ37nY6S8gWCE8fBJ5L7O3V8ksDd+rlKQ9M8Zl788=; b=tUU7G3eO7/WXoUToDDaNPPaQ22dfKuLy98Q3gt+dSESjr/MIxJNT0wDGMnGIiwRR8g 6dF2XvLYC6UOCyn7YCN0fqocbwVQeQi3eyU77PQcUuGF7hyXlnZFHMyeN6JBiIbpKUAY EQ63KGjSj93E0RtIl4ddspMgRwEidL3JiB1nM1StxBKhdqgX1wUHW1yE0oLg4EeQME5A hAAy6kEzTYbgiewrfpWGdLykEaRpEl1rdRrMYUUW0dT0Ofks7+V7WiFYR4zChjGlbvux PuJ36p1P4oiy4f0rgmLTH9bk+dH74w/wieCkB2WOInml1SPOnrTytHsT/kfgf+CsSJ71 /PeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uUHv3AJ7; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xj7-20020a170906db0700b007c08bfea548si6079423ejb.382.2022.12.02.03.30.15; Fri, 02 Dec 2022 03:30:36 -0800 (PST) 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=@linaro.org header.s=google header.b=uUHv3AJ7; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233257AbiLBKzM (ORCPT + 83 others); Fri, 2 Dec 2022 05:55:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233255AbiLBKyq (ORCPT ); Fri, 2 Dec 2022 05:54:46 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13CCCD3793 for ; Fri, 2 Dec 2022 02:54:12 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id b11so4585670pjp.2 for ; Fri, 02 Dec 2022 02:54:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=87xJ37nY6S8gWCE8fBJ5L7O3V8ksDd+rlKQ9M8Zl788=; b=uUHv3AJ7VaCpRzS1HBAjRlglZSkNl0PxQgPX6vJPHIwbKyFm/frG6lqLOVK6s7TRv/ 0NouhTV4G31CjYEPZch3UibLYVMEW5m0FfDfV3GaaLXug/bmyOb0CzpvpDzc2vJzDjLr zlwiiRcPGtLYgc5eY7LMHskyOr6a5uqRU8W+282dAvSPxPFX+rH8HozAedTbgTBwgiFU crH2tyK6qkw/Wq+ngaN+z7BVS0qso4UoDc4PJMBvkgNSTOXuvQ4JlbVy66VgabXcXvhD jyMev/cykbECybYt2nbwZplNbh9hR+oF1roOkNjO7f/IF+Nc9oOF+7Mwrqy23BK7LLuD x5rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=87xJ37nY6S8gWCE8fBJ5L7O3V8ksDd+rlKQ9M8Zl788=; b=YSIcISIeQXV6Bng2D8mhDxFWZw/X5u1vzTBupgzg56Y4ORFCbrcf8ZEKbidhlhsjIj ZKpfiTFU72R36+eHANRU+s1nD9A4cr0L2NH+5c3Zwdycw8Q7+z9T+3ycCfaTrL7MyGUf AqLRQ8/qQjkRbqgdLs79EhAPY2gXimmcMn1ZN0YZyJzPoGGSY9Lrp8RVilJwL6RUX7fP Jj6wCXjSeMNSZl4fjP03KwFdI53Bypr9dTeHApYEl2lPewvZAN+OeeyJP6u2yf0xqr7G lFHTfblbJ6+9QUw8PnGydORTdYFUJ7bZSRBERKhgx/PSOP7j/kBShuZpQhANjK8dJ9pb JbaA== X-Gm-Message-State: ANoB5pkb3QN4kwSOTXNFfygPBR/gtdDnKBP1qERCfuwOE38BISPmA4es 3WrAHIhL1apFZQbM7D4dnw3i X-Received: by 2002:a17:90b:2801:b0:200:2069:7702 with SMTP id qb1-20020a17090b280100b0020020697702mr76236667pjb.239.1669978451512; Fri, 02 Dec 2022 02:54:11 -0800 (PST) Received: from thinkpad ([27.111.75.154]) by smtp.gmail.com with ESMTPSA id v3-20020a170902e8c300b0017f59ebafe7sm5246857plg.212.2022.12.02.02.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 02:54:10 -0800 (PST) Date: Fri, 2 Dec 2022 16:24:03 +0530 From: Manivannan Sadhasivam To: Will Deacon Cc: Thorsten Leemhuis , Amit Pundir , Catalin Marinas , Sibi Sankar , Robin Murphy , andersson@kernel.org, sumit.semwal@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, hch@lst.de, gregkh@linuxfoundation.org Subject: Re: [PATCH] Revert "arm64: dma: Drop cache invalidation from arch_dma_prep_coherent()" Message-ID: <20221202105403.GG5356@thinkpad> References: <20221118105402.GA184726@thinkpad> <20221118123349.GC3697@willie-the-truck> <20221121064224.GB11945@thinkpad> <018517b8-0ae0-54f5-f342-dcf1b3330a13@quicinc.com> <6d637906-e1d5-c481-a73d-2b2b845e223b@leemhuis.info> <20221202100357.GB29396@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221202100357.GB29396@willie-the-truck> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 Fri, Dec 02, 2022 at 10:03:58AM +0000, Will Deacon wrote: > On Fri, Dec 02, 2022 at 09:54:05AM +0100, Thorsten Leemhuis wrote: > > On 02.12.22 09:26, Amit Pundir wrote: > > > On Thu, 1 Dec 2022 at 23:15, Catalin Marinas wrote: > > >> > > >> On Thu, Dec 01, 2022 at 10:29:39AM +0100, Thorsten Leemhuis wrote: > > >>> Has any progress been made to fix this regression? It afaics is not a > > >>> release critical issue, but well, it still would be nice to get this > > >>> fixed before 6.1 is released. > > >> > > >> The only (nearly) risk-free "fix" for 6.1 would be to revert the commit > > >> that exposed the driver bug. It doesn't fix the actual bug, it only > > >> makes it less likely to happen. > > >> > > >> I like the original commit removing the cache invalidation as it shows > > >> drivers not behaving properly > > > > Yeah, I understand that, but I guess it's my job to ask at this point: > > "is continuing to live with the old behavior for one or two more cycles" > > that much of a problem"? > > That wouldn't be a problem. The problem is that I haven't see any efforts > from the Qualcomm side to actually fix the drivers so what makes you think > the issue will be addressed in one or two more cycles? On the other hand, if > there were patches out there trying to fix the drivers and we just needed to > revert this change to buy them some time, then that would obviously be the > right thing to do. > There are efforts going on to fix the driver from Qualcomm. It's just that the patches are not available yet. The delay is mainly due to the internal communication that should happen between the internal teams. The fix would be use a separate no-map carveout for the usecase. But it'd be good to revert this patch untill those patches get merged. Thanks, Mani > > >> but, as a workaround, we could add a > > >> command line option to force back the old behaviour (defaulting to the > > >> new one) until the driver is fixed. > > > > Well, sometimes that approach is fine to fix a regression, but I'm not > > sure this is one of those situations, as this... > > > > > We use DB845c extensively for mainline and android-mainline[1] testing > > > with AOSP, and it is broken for weeks now. So be it a temporary > > > workaround or a proper driver fix in place, we'd really appreciate a > > > quick fix here. > > > > ...doesn't sound like we are not talking about some odd corner case > > here. But in the end that would be up to Linus to decide. > > The issue is that these drivers are abusing the DMA API to manage buffers > which are being transferred to trustzone. Even with the revert, this is > broken (the CPU can speculate from the kernel's cacheable linear mapping > of memory), it just appears to be less likely with the CPUs on this SoC. > So we end up in a situation where the kernel is flakey on these devices > but with even less incentive for the drivers to be fixed. > > As well as broken drivers, the patch has also identified broken device-tree > files where DMA-coherent devices weher incorrectly being treated as > non-coherent: > > https://lore.kernel.org/linux-arm-kernel/20221124142501.29314-1-johan+linaro@kernel.org/ > > so I do think it's something that's worth having as the default behaviour. > > > I'll point him to this thread once more in my weekly report anyway. > > Maybe I'll even suggest to revert this change, not sure yet. > > As I said above, I think the revert makes sense if the drivers are actually > being fixed, but I'm not seeing any movement at all on that front. > > Will -- மணிவண்ணன் சதாசிவம்