Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp466271rwi; Mon, 10 Oct 2022 03:04:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6CPyVR2QxED9H6GDeam+Pr80ms+qo/+r4Q7NLEtAB9kdO+Japn90jfQVs3PK4gdWubDIQt X-Received: by 2002:a17:907:782:b0:740:7120:c6e7 with SMTP id xd2-20020a170907078200b007407120c6e7mr14059044ejb.313.1665396251272; Mon, 10 Oct 2022 03:04:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665396251; cv=none; d=google.com; s=arc-20160816; b=oEeXwLQmGdiJ7hkl4G/QWTRIECPFipbdqcsglJ8CcGANqxFlFrw4IeFMGnVJ89oKTj b9WoCAGE2HTM6AhSDy3l2AF5rcQ/hQH5yqXx9wO4auvQDxNQRySkMtDakWrkeagL2zbB Vv1zPwEZGp+WvjbeS31wJX6i6ffgOVN5M8gK34CFljxI6geJIxNyoFH18JAeHaFvy4d/ QWP6XMkyatPbLQzHSSVhVn3oQfr30YmjJ8kPWov4hX81LyloTVX22VgfPA5E7VPRlMep LU6DVvvGCmy/9tGHNMIg6dq2RyZOp0uRmmzXS6GyoWFEZw8eNLVRDiyozzn5EHy8BkM9 xB+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Q71cyzrb77lC3RZ2QmN90g4mf6C9J+uErMbuRdb+UyA=; b=qA1nCnjWJ7Xd7ahj/29BfNaPlhOySfNMGDrm6qejLbP+Kb+8vdgcEQX4XE02vPtEdC 9Kml9gHXyo9Ukm14Lx05r8BCqusCyhl5ad9MlDCV+yR1tgQ9hKPhb70uATsEIg93g00B SN/uZLxekdVwemfHXoUmF4FQCExu1WpB0XtYSBRnHDEh9TxHobbEUaoUIkCMnGQQr+AA 7q4jV1pFFdXs8+6G5w7ZrNG1rJl2XJRLXoBOtmwaErHugU4gdh9SazCWQzu8D0eQMAuw vGDOadM7CreMJUGbpKFzWvY+xdc3NQPo01l08nZuqfjLQAjTCpHhBYdvO9d8lAlfm43K /pMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=CdmbPbhC; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn2-20020a17090794c200b007823d2b20fdsi11530644ejc.219.2022.10.10.03.03.56; Mon, 10 Oct 2022 03:04:11 -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=@gmail.com header.s=20210112 header.b=CdmbPbhC; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230253AbiJJJ6j (ORCPT + 61 others); Mon, 10 Oct 2022 05:58:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230083AbiJJJ6h (ORCPT ); Mon, 10 Oct 2022 05:58:37 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89E595F21F for ; Mon, 10 Oct 2022 02:58:36 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id d26so16626122eje.10 for ; Mon, 10 Oct 2022 02:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Q71cyzrb77lC3RZ2QmN90g4mf6C9J+uErMbuRdb+UyA=; b=CdmbPbhCuDlNEBLGMsF4OBOkokeLaTUyaKWHRwrEbpq/di9WXzUpBwfst5WGRsbIw5 H/50DMTLeqG2cPhUgrMlwBzvm6axyAZOP9OfWsVDb9HiigrjN3CKBD4ucFcNDccg1N1A 386NHyMh09HtFsqCM+Z2ZYqW00xNpCiNFAJ7K/ZWurdGW+8cHl/sp/pkOXFh/HcSAh78 VeWBeJsiqGJChqDn687O9ljDg2Io2SHZs95z78/lQAT84LjMOoZ4/Z8CtvLqi7ZEjD3W ZmfxMHL1yXITFVwX7/5ysGT/5X7ULzCjdQzUwP6ZoiRDwQBmcq+8amQuLulmFWHFV9x+ wcXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Q71cyzrb77lC3RZ2QmN90g4mf6C9J+uErMbuRdb+UyA=; b=OuSQXha9i7Du1cQBsuESi7WEZJp1UQoj5GsuyjVdbpqSMJUUe1voHJPFIomhMJOeYo CKesfbXZ+tVE4VrauTB3x7iG+CmH5tRTcRLntw73pVGZ5kKm/GM49Xu0eceC2c0hWyyr tWh3h8uexAtUULZ9yM0LsuoI1wVjt2BPSn2u7sx+6n3jxSq5X9XXECSprSTawkJxp9ks kHkr26bLavdeUXZqWHj0bRQnypyQ9CbZc+DachvF6wVfd02WX1ZvGb+mp62gY0+EnZjn lbj/mv9TCa3V6UnatZrW59ua2k1WZCQikf2jE/1FH4vwuEgWV6Az7nvCKsbtHgR/CtJ1 5okw== X-Gm-Message-State: ACrzQf1D0gwR6PRXnlLLAU924/LFHA1CaGJSHGjGXm5XuacVUn2EuXLz aXcP5hm+sjUq4tOJaWCZFKg= X-Received: by 2002:a17:906:8a61:b0:78d:9d00:c906 with SMTP id hy1-20020a1709068a6100b0078d9d00c906mr7347464ejc.321.1665395914951; Mon, 10 Oct 2022 02:58:34 -0700 (PDT) Received: from [10.176.68.61] ([192.19.148.250]) by smtp.gmail.com with ESMTPSA id kz9-20020a17090777c900b007806c1474e1sm5022267ejc.127.2022.10.10.02.58.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Oct 2022 02:58:34 -0700 (PDT) Message-ID: <627eaf57-09f7-feff-92e2-be88ebd4fe13@gmail.com> Date: Mon, 10 Oct 2022 11:58:33 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [PATCH 2/3] brcmfmac: return error when getting invalid max_flowrings from dongle Content-Language: en-US To: Ian Lin , linux-wireless@vger.kernel.org Cc: brcm80211-dev-list@broadcom.com, brcm80211-dev-list@cypress.com, franky.lin@broadcom.com, hante.meuleman@broadcom.com, kvalo@kernel.org, Double.Lo@infineon.com References: <20220929031001.9962-1-ian.lin@infineon.com> <20220929031001.9962-3-ian.lin@infineon.com> From: Arend Van Spriel In-Reply-To: <20220929031001.9962-3-ian.lin@infineon.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 On 9/29/2022 5:10 AM, Ian Lin wrote: > From: Wright Feng > > When firmware hit trap at initialization, host will read abnormal > max_flowrings number from dongle, and it will cause kernel panic when > doing iowrite to initialize dongle ring. > To detect this error at early stage, we directly return error when getting > invalid max_flowrings(>256). > > Signed-off-by: Wright Feng > Signed-off-by: Chi-hsien Lin > Signed-off-by: Ian Lin > --- > drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c > index 2b7ebbd7b5b4..1becd50038ab 100644 > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c > @@ -1228,6 +1228,10 @@ static int brcmf_pcie_init_ringbuffers(struct brcmf_pciedev_info *devinfo) > BRCMF_NROF_H2D_COMMON_MSGRINGS; > max_completionrings = BRCMF_NROF_D2H_COMMON_MSGRINGS; > } > + if (max_flowrings > 256) { This limit is a bit of a magic value. I do know there are chipsets that support more that 256 flowrings so this is a hard limitation. I should really get the multi-vendor support in place so we can have the limitation only for Infineon/Cypress chips. I will try to revive that thread. Regards, Arend