Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp998959rdb; Fri, 1 Dec 2023 04:40:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IFhanJII9oqxCxT9whlAuzUymQrzJs4OxJyk+0DId18stqpk4+V5GRIiGHDf2tYOlJ+LGA8 X-Received: by 2002:a17:903:1108:b0:1bc:edd:e891 with SMTP id n8-20020a170903110800b001bc0edde891mr42607968plh.1.1701434442223; Fri, 01 Dec 2023 04:40:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701434442; cv=none; d=google.com; s=arc-20160816; b=bi/Am+XIWy/ToTb6RBNOtVB4uGI/R5Ob5u5pWg6OGBzBjaBIIAlfEAYQrt5Mtw2OT3 PlFXr5Oc3Z/WIf4cBMr3jC+3lKnh+aSSjeOG6ZysD/LhNu/6LK2lp47OAGeR3EeXdvWb unBdwKeA6qB9B+qC4MvHCvwcLZ7K6SQkX1pB1uC71CSqsTM3LlX0wzeGo653jz5TM/T3 G1lNclzJ8K49N2Ge5KDbrwgINwMG0NUevN0bBQgENPF7RObRs4cFj6g+VzPiYhGe9jwi RrBPjxCYw9R2XzdmHIRQWiu7O4djrtooIMLeUrZSyw35BiHiN8revsVh1ayGmQYT6wHJ ZgEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:message-id:user-agent:cc:to:references:in-reply-to:from :subject:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=m9myt3/b3czKveoqKeH/GPpz5RVzHi8uZCfZC2sBVqM=; fh=Lwwyierz9PayedkFkucZ7I2lJEUewIDZRDhgJx0Wizs=; b=Q3EGM6A05Fwa8hiOA1jjpCX9BSn4PbQYvJ2tayu7hEPLSHcsvuAvbfmjtuDBhSRyU/ ZolgX/98hYIIGj9lkQgUA4Qse3fuXyYexG+gQTmmmFLcqPre4B+FYEWm0EXhqd+VPEU7 YgLZ8wdMix/4xPVxRLJo3tFSfUcQ9ekCmD7WWH9+1HPAGlb+jp6m/gtF/9U00nA83f/I Il8l/5F6f9Q1NmKHNuHwwBpI6NIoEyAVHNGWx5LY17cviv4kgA23lt9SkQWuiaqqEegq dKkCmQEoATTz2/iXppzeXjveQUzLBsgvOwnPD1hZvC4IoWdgXMrDB+yatv1GZ5umh1W2 pMtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WG2Cbeai; spf=pass (google.com: domain of linux-wireless+bounces-294-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-294-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s85-20020a632c58000000b005b8f19be073si3366125pgs.416.2023.12.01.04.40.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 04:40:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-294-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WG2Cbeai; spf=pass (google.com: domain of linux-wireless+bounces-294-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-294-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E9140281AE5 for ; Fri, 1 Dec 2023 12:40:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA8092555F; Fri, 1 Dec 2023 12:40:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WG2Cbeai" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DBDA25558 for ; Fri, 1 Dec 2023 12:40:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 439F5C433C7; Fri, 1 Dec 2023 12:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701434438; bh=d5Is7DQQkDJQMABKZBG5rDA8xuTnzdXWxPreoL723b0=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=WG2CbeairoHsy0gK2p97pSYlOfS093EuRS0fW5qaFiw1EKDUd5+2w656xYh8Y59+9 dI7NHtmY4JtBeDVaraF2UTZan7aHmY/V3l1li7Pvfi5SGnfu+BTmvUCwVadvrJ8I6G /aGgUBg1oMs9UFImNjeZBZsot9G2c6qEHfIUUNDrccqp0Mk4krsTYistNW22igei6X 0PufkONn8ybPJVt4Q4QYUosjCNS1cVObmGKMjyosmFUsvoLbArQ7LGWVwIwMSbzUGf YdyaXzlnyMmGp3eOhpByaI4WCd6cJPYWKGIJ32EEicdWHi97+O4mzP46LPZisLY1hC 3KYyeN+NuIM1A== Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH v3] wifi: rtw88: sdio: Honor the host max_req_size in the RX path From: Kalle Valo In-Reply-To: <20231120115726.1569323-1-martin.blumenstingl@googlemail.com> References: <20231120115726.1569323-1-martin.blumenstingl@googlemail.com> To: Martin Blumenstingl Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, jernej.skrabec@gmail.com, pkshih@realtek.com, ulf.hansson@linaro.org, tony0620emma@gmail.com, lukas@mntre.com, Martin Blumenstingl User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <170143443423.2072551.2418172782235693510.kvalo@kernel.org> Date: Fri, 1 Dec 2023 12:40:36 +0000 (UTC) Martin Blumenstingl wrote: > Lukas reports skb_over_panic errors on his Banana Pi BPI-CM4 which comes > with an Amlogic A311D (G12B) SoC and a RTL8822CS SDIO wifi/Bluetooth > combo card. The error he observed is identical to what has been fixed > in commit e967229ead0e ("wifi: rtw88: sdio: Check the HISR RX_REQUEST > bit in rtw_sdio_rx_isr()") but that commit didn't fix Lukas' problem. > > Lukas found that disabling or limiting RX aggregation works around the > problem for some time (but does not fully fix it). In the following > discussion a few key topics have been discussed which have an impact on > this problem: > - The Amlogic A311D (G12B) SoC has a hardware bug in the SDIO controller > which prevents DMA transfers. Instead all transfers need to go through > the controller SRAM which limits transfers to 1536 bytes > - rtw88 chips don't split incoming (RX) packets, so if a big packet is > received this is forwarded to the host in it's original form > - rtw88 chips can do RX aggregation, meaning more multiple incoming > packets can be pulled by the host from the card with one MMC/SDIO > transfer. This Depends on settings in the REG_RXDMA_AGG_PG_TH > register (BIT_RXDMA_AGG_PG_TH limits the number of packets that will > be aggregated, BIT_DMA_AGG_TO_V1 configures a timeout for aggregation > and BIT_EN_PRE_CALC makes the chip honor the limits more effectively) > > Use multiple consecutive reads in rtw_sdio_read_port() and limit the > number of bytes which are copied by the host from the card in one > MMC/SDIO transfer. This allows receiving a buffer that's larger than > the hosts max_req_size (number of bytes which can be transferred in > one MMC/SDIO transfer). As a result of this the skb_over_panic error > is gone as the rtw88 driver is now able to receive more than 1536 bytes > from the card (either because the incoming packet is larger than that > or because multiple packets have been aggregated). > > In case of an receive errors (-EILSEQ has been observed by Lukas) we > need to drain the remaining data from the card's buffer, otherwise the > card will return corrupt data for the next rtw_sdio_read_port() call. > > Fixes: 65371a3f14e7 ("wifi: rtw88: sdio: Add HCI implementation for SDIO based chipsets") > Reported-by: Lukas F. Hartmann > Closes: https://lore.kernel.org/linux-wireless/CAFBinCBaXtebixKbjkWKW_WXc5k=NdGNaGUjVE8NCPNxOhsb2g@mail.gmail.com/ > Suggested-by: Ping-Ke Shih > Signed-off-by: Martin Blumenstingl > Reviewed-by: Ulf Hansson > Acked-by: Ping-Ke Shih > Tested-by: Lukas F. Hartmann > Reported-by: Lukas F. Hartmann > Signed-off-by: Martin Blumenstingl > Reviewed-by: Ulf Hansson > Acked-by: Ping-Ke Shih > Tested-by: Lukas F. Hartmann Patch applied to wireless-next.git, thanks. 00384f565a91 wifi: rtw88: sdio: Honor the host max_req_size in the RX path -- https://patchwork.kernel.org/project/linux-wireless/patch/20231120115726.1569323-1-martin.blumenstingl@googlemail.com/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches