linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arend van Spriel" <arend@broadcom.com>
To: "Daniel Wagner" <wagi@monom.org>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: brcsmac kernel panic
Date: Mon, 12 Aug 2013 12:38:37 +0200	[thread overview]
Message-ID: <5208BB2D.2000705@broadcom.com> (raw)
In-Reply-To: <5207BA00.3030709@monom.org>

[-- Attachment #1: Type: text/plain, Size: 798 bytes --]

On 08/11/2013 06:21 PM, Daniel Wagner wrote:
> Hi,
>
> I just updated my laptop (MacBook Air 2012) from 3.11-rc3+ to 3.11-rc4+
> and since then brcsmac crashes short after enabling it. Unfortunately, I
> did also change some config flags in the area of cpufreq (enabling
> p-state driver) so the configuration is not exactly the same. Before I
> try to figure out what I have changed, I am posting the picture of the
> crash. Maybe it is something obvious.
>
> v3.11-rc4-197-gd92581f
> http://www.monom.org/misc/brcmsmac/v3.11-rc4.config
> http://www.monom.org/misc/brcmsmac/IMAG0064.jpg

Thanks, Daniel

I was looking at this issue two weeks ago and just got back from my 
vacation. Can you apply the patch and send me a kernel log?

Sharing pictures, huh. What about this one :-p

Regards,
Arend

[-- Attachment #2: barcelona-2012.jpg --]
[-- Type: image/jpeg, Size: 82908 bytes --]

[-- Attachment #3: 0001-brcmsmac-avoid-kernel-panic-due-to-divide-by-zero-er.patch --]
[-- Type: text/plain, Size: 1447 bytes --]

>From aeca211f0bb6186eefb7f3a6ad98115e2256e53a Mon Sep 17 00:00:00 2001
From: Arend van Spriel <arend@broadcom.com>
Date: Mon, 12 Aug 2013 12:34:45 +0200
Subject: [PATCH] brcmsmac: avoid kernel panic due to divide-by-zero error

The patch avoid the kernel panic and adds a few error log messages.

Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
 drivers/net/wireless/brcm80211/brcmsmac/main.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 9fd6f2f..ea92ea2 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -630,10 +630,21 @@ static uint brcms_c_calc_frame_time(struct brcms_c_info *wlc, u32 ratespec,
 		dur = PREN_PREAMBLE + (tot_streams * PREN_PREAMBLE_EXT);
 		if (preamble_type == BRCMS_MM_PREAMBLE)
 			dur += PREN_MM_EXT;
+
+		if (mcs > BRCMS_MAXMCS) {
+			brcms_err(wlc->hw->d11core, "wl%d: invalid mcs: %u\n",
+				  wlc->pub->unit, mcs);
+			mcs = 0;
+		}
 		/* 1000Ndbps = kbps * 4 */
 		kNdps = mcs_2_rate(mcs, rspec_is40mhz(ratespec),
 				   rspec_issgi(ratespec)) * 4;
 
+		if (kNdps == 0) {
+			brcms_err(wlc->hw->d11core, "wl%d: invalid zero rate: rspec=0x%x\n",
+				  wlc->pub->unit, ratespec);
+			kNdps = 6500 * 4;
+		}
 		if (rspec_stc(ratespec) == 0)
 			nsyms =
 			    CEIL((APHY_SERVICE_NBITS + 8 * mac_len +
-- 
1.7.10.4


  reply	other threads:[~2013-08-12 10:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-11 16:21 brcsmac kernel panic Daniel Wagner
2013-08-12 10:38 ` Arend van Spriel [this message]
2013-08-12 20:11   ` Daniel Wagner
2013-08-13 13:41     ` Arend van Spriel
2013-08-13 13:55       ` Daniel Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5208BB2D.2000705@broadcom.com \
    --to=arend@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=wagi@monom.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).