From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF236C433EF for ; Fri, 25 Mar 2022 07:12:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354641AbiCYHOR (ORCPT ); Fri, 25 Mar 2022 03:14:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238896AbiCYHOQ (ORCPT ); Fri, 25 Mar 2022 03:14:16 -0400 X-Greylist: delayed 74847 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 25 Mar 2022 00:12:42 PDT Received: from vulcan.natalenko.name (vulcan.natalenko.name [104.207.131.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 381D9BD898; Fri, 25 Mar 2022 00:12:42 -0700 (PDT) Received: from spock.localnet (unknown [83.148.33.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by vulcan.natalenko.name (Postfix) with ESMTPSA id 0402BE4C661; Fri, 25 Mar 2022 08:12:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=natalenko.name; s=dkim-20170712; t=1648192359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gcXLBP3mIfbGljUpsP//FsQOHOTfI0szjq2ialy/sIU=; b=nTgcEEtgRJjs1kBrwhIgdlq/eHBdXP950twIufQRtgGI9t1yPmzXlHuARe5Mm4Ku1Wl+gj J1qtm2C0WtQDcQ1vPPoPlPSxgR6hQ7w2kxF8mGOtYKwbxIJ1skLC/zf5LPO3fyjV3xW742 nilK7AS68nMA3cP9Tzef//M9aMfeDRo= From: Oleksandr Natalenko To: Robin Murphy , Christoph Hellwig , Maxime Bizon , Toke =?ISO-8859-1?Q?H=F8iland=2DJ=F8rgensen?= Cc: Linus Torvalds , Halil Pasic , 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 Date: Fri, 25 Mar 2022 08:12:37 +0100 Message-ID: <4699073.GXAFRqVoOG@natalenko.name> In-Reply-To: <871qyr9t4e.fsf@toke.dk> References: <1812355.tdWV9SEqCh@natalenko.name> <871qyr9t4e.fsf@toke.dk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hello. On =C4=8Dtvrtek 24. b=C5=99ezna 2022 18:07:29 CET Toke H=C3=B8iland-J=C3=B8= rgensen wrote: > Right, but is that sync_for_device call really needed? AFAICT, that > ath9k_hw_process_rxdesc_edma() invocation doesn't actually modify any of > the data when it returns EINPROGRESS, so could we just skip it? Like > the patch below? Or am I misunderstanding the semantics here? >=20 > -Toke >=20 >=20 > diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless= /ath/ath9k/recv.c > index 0c0624a3b40d..19244d4c0ada 100644 > --- a/drivers/net/wireless/ath/ath9k/recv.c > +++ b/drivers/net/wireless/ath/ath9k/recv.c > @@ -647,12 +647,8 @@ static bool ath_edma_get_buffers(struct ath_softc *s= c, > common->rx_bufsize, DMA_FROM_DEVICE); > =20 > ret =3D ath9k_hw_process_rxdesc_edma(ah, rs, skb->data); > - if (ret =3D=3D -EINPROGRESS) { > - /*let device gain the buffer again*/ > - dma_sync_single_for_device(sc->dev, bf->bf_buf_addr, > - common->rx_bufsize, DMA_FROM_DEVICE); > + if (ret =3D=3D -EINPROGRESS) > return false; > - } > =20 > __skb_unlink(skb, &rx_edma->rx_fifo); > if (ret =3D=3D -EINVAL) { With this patch and both ddbd89deb7d3+aa6f8dcbab47 in place the AP works fo= r me. Thanks. =2D-=20 Oleksandr Natalenko (post-factum) From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 88924C433FE for ; Fri, 25 Mar 2022 07:12:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id C33F3404C6; Fri, 25 Mar 2022 07:12:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7OcGCeb34RwB; Fri, 25 Mar 2022 07:12:46 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id 4F776400D8; Fri, 25 Mar 2022 07:12:46 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 217B0C002C; Fri, 25 Mar 2022 07:12:46 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9FA5FC0012 for ; Fri, 25 Mar 2022 07:12:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 980F441CF2 for ; Fri, 25 Mar 2022 07:12:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=natalenko.name Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gVQcUZglPFAo for ; Fri, 25 Mar 2022 07:12:43 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from vulcan.natalenko.name (vulcan.natalenko.name [104.207.131.136]) by smtp4.osuosl.org (Postfix) with ESMTPS id 5BF4D41CF1 for ; Fri, 25 Mar 2022 07:12:43 +0000 (UTC) Received: from spock.localnet (unknown [83.148.33.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by vulcan.natalenko.name (Postfix) with ESMTPSA id 0402BE4C661; Fri, 25 Mar 2022 08:12:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=natalenko.name; s=dkim-20170712; t=1648192359; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gcXLBP3mIfbGljUpsP//FsQOHOTfI0szjq2ialy/sIU=; b=nTgcEEtgRJjs1kBrwhIgdlq/eHBdXP950twIufQRtgGI9t1yPmzXlHuARe5Mm4Ku1Wl+gj J1qtm2C0WtQDcQ1vPPoPlPSxgR6hQ7w2kxF8mGOtYKwbxIJ1skLC/zf5LPO3fyjV3xW742 nilK7AS68nMA3cP9Tzef//M9aMfeDRo= To: Robin Murphy , Christoph Hellwig , Maxime Bizon , Toke =?ISO-8859-1?Q?H=F8iland=2DJ=F8rgensen?= Subject: Re: [REGRESSION] Recent swiotlb DMA_FROM_DEVICE fixes break ath9k-based AP Date: Fri, 25 Mar 2022 08:12:37 +0100 Message-ID: <4699073.GXAFRqVoOG@natalenko.name> In-Reply-To: <871qyr9t4e.fsf@toke.dk> References: <1812355.tdWV9SEqCh@natalenko.name> <871qyr9t4e.fsf@toke.dk> MIME-Version: 1.0 Cc: Netdev , Kalle Valo , linux-wireless , Linux Kernel Mailing List , stable , Halil Pasic , iommu , Olha Cherevyk , Greg Kroah-Hartman , Jakub Kicinski , Paolo Abeni , Linus Torvalds , "David S. Miller" X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Oleksandr Natalenko via iommu Reply-To: Oleksandr Natalenko Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" SGVsbG8uCgpPbiDEjXR2cnRlayAyNC4gYsWZZXpuYSAyMDIyIDE4OjA3OjI5IENFVCBUb2tlIEjD uGlsYW5kLUrDuHJnZW5zZW4gd3JvdGU6Cj4gUmlnaHQsIGJ1dCBpcyB0aGF0IHN5bmNfZm9yX2Rl dmljZSBjYWxsIHJlYWxseSBuZWVkZWQ/IEFGQUlDVCwgdGhhdAo+IGF0aDlrX2h3X3Byb2Nlc3Nf cnhkZXNjX2VkbWEoKSBpbnZvY2F0aW9uIGRvZXNuJ3QgYWN0dWFsbHkgbW9kaWZ5IGFueSBvZgo+ IHRoZSBkYXRhIHdoZW4gaXQgcmV0dXJucyBFSU5QUk9HUkVTUywgc28gY291bGQgd2UganVzdCBz a2lwIGl0PyBMaWtlCj4gdGhlIHBhdGNoIGJlbG93PyBPciBhbSBJIG1pc3VuZGVyc3RhbmRpbmcg dGhlIHNlbWFudGljcyBoZXJlPwo+IAo+IC1Ub2tlCj4gCj4gCj4gZGlmZiAtLWdpdCBhL2RyaXZl cnMvbmV0L3dpcmVsZXNzL2F0aC9hdGg5ay9yZWN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YmQ4 OWRlYjdkMythYTZmOGRjYmFiNDcgaW4gcGxhY2UgdGhlIEFQIHdvcmtzIGZvciBtZS4KClRoYW5r cy4KCi0tIApPbGVrc2FuZHIgTmF0YWxlbmtvIChwb3N0LWZhY3R1bSkKCgpfX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwppb21tdSBtYWlsaW5nIGxpc3QKaW9t bXVAbGlzdHMubGludXgtZm91bmRhdGlvbi5vcmcKaHR0cHM6Ly9saXN0cy5saW51eGZvdW5kYXRp b24ub3JnL21haWxtYW4vbGlzdGluZm8vaW9tbXU=