Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp4598211pxb; Sun, 27 Mar 2022 23:02:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWeFY5Vm4F+yHkhi0uO82fCcD/3KjqVZpKj3zqBiM2Di14loa6U6nwZX45JXVIbr9PkaWu X-Received: by 2002:a17:907:9485:b0:6da:aa54:a88 with SMTP id dm5-20020a170907948500b006daaa540a88mr26206306ejc.427.1648447319735; Sun, 27 Mar 2022 23:01:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648447319; cv=none; d=google.com; s=arc-20160816; b=G3kx4cX0gK4XQdxHM+MON4Ud1JiQSBh6D1EfLq4vL8QddJLVPdCy0eoE6IVuYeYM1m B414pV3rgg4Me7A6EzLOzvfnQSI4yOdOuSkq+xBTkHn42VeMICEcnkrdxt3/APU+iQI8 MFsF3G/159/ycRYuvf2DC65cA94vAL39SvNUtBdEdpIWpQqT4Xybfy0PMW09+i5QaHSB M77yhx2DyOyAg2+kh2QPHWxHtphPlxrYcS+V9/GW+p2gcQ56GtZp4UpFjbvH4W+sYXCL 9QNTm6Adl2qngMXP9OyL1bH68xaKY2WBqmWqz3wAFKcYdzbiNJ9kBYdBrqdfR9mDHiu4 3cfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=LsBHPoKRCtwDOMc2JT/S0rILfVAOjOsIUEg1vfmMk0I=; b=0qi2MjC8lcQ8Ul3Dr3eJqdlLnuKSLSP403TnWxfhxTDcXNg8FE+jlC+kspK9XvihfS 3GOqAc8DRaJEJPxQ+BwptWrM0o4UgZE6fvfGLZLi/e9lU62+xNmxzRhWxB76QtcNKOCf Zeq8cWMig9Mc2USdrrVoq96Hr1A7X3KqEmvdZufOPn+WiFz1JnlDpeOJ0Ld8lqXAB4Xt gq48XX5qOqWyijROZ5WO6+ie7AYKxPGPad2GAsZR06sEACwUffBHhDzlGRppVpQFNglY fEHAFt6QD5/xY5SVocomLKI9G4xmivd8TwW1JqCS8qUIb1DlOVcEGPlkMtp2LQjeYMhD WenQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=KTuL8s82; 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 u10-20020a1709060eca00b006df76385e6esi12508574eji.782.2022.03.27.23.01.34; Sun, 27 Mar 2022 23:01:59 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=KTuL8s82; 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 S237069AbiC1Ai3 (ORCPT + 68 others); Sun, 27 Mar 2022 20:38:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230373AbiC1Ai3 (ORCPT ); Sun, 27 Mar 2022 20:38:29 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93A3E4ECCF for ; Sun, 27 Mar 2022 17:36:49 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id bi12so25485467ejb.3 for ; Sun, 27 Mar 2022 17:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LsBHPoKRCtwDOMc2JT/S0rILfVAOjOsIUEg1vfmMk0I=; b=KTuL8s82i3Mk75qC61EFLCdxdodMcKaC6rZIGrZq6pH27ySo4Ut4D253RZhCx2Apft KLydbkrKIkIu40UMY0bDeeXNtbHp0U0TEYaRj4iCgCkdnXvAOxzWT119PcO/nwUvO8MP RszsIWAmBGdjtyiwR7qPFzhdNHOMzILrN1FLM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LsBHPoKRCtwDOMc2JT/S0rILfVAOjOsIUEg1vfmMk0I=; b=EQX3z43DP7KTUmR/4dmGcG4SMH/ZTzMCHr+e5tflOr0aD88/JtsLYsiLrixEfDLygX bW+A+lZL9sxpz9YNvg0p3Q1EMqqzmtqMx97wZ3lK1AxcXhY4Ax6syA9kliJ/mX88Pgx8 WXLflVvR5weThz4g0dqhk1SPf6msdFV5oeAJ0T58VSJVrPTgr0lTn4zFA56ScNavnKCM kyoqI6RzoMOCr+z7RT2Y2jle+kJJlYGoL24CVHLUetFcz6TFUQHj2kWmCxCmltOrJXQq bG1BmJ5juQ+ECbux6C4AQ0Q+LHLcF+lrX2JO61xNbjasmlCPYlWjStp9N7bQMQaiR3Ph r1bA== X-Gm-Message-State: AOAM533Tm9QcenrQHk1ozM4aE4rkahQDIe3LavB2SrJhQdHU5zkvYXe/ c3ex+8ZRpJmwrveoXCbGAr+oLdQcdqHUX5aMzwg= X-Received: by 2002:a17:906:26da:b0:6d6:da2e:d338 with SMTP id u26-20020a17090626da00b006d6da2ed338mr24619461ejc.700.1648427807908; Sun, 27 Mar 2022 17:36:47 -0700 (PDT) Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com. [209.85.218.44]) by smtp.gmail.com with ESMTPSA id r11-20020aa7cfcb000000b0041902ac4c6asm6225756edy.1.2022.03.27.17.36.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Mar 2022 17:36:47 -0700 (PDT) Received: by mail-ej1-f44.google.com with SMTP id yy13so25454009ejb.2 for ; Sun, 27 Mar 2022 17:36:47 -0700 (PDT) X-Received: by 2002:a2e:a549:0:b0:249:9ec3:f2b with SMTP id e9-20020a2ea549000000b002499ec30f2bmr4449509ljn.358.1648427417735; Sun, 27 Mar 2022 17:30:17 -0700 (PDT) MIME-Version: 1.0 References: <1812355.tdWV9SEqCh@natalenko.name> <20220324055732.GB12078@lst.de> <4386660.LvFx2qVVIh@natalenko.name> <81ffc753-72aa-6327-b87b-3f11915f2549@arm.com> <878rsza0ih.fsf@toke.dk> <4be26f5d8725cdb016c6fdd9d05cfeb69cdd9e09.camel@freebox.fr> <20220324163132.GB26098@lst.de> <871qyr9t4e.fsf@toke.dk> <20220327054848.1a545b12.pasic@linux.ibm.com> <20220328015211.296739a4.pasic@linux.ibm.com> In-Reply-To: <20220328015211.296739a4.pasic@linux.ibm.com> From: Linus Torvalds Date: Sun, 27 Mar 2022 17:30:01 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [REGRESSION] Recent swiotlb DMA_FROM_DEVICE fixes break ath9k-based AP To: Halil Pasic Cc: =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= , Robin Murphy , Christoph Hellwig , Maxime Bizon , 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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-wireless@vger.kernel.org On Sun, Mar 27, 2022 at 4:52 PM Halil Pasic wrote: > > I have no intention of pursuing this. When fixing the information leak, > I happened to realize, that a somewhat similar situation can emerge when > mappings are reused. It seemed like an easy fix, so I asked the swiotlb > maintainers, and they agreed. It ain't my field of expertise, and the > drivers I'm interested in don't need this functionality. Ok. That said, I think you are putting yourself down when you said in an earlier email that you aren't veryt knowledgeable in this area. I think the fact that you *did* think of this other similar situation is actually very interesting, and it's something people probably _haven't_ been thinking about. So I think your first commit fixes the straightforward and common case where you do that "map / partial dma / unmap" case. And that straightforward case is probably all that the disk IO case ever really triggers, which is presumably why those "drivers I'm interested in don't need this functionality" don't need anything else? And yes, your second commit didn't work, but hey, whatever. The whole "multiple operations on the same double buffering allocation" situation is something I don't think people have necessarily thought about enough. And by that I don't mean you. I mean very much the whole history of our dma mapping code. I then get opinionated and probably too forceful, but please don't take it as being about you - it's about just my frustration with that code - and if it comes off too negative then please accept my apologies. Linus