From: Larry Finger <Larry.Finger@lwfinger.net>
To: James Womack <james.c.womack@gmail.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: r8187se panic
Date: Sun, 14 Nov 2010 14:23:54 -0600 [thread overview]
Message-ID: <4CE0455A.50709@lwfinger.net> (raw)
In-Reply-To: <ibpauk$v12$1@dough.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1156 bytes --]
On 11/14/2010 12:49 PM, James Womack wrote:
> Hey, I tried patching the kernel I downloaded, but the dry runs both
> presented errors detailed below:
>
> james@mercury:/usr/src/linux-source-2.6.32$ patch -p1 --dry-run <
> /home/james/rtl8187se_change_panic_to_warn
> patching file drivers/staging/rtl8187se/r8185b_init.c
> Hunk #1 succeeded at 356 with fuzz 2 (offset 92 lines).
> Hunk #2 FAILED at 302.
> 1 out of 2 hunks FAILED -- saving rejects to file
> drivers/staging/rtl8187se/r8185b_init.c.rej
> james@mercury:/usr/src/linux-source-2.6.32$ patch -p1 --dry-run <
> /home/james/rtl8187se_
> rtl8187se_change_panic_to_warn rtl8187se_lock_pci_remove
> james@mercury:/usr/src/linux-source-2.6.32$ patch -p1 --dry-run <
> /home/james/rtl8187se_lock_pci_remove
> patching file drivers/staging/rtl8187se/r8180_core.c
> patch unexpectedly ends in middle of line
> patch: **** unexpected end of file in patch
> james@mercury:/usr/src/linux-source-2.6.32$
>
> Do I need to do anything to the kernel source before applying the patches?
You needed a different version of the patch for 2.6.32. Apply the attached
version. You only need the one patch.
Larry
[-- Attachment #2: rtl8187se_change_panic_to_warn --]
[-- Type: text/plain, Size: 2213 bytes --]
This driver issues a kernel panic over conditions that do not
justify such drastic action. Change these to log entries with
a stack dump.
This patch fixes the system crash reported in
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/674285.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Reported-and-Tested-by: Robie Basik <rb-oss-3@justgohome.co.uk>
Cc: Stable <stable@kernel.org>
---
Greg,
As this fix keeps the kernel from panicking over a trivial condition,
it should be pushed as soon as possible.
Larry
---
Index: linux-2.6/drivers/staging/rtl8187se/r8185b_init.c
===================================================================
--- linux-2.6.orig/drivers/staging/rtl8187se/r8185b_init.c
+++ linux-2.6/drivers/staging/rtl8187se/r8185b_init.c
@@ -356,8 +356,12 @@ HwHSSIThreeWire(
}
udelay(10);
}
- if (TryCnt == TC_3W_POLL_MAX_TRY_CNT)
- panic("HwThreeWire(): CmdReg: %#X RE|WE bits are not clear!!\n", u1bTmp);
+ if (TryCnt == TC_3W_POLL_MAX_TRY_CNT) {
+ printk(KERN_ERR "rtl8187se: HwThreeWire(): CmdReg:"
+ " %#X RE|WE bits are not clear!!\n", u1bTmp);
+ dump_stack();
+ return 0;
+ }
// RTL8187S HSSI Read/Write Function
u1bTmp = read_nic_byte(dev, RF_SW_CONFIG);
@@ -397,13 +401,23 @@ HwHSSIThreeWire(
int idx;
int ByteCnt = nDataBufBitCnt / 8;
//printk("%d\n",nDataBufBitCnt);
- if ((nDataBufBitCnt % 8) != 0)
- panic("HwThreeWire(): nDataBufBitCnt(%d) should be multiple of 8!!!\n",
- nDataBufBitCnt);
-
- if (nDataBufBitCnt > 64)
- panic("HwThreeWire(): nDataBufBitCnt(%d) should <= 64!!!\n",
- nDataBufBitCnt);
+ if ((nDataBufBitCnt % 8) != 0) {
+ printk(KERN_ERR "rtl8187se: "
+ "HwThreeWire(): nDataBufBitCnt(%d)"
+ " should be multiple of 8!!!\n",
+ nDataBufBitCnt);
+ dump_stack();
+ nDataBufBitCnt += 8;
+ nDataBufBitCnt &= ~7;
+ }
+
+ if (nDataBufBitCnt > 64) {
+ printk(KERN_ERR "rtl8187se: HwThreeWire():"
+ " nDataBufBitCnt(%d) should <= 64!!!\n",
+ nDataBufBitCnt);
+ dump_stack();
+ nDataBufBitCnt = 64;
+ }
for(idx = 0; idx < ByteCnt; idx++)
{
next prev parent reply other threads:[~2010-11-14 20:24 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-12 0:41 r8187se panic Robie Basak
2010-11-12 2:00 ` Larry Finger
2010-11-12 11:06 ` Robie Basak
2010-11-12 13:06 ` Larry Finger
2010-11-12 15:55 ` Robie Basak
2010-11-12 16:09 ` Larry Finger
2010-11-12 17:00 ` Robie Basak
2010-11-12 17:28 ` Larry Finger
2010-11-12 17:40 ` Robie Basak
2010-11-13 18:18 ` James Womack
2010-11-13 18:44 ` Larry Finger
2010-11-13 19:27 ` James Womack
2010-11-13 20:02 ` Larry Finger
2010-11-14 12:22 ` James Womack
2010-11-14 16:18 ` Larry Finger
2010-11-14 18:49 ` James Womack
2010-11-14 20:23 ` Larry Finger [this message]
2010-11-15 21:05 ` James Womack
2010-11-15 23:44 ` Larry Finger
2010-11-16 9:55 ` James Womack
2010-11-16 14:24 ` Larry Finger
2010-11-16 14:46 ` James Womack
2010-11-16 15:00 ` Larry Finger
2010-11-16 15:08 ` Rafał Miłecki
2010-11-16 15:42 ` Larry Finger
2010-11-16 16:55 ` James Womack
2010-11-16 17:16 ` Larry Finger
2010-11-14 19:38 ` James Womack
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=4CE0455A.50709@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=james.c.womack@gmail.com \
--cc=linux-wireless@vger.kernel.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).