Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4716249rwd; Sun, 11 Jun 2023 13:33:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7guaHDFqwbmXR8uuc+rRLLIT9czICiy+wwq7vJEWWsw5qkec7trN5+eNQwvUn/ZPdHQ3lY X-Received: by 2002:a17:902:82c4:b0:1b3:cf98:a20b with SMTP id u4-20020a17090282c400b001b3cf98a20bmr997741plz.54.1686515584666; Sun, 11 Jun 2023 13:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686515584; cv=none; d=google.com; s=arc-20160816; b=hCAE71p66huSXjTK/GNZbYn7b16+lae4b26cpfFXM7pNJrYp+iz9Et1O0JBF12JKxW 1+Ug0XUiyymWnrp7eYccS41tisah5Kg8ATy7m6Ew0UJ9jQD4VQObTzOzb76gS9pqexQ2 Xe+/5JcQa/160Yf9kP771RFHLoUjTWP9m+MKBtFGzx9z/qeXkn9GE8tCsh1xmYwJuFuk vUMPRNQT6DkTBuxnXsnKYAYXlUIGp98e3XoJU2b5ibGEiRjKaomA9/H/gMLjgLiXCnTD itYIBT8M7XQwLhUrFB5PRV3Xkt3YgBHr+TnSh9/NC68fT3TrlXvj5j/Tnya3PgR7KSes Z5OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:mime-version :dkim-signature; bh=+tFnAn28hiPk2ZM+sMsKYnGj/GCEN4oSZGqvN8a4mfg=; b=0fRsYB9gDEKkcl4/bwC8kIfCeqaTHZLVz+JIi7fRy53JHCOzYLQ0AzepVdkatWhNmy G4+51dw+wyt+2Udp18/9pSkjS70FqtcGkN/93zVitFQnjOwtm15ZnefgwFTRYN9dIfbN B6SdgjYxHv+H0Vv0EcBEpDEQjo+7tOhUPq1woDPy/VMh/N/N1NTQMHCl6LV+IsU7EGoe IySApkxLvzes5dHvC+/cMiXiP3Jy6J3MbnUOtx5AhTEWGOQ1qmgC2tF6MrHUBz51V1Xw oktxgtpeOPTFnqo0hBajakdB/avHSEzBh3O1E9dfEC8TQQGOiPkMVFO+9+zmX5O7L/M/ Krvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20221208 header.b="qW/pMZT/"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e6-20020a170902cf4600b001b2085066d9si2116370plg.584.2023.06.11.13.32.46; Sun, 11 Jun 2023 13:33:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20221208 header.b="qW/pMZT/"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229749AbjFKUXV (ORCPT + 62 others); Sun, 11 Jun 2023 16:23:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjFKUXU (ORCPT ); Sun, 11 Jun 2023 16:23:20 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7993AE46; Sun, 11 Jun 2023 13:23:18 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5148e4a2f17so6535830a12.1; Sun, 11 Jun 2023 13:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20221208; t=1686514996; x=1689106996; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=+tFnAn28hiPk2ZM+sMsKYnGj/GCEN4oSZGqvN8a4mfg=; b=qW/pMZT/anLIyPT2bgUC6MQjAUvt5u6CwXLr6ZEmrqDBWgag2lbUeCKe5HFeR0B2Vs FX1aGwHopbfJcv5Nh9Ie8IbVnhn/eF9wa7X3FuUTGx5i/Dv9JsOEIvAoz7KA93L7VGO+ ILI2CquqTiKEFUXWvNjEyMxeqpt/VLhFnCQ0Tbr6a0bo5zC9Af8dlNL/M1YWCnGtQx6I E2rT2emvfPS6HgeVtyUapZHj463GLBlEO8p5Gj02NyhpBPAWQOJnpzbYtzapCD1cU3zA SwB8n7VsD7d3EPcaT2GLFDzYKvYRBSnqfeaI717CFC9K6m6hRluKQPly/kYHkFQEHuRP Yl4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686514996; x=1689106996; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=+tFnAn28hiPk2ZM+sMsKYnGj/GCEN4oSZGqvN8a4mfg=; b=j9IAFcY3ENCySJoZ2MKKzEYaI1+6HcoNsfhm/c+TUqqyT9SI0ysE3BARzs7j7tO+ka kx9VyYmRkN389FJLRo5z32NAc+l0+8I67/icpX15GTzrgP2yHp8kIHmJGe4R3D2ZsUuF HBKGTj+mT9ioSRdRcuRHI0RJzIIaEtQ5DbWuSpcQ6aNAkOT/1+yCq71IdTbXjVrvECb3 IKzP2AdMUFqgKR6sWFbMBDP4c1iozyiSWU3DiMcVLiZgcnSdTqIuudImjKjXY5e/Ti3d V+oLE+CXiPf10e96pzSHVocCGrPZ+ht3zvJI42hQvxbg9MNqw1nExLKBxKJsWQ0ng/wj Vsxw== X-Gm-Message-State: AC+VfDxfzKfVAmD6JMdf6jyJB99JQANdbygjzOkaizZWYLsJYiiGyms9 x8y4X6leCvL0GRnwqiUDodWy+tj8EGvQRNDvEnNg8gv6vSs= X-Received: by 2002:a17:907:9306:b0:974:1e85:6a69 with SMTP id bu6-20020a170907930600b009741e856a69mr7731621ejc.16.1686514995636; Sun, 11 Jun 2023 13:23:15 -0700 (PDT) MIME-Version: 1.0 From: Martin Blumenstingl Date: Sun, 11 Jun 2023 22:23:04 +0200 Message-ID: Subject: wifi: rtw88: question about SDIO RX aggregation limiting To: linux-wireless@vger.kernel.org, pkshih@realtek.com Cc: "Lukas F. Hartmann" , linux-kernel@vger.kernel.org, tony0620emma@gmail.com, jernej.skrabec@gmail.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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-wireless@vger.kernel.org Hello Ping-Ke, certain Amlogic SDIO host controllers have a limit of receiving/transmitting at most 1536 bytes at a time. It turns out that rtw_sdio_enable_rx_aggregation() from rtw88/sdio.c is not taking this into account currently. For any RX buffer that is bigger than 1536 bytes (which can happen due to RX aggregation) we're unable to do any processing on the host side because all bytes beyond the 1536 bytes mark are lost. Lukas found that limiting BIT_RXDMA_AGG_PG_TH to 0x6 makes his RTL8822CS work on the affected Amlogic SoCs. My question now is: how can we properly limit BIT_RXDMA_AGG_PG_TH without hard-coding a one-fits-all value (which may reduce performance)? Initially I thought that we could just calculate it: host_max_pages = mmc_host->max_req_size / rtwdev->chip->page_size max_req_size for the affected controller is 1536 and chip->page_size is 128, so the result would be 12 (I thought it would be close to this number, maybe +/-1). Unfortunately this doesn't fix the issue and for his board BIT_RXDMA_AGG_PG_TH the limit is 6 or 7. If you could describe how BIT_RXDMA_AGG_PG_TH generally works I can come up with the algorithm to calculate the limit on my own (at least I hope so). Lukas has been very patient with testing so far and I understood that he's willing to test further patches if we think that it fixes the rtw88 driver issue he's seeing. Thank you and best regards, Martin