Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2121070pxb; Fri, 25 Mar 2022 11:27:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVwa6jtEVS3bOpQSegU4VFk6i5diWL55MOTNNhQAGTwwFKSZy2u8HCiXq9HXbtbU7Fgard X-Received: by 2002:a05:6a00:23d1:b0:4fb:228a:e9df with SMTP id g17-20020a056a0023d100b004fb228ae9dfmr1752777pfc.31.1648232833515; Fri, 25 Mar 2022 11:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648232833; cv=none; d=google.com; s=arc-20160816; b=svNc3Xorift+yy55FJ7T+InQcpBZ4mBhqxXFSvMo1AHMDLtJ9iXklfn+6q0uAxtiNY ep4+iXr2hs1jhpgsaiTJRnAV0gGFyZ82RKXa/tWcaLub8D7L/30rFwDaM17fOcyJGLtc aPAsSxcyq1PIwtJ0sXopu77beAMO/D6Fw8yOdEbABLEA0VKcCFOZScrA4JGBCrIn6ZHd dtw/VKwvQl9dl72w4V7ifNTQLazEt7dJAoOpoKl8Kiuwqc5Wo6zMtW+4HtYNYZZhQ/eZ KNoe7vXmPGsLC45qUZsYkcqhGto5AO+Y1LF+EYoIXOo1j75PIJh9uaSKlinYCA8mguD2 alcQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gcXLBP3mIfbGljUpsP//FsQOHOTfI0szjq2ialy/sIU=; b=QyfgsImYvZmuRmDz4CP9OYGWRH7duAOYu2jVkUYg3tVedXmhiVBDFbBRDPHsjBw0FD qOdkpw22QCnzEFtrtManOkTSXHcmxkWZ3RfoGtPlQGIwiuvmpzLn10Kz3VzWEI6SvZzd O183KaKpMstpUsebxKnbRFxmfCNLDXyoUEndP0xX9kn843gk81Vn2/4vqCDrR59GHwU3 R2dbyfE4/0PQ/W/gvWKje73LYqAUsSVSeP0XRjE8WJzILM/z7O5sHUuFzpU8nnsmGvcn cC6W+MBuGp0OkNZuHTpqQQsCWQMo1Q+LJwjH911EQvmdt9mGLnehjaK1VILaYprjBpC3 NtWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@natalenko.name header.s=dkim-20170712 header.b=nTgcEEtg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=natalenko.name Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id nv7-20020a17090b1b4700b001c74c0f7c62si3816030pjb.129.2022.03.25.11.27.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 11:27:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@natalenko.name header.s=dkim-20170712 header.b=nTgcEEtg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=natalenko.name Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EB4841770A8; Fri, 25 Mar 2022 10:50:11 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354390AbiCYHOS (ORCPT + 99 others); Fri, 25 Mar 2022 03:14:18 -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" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,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-kernel@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)