Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp540068rdb; Thu, 30 Nov 2023 11:13:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IF5Q7syjqAVeOXcRUpwOcZh1tCU8bthsB4bGdLQE0cjnPK9pA7dpjtFwrMlHu5M19oeAE8N X-Received: by 2002:a17:902:9a96:b0:1cf:b4ca:4e79 with SMTP id w22-20020a1709029a9600b001cfb4ca4e79mr14469830plp.17.1701371606515; Thu, 30 Nov 2023 11:13:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701371606; cv=none; d=google.com; s=arc-20160816; b=ZmzYE2dyO8+dzOeRqDWvTfKr3vqYE0M0BeEfdVEltSCyhuCZyEzpqYltKIGnRLPtFN LauVQVtE1T02qtiSDHikQumiXKOEl2bTh4SH1zmIj8YE6/slrjZXpqQkxc3+lFthWSAJ rcOXXnmfUc+tFfxAs8S9c9mZ5SCDTaYDPfVMn0QxbaygIeY7t8PYefyCC8BfZzWoltNT 51MwJOkWWDi6yGB30yJqxWd3Pcs00bA2B8sefRoBs8/lXTsRKHsl9qZOxPC+UVmRoK6+ INJ6GAyEq/GVtiGU9nZ1LBZq3kBPKIP4t7k7p5U2v/7WhMJvBszEiJA8O5HCfPAHQu7i wY/A== 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=7da2XhChRzrpXH7fK09dqluwTAHMzMHJI+vYsMOtyng=; fh=Lwwyierz9PayedkFkucZ7I2lJEUewIDZRDhgJx0Wizs=; b=gEgsJrY3c7N7tEnJEGhaU/NZntmFzGFes7dHoJU5w6Lo972Jj27pJ5a+cMIeQ5laLL 9v0qycHTRInsAbUQ1LqnlF/ssM3QfZ8ZSP4EV9IcNe0JIcvZNZUFetKLKEDXqK1/wEW4 KOcIlZTuDJ69M+ikS/32pMaDgp6W97NFJQESMKvX1oHTOT+2v0Bq+XCkTvqaiBVUpOOn hqYrXa+c8DeMzgCBsnEbKeaBO7B6lEkRDtjL8SeAxGMs4g6PGjVNNoEaqIfq3z0PqxVL IFkj6J54erH8cR6DhNr++Ydm58qFfi3a9TEmVfNdSUmrpcSWxq+iS9m3L3yIPO0WuDQf voIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QcpwT9cr; spf=pass (google.com: domain of linux-wireless+bounces-251-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-251-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id e3-20020a170902744300b001cfa17ec332si1768901plt.616.2023.11.30.11.13.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 11:13:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-251-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QcpwT9cr; spf=pass (google.com: domain of linux-wireless+bounces-251-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-251-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E50EFB20D1B for ; Thu, 30 Nov 2023 19:13:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C4E1922063; Thu, 30 Nov 2023 19:13:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QcpwT9cr" 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 A629F22061 for ; Thu, 30 Nov 2023 19:13:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C40CC433C8; Thu, 30 Nov 2023 19:13:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701371598; bh=Byw3Ja8D98qaaMIkq6NR0yFqF4YxOUcmr+nbGdlYZbA=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=QcpwT9cr6VnKlFKhpZTU8AJ6xS/OkxTlZHu897PUrxvEb73G+gy4AhQ1b2TCp9cGe KiG3QwWb64sxola+sTovgNLk3SzvK4/rVT5CC4OfjeXQOQ5ZDIbJ+41GtdcnU84Kpp Vh1xYgFovu9ScfxihtLf7I9Ej39BWAx+OSLPyK+tWdAt3FKv++Z+K5T5BqJebq7kvO DJyDgINL1G+sAyc2E8JkOaLyKBJ8mEKotWKsTkRibVZwOU6TURBLhDuxE//MpOvbH/ d84hGgDW/B4nVNdf7YzTeb3DGrEzxRyt5qK+Z08VjafR7LfmB7r/TI/mGjq+2MNNuw CX/rhxWXCzzhg== 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: <170137159397.1963309.4329648460865757143.kvalo@kernel.org> Date: Thu, 30 Nov 2023 19:13:15 +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 Did this fix Lukas' problem? I couldn't see any answer to Ping's question. Patch set to Deferred. -- https://patchwork.kernel.org/project/linux-wireless/patch/20231120115726.1569323-1-martin.blumenstingl@googlemail.com/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches