Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp4845508pxb; Mon, 28 Mar 2022 04:29:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQ9Visy9QxEUDlOv6WmxhR0QgBy8BFuqbIUUnphIUsaXv5WJPC2M7pNSS9CBONnhdeCCb7 X-Received: by 2002:a17:907:7e86:b0:6df:939a:81e3 with SMTP id qb6-20020a1709077e8600b006df939a81e3mr27935730ejc.323.1648466977749; Mon, 28 Mar 2022 04:29:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648466977; cv=none; d=google.com; s=arc-20160816; b=PNxvxckJdH88Nures4TO0zfT5MYdUV8FQFer/uzEncc/XOlKoj+lfjlXUWc7UtMsjP qREaE8QaLucjqfZxwliblur1XYxPb6H3e9l2yeTktCgQvl6sVo4BU0GRXLs+rxssQKsn tc4wmWqUbeVj0L/6GYkw4yuOmraXT997P/d6tZ7gmjMqyaDNL+bkUnJC2+S/Ut6zJwY5 hhBkpxKDdqP/ZBPyyq3S14aql/L0++vkyfeoB7vHQAwsqalyNL8SDHS89tT4KjwbVMZD CBpieh1FQSC44RzpLbtpHuL34SVeAvnEine7N/GOLBUN3y81LGvMrSAt3NwCqas01qMH bF0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=/93dChLt+Za1uKCUhSTu2aRMCha+vAJZKphFzk7McsE=; b=vl5x/YClI/lg2rTJP9ILNL4cNJPNIB3BhHOU8Bci0f9uUfK0ylL+QMvLjXcAT9L3vI MxMMuGNhE04EjLNse9QAnWAjdaXnfcYhyr8Vs/9X0h0oNjlsKA4J0wuEe/GRVkIqpuik aIRj0KxHc5TE+IvWgaC73IwEZIyV1Lifa39UA7WVPc5aEEeUPBap+4znEM0/5V4DdKsG 3etBcp7nDP/TX0SndR8qVlauXuKP1n3jlFXKSPl8ZJCz2C8i8EBgh62Sb0rzDJTTV4Av q16w4tQPR9MnZjthAVMuTXYpaL/56vBzwVsedIZlahrFx1En7h1YhURMXR+pnu20twqe mHgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=GrQqsPGm; 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; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q2-20020a17090609a200b006e0484f938bsi13145420eje.643.2022.03.28.04.29.21; Mon, 28 Mar 2022 04:29:37 -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=@sipsolutions.net header.s=mail header.b=GrQqsPGm; 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; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239954AbiC1Jur (ORCPT + 68 others); Mon, 28 Mar 2022 05:50:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239941AbiC1Jup (ORCPT ); Mon, 28 Mar 2022 05:50:45 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0F5F41F9E; Mon, 28 Mar 2022 02:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=/93dChLt+Za1uKCUhSTu2aRMCha+vAJZKphFzk7McsE=; t=1648460942; x=1649670542; b=GrQqsPGmXslqKPkkMv5L9TKn0aHOqHUDd7Mwgbobfr+0/wj ZfRjwz5YxIiiphH2lJt0/j4nocADL6fH/wGwU0+eI/w/2NOg6NhhOGFUtGK+kLkkJ2jVdMxCuTmFS J3wqwMkDf3QphTt5Jx5M/CJzEsRRhwX2YRo4mRBNobtPwgt/VyA/7JtAhpxcAUyiFGkeUz7b9ZaAG DxIUHDdw/HVcbQ8Xjd8AyY2Ry+4ecO6/1wxFkPV8y2e24sPYClwRmqXlOOdyDtXQc8RzEzsZNUb7t KGzPMRop5JNPlDKyDrX4Lh3CslI/XWA8uWx9DKPodItgWYXUmO+/e8lHJgyLgxxA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) (envelope-from ) id 1nYlzJ-001WuR-EZ; Mon, 28 Mar 2022 11:48:37 +0200 Message-ID: Subject: Re: [REGRESSION] Recent swiotlb DMA_FROM_DEVICE fixes break ath9k-based AP From: Johannes Berg To: Halil Pasic Cc: Linus Torvalds , Maxime Bizon , Toke =?ISO-8859-1?Q?H=F8iland-J=F8rgensen?= , Robin Murphy , Christoph Hellwig , 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 Date: Mon, 28 Mar 2022 11:48:36 +0200 In-Reply-To: <20220327051502.63fde20a.pasic@linux.ibm.com> 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> <31434708dcad126a8334c99ee056dcce93e507f1.camel@freebox.fr> <298f4f9ccad7c3308d3a1fd8b4b4740571305204.camel@sipsolutions.net> <20220327051502.63fde20a.pasic@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-1.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-malware-bazaar: not-scanned X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,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-wireless@vger.kernel.org On Sun, 2022-03-27 at 05:15 +0200, Halil Pasic wrote: > > The key here is "sync_sg API, all the parameters must be the same > as those passed into the single mapping API", but I have to admit, > I don't understand the *single* in here. > Hah. So I wasn't imagining things after all. However, as the rest of the thread arrives, this still means it's all broken ... :) > The intended meaning of the > last sentence is that one can do partial sync by choose > dma_hande_sync, size_sync such that dma_handle_mapping <= dma_handle_sync > < dma_handle_mapping + size_mapping and dma_handle_sync + size_sync <= > dma_handle_mapping + size_mapping. But the direction has to remain the > same. Right. > BTW, the current documented definition of the direction is about the > data transfer direction between memory and the device, and how the CPU > is interacting with the memory is not in scope. A quote form the > documentation. > > """ > ======================= ============================================= > DMA_NONE no direction (used for debugging) > DMA_TO_DEVICE data is going from the memory to the device > DMA_FROM_DEVICE data is coming from the device to the memory > DMA_BIDIRECTIONAL direction isn't known > ======================= ============================================= > """ > (Documentation/core-api/dma-api.rst) > > My feeling is, that re-defining the dma direction is not a good idea. But > I don't think my opinion has much weight here. However, this basically means that the direction argument to the flush APIs are completely useless, and we do have to define something new/else... johannes