Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2514369rwd; Fri, 26 May 2023 07:32:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4AIa6cHThB5Lr+BfCPpvbbORhPE0ecSm/hF6Kkoi3NlVoXWVoECrVfy/0zhm0kJf749Dhf X-Received: by 2002:a17:902:e745:b0:1ae:610a:4a46 with SMTP id p5-20020a170902e74500b001ae610a4a46mr3224006plf.47.1685111563355; Fri, 26 May 2023 07:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685111563; cv=none; d=google.com; s=arc-20160816; b=HMpKsDudK4l6kKEaAVC00Fj4Gy7Xr8pBXpD5mT6GbUo+Te99H/L53BFPTFxfNsxdr7 QCQScjGYf8m8nkqe01ZEZcOr9qeRPq31aPBWiDtEg4Cu/Ip+GnriOqc5s3vPKIDgzzzL Wrg1Q2l+WfMK/k3uEN1ET3VR1DsqOBjZSoaH/wK7WIHMn/l+FmJUSJ3H0gfOFpJ9RaYJ nbbmjIm7Px874fPmJVnH3tV5Ld3+4ScnGPlhX7uI4AMnsb96PXtis2GkKxHGb9iLiHo5 +cSkRRi5RbQmFXao7nP3KA7Cl5n/tZjZe89xf9LQKzIAtfXw8v9ZOdPUvqxd1pxQNnmH Izyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=RUNphUdSJ8jwsa36IcXppsFre1exw9YsMYbutqXWQAE=; b=Crk1Ie7TrfVL4BTIFehNH5q8BUekzcId+33g/NfaK2jn8uktInlV1VeFgKdChR7cj8 k9cydqxXfrq9VdCSHRlSokRmVhb5BWhubwakADxvKS3JR6gMTYsO0BrPa3HnCgSfMQtC 6IzsBbgb9XMaATRiLuLPXxaZJ99m84wBXWLZO54/Lo6m7Qvd11uulj57g+4NkONpsAqF cr7MGCJVD1yEIWlaQpyS1uY7QaT3v1fGa0AophG7fErlZnjyvOKmm1EIakzPeWdGb9vZ HAjVmUfhwQsIdI7pUkT0XycQQ1/RRSff7iPGxB1sV2vZRrY3kZMbYf24Oi6MT52Vd/Yu Esfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ytj8DhoC; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u12-20020a17090341cc00b001aaff9c8dd1si4697867ple.427.2023.05.26.07.32.30; Fri, 26 May 2023 07:32:43 -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=@kernel.org header.s=k20201202 header.b=Ytj8DhoC; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243589AbjEZOOR (ORCPT + 62 others); Fri, 26 May 2023 10:14:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237404AbjEZOOP (ORCPT ); Fri, 26 May 2023 10:14:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 603E1116; Fri, 26 May 2023 07:14:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DE9276502D; Fri, 26 May 2023 14:14:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04ED7C433EF; Fri, 26 May 2023 14:14:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685110453; bh=E7mpy7SJ9yejkkLCnA+9EJpYhZ/fdVkiMDu4+8NZN2Y=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Ytj8DhoC0MYxfulX/FoNXAWaW4KGrvA8fxzDoQmBBcp0KRG+6I2qh/a4oh94El/s0 /3ipvcxxQ1RTsLmei+zMRd7bnV6biGWdOJ6ReCxskBo6VrdlHyw/bSSNuHzPeOAQSe 5SAdxB/l3REg4zmhMoweWxwlKj5r49sstFbq8JtguXriZhbHI7bux18J/wQGGHQNvG 5Q6LwaIMXUNf83Rk9jcpzD8trlcerfNQljvQExtNLP6y6ZOj+nX7sAhcrE5Z/Ndmzs /glQ/94zCq9N9N/jfQweimEg7BSJTB6ReB9R/G6JCeNRQ8n/YgmSBvjY/JwY6zUG2r CEuBZxRi5f8+A== From: Kalle Valo To: Ulf Hansson Cc: Martin Blumenstingl , linux-wireless@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, tony0620emma@gmail.com, Peter Robinson , Ping-Ke Shih , jernej.skrabec@gmail.com, Larry Finger Subject: Re: [PATCH wireless-next v2 1/4] wifi: rtw88: sdio: Check the HISR RX_REQUEST bit in rtw_sdio_rx_isr() References: <20230522202425.1827005-2-martin.blumenstingl@googlemail.com> <168503099830.22756.1444846830853755949.kvalo@kernel.org> Date: Fri, 26 May 2023 17:14:07 +0300 In-Reply-To: (Ulf Hansson's message of "Fri, 26 May 2023 15:11:24 +0200") Message-ID: <87ttvzji34.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Ulf Hansson writes: > On Thu, 25 May 2023 at 18:10, Kalle Valo wrote: > >> >> Martin Blumenstingl wrote: >> >> > rtw_sdio_rx_isr() is responsible for receiving data from the wifi chip >> > and is called from the SDIO interrupt handler when the interrupt status >> > register (HISR) has the RX_REQUEST bit set. After the first batch of >> > data has been processed by the driver the wifi chip may have more data >> > ready to be read, which is managed by a loop in rtw_sdio_rx_isr(). >> > >> > It turns out that there are cases where the RX buffer length (from the >> > REG_SDIO_RX0_REQ_LEN register) does not match the data we receive. The >> > following two cases were observed with a RTL8723DS card: >> > - RX length is smaller than the total packet length including overhead >> > and actual data bytes (whose length is part of the buffer we read from >> > the wifi chip and is stored in rtw_rx_pkt_stat.pkt_len). This can >> > result in errors like: >> > skbuff: skb_over_panic: text:ffff8000011924ac len:3341 put:3341 >> > (one case observed was: RX buffer length = 1536 bytes but >> > rtw_rx_pkt_stat.pkt_len = 1546 bytes, this is not valid as it means >> > we need to read beyond the end of the buffer) >> > - RX length looks valid but rtw_rx_pkt_stat.pkt_len is zero >> > >> > Check if the RX_REQUEST is set in the HISR register for each iteration >> > inside rtw_sdio_rx_isr(). This mimics what the RTL8723DS vendor driver >> > does and makes the driver only read more data if the RX_REQUEST bit is >> > set (which seems to be a way for the card's hardware or firmware to >> > tell the host that data is ready to be processed). >> > >> > For RTW_WCPU_11AC chips this check is not needed. The RTL8822BS vendor >> > driver for example states that this check is unnecessary (but still uses >> > it) and the RTL8822CS drops this check entirely. >> > >> > Reviewed-by: Ping-Ke Shih >> > Signed-off-by: Martin Blumenstingl >> >> 4 patches applied to wireless-next.git, thanks. >> >> e967229ead0e wifi: rtw88: sdio: Check the HISR RX_REQUEST bit in rtw_sdio_rx_isr() >> 9be20a822327 wifi: rtw88: rtw8723d: Implement RTL8723DS (SDIO) efuse parsing >> 09fcdbd28404 mmc: sdio: Add/rename SDIO ID of the RTL8723DS SDIO wifi cards >> a3b125ceb45e wifi: rtw88: Add support for the SDIO based RTL8723DS chipset > > If it's not too late, feel free to add my ack for patch3. Nevermind, > if it adds additional work for you. We don't rebase wireless trees so I can't add it anymore, sorry. But thanks for reviewing it. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches