Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Larry Finger and committed by
Greg Kroah-Hartman
f36d83a8 61838261

+22 -8
+22 -8
drivers/staging/rtl8187se/r8185b_init.c
··· 264 264 265 265 udelay(10); 266 266 } 267 - if (TryCnt == TC_3W_POLL_MAX_TRY_CNT) 268 - panic("HwThreeWire(): CmdReg: %#X RE|WE bits are not clear!!\n", u1bTmp); 267 + if (TryCnt == TC_3W_POLL_MAX_TRY_CNT) { 268 + printk(KERN_ERR "rtl8187se: HwThreeWire(): CmdReg:" 269 + " %#X RE|WE bits are not clear!!\n", u1bTmp); 270 + dump_stack(); 271 + return 0; 272 + } 269 273 270 274 /* RTL8187S HSSI Read/Write Function */ 271 275 u1bTmp = read_nic_byte(dev, RF_SW_CONFIG); ··· 302 298 int idx; 303 299 int ByteCnt = nDataBufBitCnt / 8; 304 300 /* printk("%d\n",nDataBufBitCnt); */ 305 - if ((nDataBufBitCnt % 8) != 0) 306 - panic("HwThreeWire(): nDataBufBitCnt(%d) should be multiple of 8!!!\n", 307 - nDataBufBitCnt); 301 + if ((nDataBufBitCnt % 8) != 0) { 302 + printk(KERN_ERR "rtl8187se: " 303 + "HwThreeWire(): nDataBufBitCnt(%d)" 304 + " should be multiple of 8!!!\n", 305 + nDataBufBitCnt); 306 + dump_stack(); 307 + nDataBufBitCnt += 8; 308 + nDataBufBitCnt &= ~7; 309 + } 308 310 309 - if (nDataBufBitCnt > 64) 310 - panic("HwThreeWire(): nDataBufBitCnt(%d) should <= 64!!!\n", 311 - nDataBufBitCnt); 311 + if (nDataBufBitCnt > 64) { 312 + printk(KERN_ERR "rtl8187se: HwThreeWire():" 313 + " nDataBufBitCnt(%d) should <= 64!!!\n", 314 + nDataBufBitCnt); 315 + dump_stack(); 316 + nDataBufBitCnt = 64; 317 + } 312 318 313 319 for (idx = 0; idx < ByteCnt; idx++) 314 320 write_nic_byte(dev, (SW_3W_DB0+idx), *(pDataBuf+idx));