Commit 94e80545 authored by Larry Finger's avatar Larry Finger Committed by Greg Kroah-Hartman

staging: rtl8187se: Change panic to warn when RF switch turned off

commit f36d83a8 upstream.

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: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Reported-and-Tested-by: default avatarRobie Basik <rb-oss-3@justgohome.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 2b9e50d0
...@@ -356,8 +356,12 @@ HwHSSIThreeWire( ...@@ -356,8 +356,12 @@ HwHSSIThreeWire(
} }
udelay(10); udelay(10);
} }
if (TryCnt == TC_3W_POLL_MAX_TRY_CNT) if (TryCnt == TC_3W_POLL_MAX_TRY_CNT) {
panic("HwThreeWire(): CmdReg: %#X RE|WE bits are not clear!!\n", u1bTmp); printk(KERN_ERR "rtl8187se: HwThreeWire(): CmdReg:"
" %#X RE|WE bits are not clear!!\n", u1bTmp);
dump_stack();
return 0;
}
// RTL8187S HSSI Read/Write Function // RTL8187S HSSI Read/Write Function
u1bTmp = read_nic_byte(dev, RF_SW_CONFIG); u1bTmp = read_nic_byte(dev, RF_SW_CONFIG);
...@@ -397,13 +401,23 @@ HwHSSIThreeWire( ...@@ -397,13 +401,23 @@ HwHSSIThreeWire(
int idx; int idx;
int ByteCnt = nDataBufBitCnt / 8; int ByteCnt = nDataBufBitCnt / 8;
//printk("%d\n",nDataBufBitCnt); //printk("%d\n",nDataBufBitCnt);
if ((nDataBufBitCnt % 8) != 0) if ((nDataBufBitCnt % 8) != 0) {
panic("HwThreeWire(): nDataBufBitCnt(%d) should be multiple of 8!!!\n", printk(KERN_ERR "rtl8187se: "
nDataBufBitCnt); "HwThreeWire(): nDataBufBitCnt(%d)"
" should be multiple of 8!!!\n",
nDataBufBitCnt);
dump_stack();
nDataBufBitCnt += 8;
nDataBufBitCnt &= ~7;
}
if (nDataBufBitCnt > 64) if (nDataBufBitCnt > 64) {
panic("HwThreeWire(): nDataBufBitCnt(%d) should <= 64!!!\n", printk(KERN_ERR "rtl8187se: HwThreeWire():"
nDataBufBitCnt); " nDataBufBitCnt(%d) should <= 64!!!\n",
nDataBufBitCnt);
dump_stack();
nDataBufBitCnt = 64;
}
for(idx = 0; idx < ByteCnt; idx++) for(idx = 0; idx < ByteCnt; idx++)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment