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 365F8C433FE for ; Fri, 25 Mar 2022 09:21:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356788AbiCYJXZ (ORCPT ); Fri, 25 Mar 2022 05:23:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345014AbiCYJXX (ORCPT ); Fri, 25 Mar 2022 05:23:23 -0400 Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [IPv6:2a01:488:42:1000:50ed:8234::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A99BCF49F; Fri, 25 Mar 2022 02:21:49 -0700 (PDT) Received: from ip4d144895.dynamic.kabel-deutschland.de ([77.20.72.149] helo=[192.168.66.200]); authenticated by wp530.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) id 1nXg8U-00023m-32; Fri, 25 Mar 2022 10:21:34 +0100 Message-ID: Date: Fri, 25 Mar 2022 10:21:24 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [REGRESSION] Recent swiotlb DMA_FROM_DEVICE fixes break ath9k-based AP Content-Language: en-US To: Oleksandr Natalenko , Robin Murphy , Christoph Hellwig , Maxime Bizon , =?UTF-8?Q?Toke_H=c3=b8iland-J=c3=b8rgense?= =?UTF-8?Q?n?= 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 References: <1812355.tdWV9SEqCh@natalenko.name> <871qyr9t4e.fsf@toke.dk> <4699073.GXAFRqVoOG@natalenko.name> From: Thorsten Leemhuis In-Reply-To: <4699073.GXAFRqVoOG@natalenko.name> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-bounce-key: webpack.hosteurope.de;regressions@leemhuis.info;1648200109;1a0d0afe; X-HE-SMSGID: 1nXg8U-00023m-32 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25.03.22 08:12, Oleksandr Natalenko wrote: > On čtvrtek 24. března 2022 18:07:29 CET Toke Høiland-Jø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? >> >> 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 *sc, >> common->rx_bufsize, DMA_FROM_DEVICE); >> >> ret = ath9k_hw_process_rxdesc_edma(ah, rs, skb->data); >> - if (ret == -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 == -EINPROGRESS) >> return false; >> - } >> >> __skb_unlink(skb, &rx_edma->rx_fifo); >> if (ret == -EINVAL) { > > With this patch and both ddbd89deb7d3+aa6f8dcbab47 in place the AP works for me. TWIMC: If anyone needs more testers or something, I noticed two bug report in bko about this problem: https://bugzilla.kernel.org/show_bug.cgi?id=215703 https://bugzilla.kernel.org/show_bug.cgi?id=215698 I'll point both to this discussion and the patch. Ciao, Thorsten