From patchwork Mon Aug 24 14:15:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arend van Spriel X-Patchwork-Id: 7064731 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D9E0AC05AC for ; Mon, 24 Aug 2015 14:15:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D82352074A for ; Mon, 24 Aug 2015 14:15:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BC09D20749 for ; Mon, 24 Aug 2015 14:15:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754687AbbHXOPt (ORCPT ); Mon, 24 Aug 2015 10:15:49 -0400 Received: from mail-gw3-out.broadcom.com ([216.31.210.64]:60523 "EHLO mail-gw3-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753921AbbHXOPb (ORCPT ); Mon, 24 Aug 2015 10:15:31 -0400 X-IronPort-AV: E=Sophos;i="5.15,738,1432623600"; d="scan'208";a="73101858" Received: from irvexchcas08.broadcom.com (HELO IRVEXCHCAS08.corp.ad.broadcom.com) ([10.9.208.57]) by mail-gw3-out.broadcom.com with ESMTP; 24 Aug 2015 07:36:36 -0700 Received: from IRVEXCHSMTP2.corp.ad.broadcom.com (10.9.207.52) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.3.235.1; Mon, 24 Aug 2015 07:15:26 -0700 Received: from mail-sj1-12.sj.broadcom.com (10.10.10.20) by IRVEXCHSMTP2.corp.ad.broadcom.com (10.9.207.52) with Microsoft SMTP Server id 14.3.235.1; Mon, 24 Aug 2015 07:15:26 -0700 Received: from [10.176.128.83] (bld-bun-01.bun.broadcom.com [10.176.128.83]) by mail-sj1-12.sj.broadcom.com (Postfix) with ESMTP id 8D15F27A81; Mon, 24 Aug 2015 07:15:25 -0700 (PDT) Message-ID: <55DB26FC.1060707@broadcom.com> Date: Mon, 24 Aug 2015 16:15:24 +0200 From: Arend van Spriel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= CC: Kalle Valo , linux-wireless , Hante Meuleman Subject: Re: [PATCH V2 3/7] brcmfmac: Increase nr of supported flowrings. References: <1439708139-7527-1-git-send-email-arend@broadcom.com> <1439708139-7527-4-git-send-email-arend@broadcom.com> In-Reply-To: Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 08/19/2015 11:56 PM, Rafa? Mi?ecki wrote: > On 16 August 2015 at 08:55, Arend van Spriel wrote: >> From: Hante Meuleman >> >> Next generation devices will have firmware which will have more >> than 256 flowrings. This patch increases the maximum number of >> supported flowrings to 512. >> >> Reviewed-by: Arend Van Spriel >> Reviewed-by: Franky (Zhenhui) Lin >> Reviewed-by: Pieter-Paul Giesberts >> Signed-off-by: Hante Meuleman >> Signed-off-by: Arend van Spriel > > This is a patch that for my device triggers: > Unable to handle kernel NULL pointer dereference at virtual address 00000014 > > It seems to happen even when using only 1 AP interface. Hi Rafa?, What happens is that your platform has no memory to allocate a flowring for tx and there is a bug in handling the returned error. Can you try it with following applied. You will still have memory issue so for OpenWrt you may need to limit to 256 anyway. Hante found another issue with hash_id in struct brcmf_flowring so we are not entirely sure which issue caused the null pointer deref so your feedback is appreciated. Regards, Arend --- drivers/net/wireless/brcm80211/brcmfmac/flowring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hash[hash_idx].fifo = fifo; diff --git a/drivers/net/wireless/brcm80211/brcmfmac/flowring.c b/drivers/net/wi index 5b7a8ee..9fb50b3 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/flowring.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/flowring.c @@ -151,11 +151,11 @@ u32 brcmf_flowring_create(struct brcmf_flowring *flow, u8 break; } if (i == flow->nrofrings) - return -ENOMEM; + return BRCMF_FLOWRING_INVALID_ID; ring = kzalloc(sizeof(*ring), GFP_ATOMIC); if (!ring) - return -ENOMEM; + return BRCMF_FLOWRING_INVALID_ID; memcpy(hash[hash_idx].mac, mac, ETH_ALEN);