Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp4743384pxb; Mon, 28 Mar 2022 02:38:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhiPYItgAacyn7T50YBoxdVocwYBfhqiWfV6Lt1akrCVxeKMX/GqWdkERf0FUv6I/CsGLe X-Received: by 2002:a17:906:b102:b0:6db:1487:e73 with SMTP id u2-20020a170906b10200b006db14870e73mr25612385ejy.474.1648460305010; Mon, 28 Mar 2022 02:38:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648460305; cv=none; d=google.com; s=arc-20160816; b=nx736/aTBF0pHtGMJEiBa5uShkkumkfE2ssr5Pbz81A5E2DLFYxS//wGndZ59alMm+ rc1ytv7fp3wU9GjT8eWDrjWUOmlaLbjoGR0urau8QmzBc1QxMt/V8ta7oIMZMyBHHv/4 YmBcX5+C6XSu8XhpKW8nf6WI0QYzJLxlEgjJPqFzxwv6bK0C/OjhSNYDFJN6eHTB5Xi7 Ij/RZ9cvO7Zp2kogSeC1XSO9uvegFFROSu7ZwYFVX6hOFCL04vlPnihK60nZ+vM1+xmB Jzv4e1OznPVIPvNVMBWAqr5csFiWNKOM9TxI7lglKT3oWxyriPOsf57lXF9qCJZHILiw XsoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=RvdjHbxHXH3R+fSS8vP7AvU+1vTRky2D7zX1X0jinKQ=; b=hJh3s7uaFApvxKPB+7ye+/8XDMh3In0tpRnz9bLcmq+IvBrYvTADoB0mHtaoOI2vrV a0JGZYRk9lFOQ1vqmd9C6MpP0puO2vzFHmVhI3ThZjutPNEpuyFxOpcB3D3Tm6/hl8Gf rvLnPi0gRkE5kB1k6fMY5yKEUahkJxCPfmAR55NKDasYnoHr3n2gGNUBuPESyaWRsfmc 6T+U2QdLQHOYLOviHNFhVfpd7zHzl0KtC0hZTZHaKyx+o44pN5tJK4hcxRhbXOIGdSqY Oa3sZrN35bMBmDeJuP5KzrMzAcBmBYBCN38QnEKgXffuwJn0CCtHnCSJmFcLRPfYKO6/ VWhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n9-20020aa7c789000000b00418d81456e5si11837786eds.459.2022.03.28.02.38.06; Mon, 28 Mar 2022 02:38:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238500AbiC1GjN (ORCPT + 68 others); Mon, 28 Mar 2022 02:39:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238377AbiC1GjM (ORCPT ); Mon, 28 Mar 2022 02:39:12 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 427E348E7F; Sun, 27 Mar 2022 23:37:28 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 6558068B05; Mon, 28 Mar 2022 08:37:23 +0200 (CEST) Date: Mon, 28 Mar 2022 08:37:23 +0200 From: Christoph Hellwig To: Linus Torvalds Cc: Robin Murphy , Toke =?iso-8859-1?Q?H=F8iland-J=F8rgensen?= , Christoph Hellwig , Halil Pasic , Oleksandr Natalenko , Marek Szyprowski , Kalle Valo , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Olha Cherevyk , iommu , linux-wireless , Netdev , Linux Kernel Mailing List , Greg Kroah-Hartman , stable Subject: Re: [REGRESSION] Recent swiotlb DMA_FROM_DEVICE fixes break ath9k-based AP Message-ID: <20220328063723.GA29405@lst.de> References: <1812355.tdWV9SEqCh@natalenko.name> <27b5a287-7a33-9a8b-ad6d-04746735fb0c@arm.com> <20220324190216.0efa067f.pasic@linux.ibm.com> <20220325163204.GB16426@lst.de> <87y20x7vaz.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,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-wireless@vger.kernel.org On Fri, Mar 25, 2022 at 11:46:09AM -0700, Linus Torvalds wrote: > I think my list of three different sync cases (not just two! It's not > just about whether to sync for the CPU or the device, it's also about > what direction the data itself is taking) is correct. > > But maybe I'm wrong. At the high level you are correct. It is all about which direction the data is taking. That is the direction argument that all the map/unmap/sync call take. The sync calls then just toggle the ownership. You seem to hate that ownership concept, but I don't see how things could work without that ownership concept as we're going to be in trouble without having that. And yes, a peek operation could work in some cases, but it would have to be at the cache line granularity. arch/arc/mm/dma.c has a really good comment how these transfers relate to actual cache operations btw> * * | map == for_device | unmap == for_cpu * |---------------------------------------------------------------- * TO_DEV | writeback writeback | none none * FROM_DEV | invalidate invalidate | invalidate* invalidate* * BIDIR | writeback+inv writeback+inv | invalidate invalidate * * [*] needed for CPU speculative prefetches