Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
USB drive causes kernel panics--sometimes
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
virduun
n00b
n00b


Joined: 02 Jun 2011
Posts: 26

PostPosted: Thu Jun 02, 2011 1:43 am    Post subject: USB drive causes kernel panics--sometimes Reply with quote

I have an issue where plugging in my 8GB flash drive will often cause a kernel panic, forcing me to reboot. Now, it doesn't happen every time. I also have a 1GB drive, and I've noticed that the 8GB drive will sometimes work properly after I've previously mounted the 1GB drive. However, sometimes the 8GB drive is picky about which port it's plugged into. I have had it work in both frontside USB ports, but most of the time it seems to really prefer one of them. The 1GB drive seems to always work. I also have an external hard drive which I haven't tested yet.

Now, the 8GB drive is a SanDisk, but I'm pretty sure I cleaned that U3 crap off of it with the uninstaller, so theoretically that shouldn't be an issue (the 1GB drive is an LG, if that matters), and it is formatted in FAT32.

I did try to read some of the messages on the screen when I plugged in the 8GB and it seems to find the drive just fine, then starts setting up sdb, which is where USB drives seem to get placed on my system, but then at some point it gets a message that says "kernel panic - not syncing: fatal exception in interrupt".

I'm completely at a loss to even begin trying to figure out what is causing that strange behavior, and I'm kind of a new user. I have a friend who's been using Gentoo for several years, but he's similarly stumped. Any help would be appreciated. Thanks. :)
Back to top
View user's profile Send private message
Otamay
n00b
n00b


Joined: 04 Apr 2011
Posts: 18

PostPosted: Thu Jun 02, 2011 5:18 am    Post subject: Reply with quote

May I see the output of `fdisk -l /deb/sdb`? =O
Back to top
View user's profile Send private message
virduun
n00b
n00b


Joined: 02 Jun 2011
Posts: 26

PostPosted: Thu Jun 02, 2011 5:29 pm    Post subject: Reply with quote

Actually, I don't normally have a sdb in /dev. It seems to get created when I insert a USB device.

Edit: Sorry for the late reply. I got sort of sidetracked last night.

Edit 2: In the event you wanted that done after mounting a drive, here's the output of that with the 1G mounted. I tried to do it with both drives mounted, but the 8G didn't feel like working and i had to reboot (didn't see any text explicitly talking about kernel panic this time though--some stuff concerning scsi though...don't know if that means anything; just noting it in case it might):

Disk /dev/sdb: 1043 MB, 1043333120 bytes
64 heads, 32 sectors/track, 995 cylinders, total 2037760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 * 32 2037758 1018863+ c W95 FAT32 (LBA)

Edit 3: Ok, after taking care of the output for the 1G drive, I decided to try if the 8G felt like working, and it did this time. I put it in the other front port though, because that seems to increase the odds of it working:

Disk /dev/sdb: 8065 MB, 8065646080 bytes
8 heads, 32 sectors/track, 61535 cylinders, total 15753215 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 * 32 15753214 7876591+ b W95 FAT32

Edit 4: Attempting to put the 1G drive in with the 8G mounted just now caused a panic, with standard "not syncing: fatal exception in interrupt" language, forcing a reset.
Back to top
View user's profile Send private message
TomCat1
n00b
n00b


Joined: 18 May 2005
Posts: 15
Location: Prague

PostPosted: Fri Jun 03, 2011 7:38 pm    Post subject: Reply with quote

I have the same problem. After plugging USB flash disc (tried two), I got kernel panic.
Back to top
View user's profile Send private message
kurisu
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2011
Posts: 147
Location: Munich, Germany

PostPosted: Tue Jun 14, 2011 10:18 pm    Post subject: Reply with quote

Same here. I quite often experience this issue on various machines when attempting to hotplug external usb devices (hard disks in my case). No solution here yet either, however, this has never been occuring before upgrading to kernel versions >2.6.36 (currently running sys-kernel/gentoo-sources-2.6.38-r6 on all machines). Any suggestions?
Back to top
View user's profile Send private message
kurisu
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2011
Posts: 147
Location: Munich, Germany

PostPosted: Tue Jun 14, 2011 10:47 pm    Post subject: Reply with quote

I have just read this bug report https://bugs.gentoo.org/show_bug.cgi?id=369061. Upgrading to sys-kernel/gentoo-sources-2.6.38-r7 seems to have fixed it for me.
Back to top
View user's profile Send private message
virduun
n00b
n00b


Joined: 02 Jun 2011
Posts: 26

PostPosted: Tue Jun 14, 2011 11:31 pm    Post subject: Reply with quote

I'm using 2.6.39-r1, and was using 2.6.39 when I originally started the thread. Is there some kind of configuration in the kernel I should look into which might cause this issue if I misconfigured it?

@TomCat1

There's another thread discussing a similar issue here as well: https://forums.gentoo.org/viewtopic-t-882390.html Kind of interesting that many of the people in that thread (including myself) have ASUS motherboards.
Back to top
View user's profile Send private message
TomCat1
n00b
n00b


Joined: 18 May 2005
Posts: 15
Location: Prague

PostPosted: Wed Jun 15, 2011 7:37 pm    Post subject: Reply with quote

Now I have 2.6.39-gentoo-r1 and still have the problem.
I have Phenom 9950 on Gigabyte GA-MA790GP-DS4H, BIOS F7i 12/24/2010.
Back to top
View user's profile Send private message
daddio
Tux's lil' helper
Tux's lil' helper


Joined: 11 Oct 2003
Posts: 143
Location: Richland WA

PostPosted: Thu Jun 16, 2011 4:01 am    Post subject: Upgrading to latset git kernel fixes it for me. Reply with quote

I'm also experiencing this issue.
In my case its an Archos media player and a 4GB usb pen drive that trigger the kernel panic.

I'm wondering how (if at all) it is possible to keep the output of dmesg from the panic?
Or is it not recorded anywhere since the kernel is in the process of wedging itself as it prints out...
I guess I could use a digital camera to capture it if need be.

[UPDATE]
I found that others had submitted the same problem on the LKML.
It seems to affect only amd64 systems with certain motherboards... or something.
Anyway, I was all set to do a git-bisect. Went to all the trouble to clone the mainline kernel repository... buty I thought I ought to compile the latest git kernel just in case it is already fixed.

I copied my .config from 2.6.39, and compiled. it comes out as 3.0.0-rc3+, and the panic problem (which for me was quite reproducable... boot into kde, plug in the Archos, select "mount" in the archos, and boom! panic) is now gone.
I have no idea when this will make its way downstream. and I'm too lazy to git-bisect just to find out when it was fixed.
Back to top
View user's profile Send private message
colo-des
n00b
n00b


Joined: 20 May 2011
Posts: 23

PostPosted: Sun Jun 19, 2011 9:18 pm    Post subject: Reply with quote

I've solved it by applying this patch:
https://patchwork.kernel.org/patch/487421/

I leave the link to my comment I made in: https://bugs.gentoo.org
https://bugs.gentoo.org/show_bug.cgi?id=369061#c13

Greetings
Back to top
View user's profile Send private message
colo-des
n00b
n00b


Joined: 20 May 2011
Posts: 23

PostPosted: Mon Jun 20, 2011 12:04 am    Post subject: Reply with quote

Well, it seems that after using it a while, the problem returned
then I started looking for another patch has come out and meet me
with this set of patches:
http://kernel.org/pub/linux/kernel/v2.6/stable-review/patch-2.6.39.2-rc1.gz

Then apply the changes to two files scsi_scan.c scsi_sysfs.c
and now I can say I made a thousand proofs of connecting and disconnecting
USB sticks and so far I have not had more kernel panic.

https://bugs.gentoo.org/show_bug.cgi?id=369061#c14

Greetings
Back to top
View user's profile Send private message
virduun
n00b
n00b


Joined: 02 Jun 2011
Posts: 26

PostPosted: Mon Jun 20, 2011 8:41 am    Post subject: Reply with quote

Do you mean apply the 2.6.39.2.-rc1 patch and then edit those files, or do you mean that it's enough to just edit those files in the current kernel version? For reference, I'm using 2.6.39-r1. I looked at the patch file you linked and the lines you talk about adding in scsi_scan.c and scsi_sysfs.c in the buglist comment show up in the diffs. Sorry, I'm kind of new and just asking for a bit of clarification. :)
Back to top
View user's profile Send private message
colo-des
n00b
n00b


Joined: 20 May 2011
Posts: 23

PostPosted: Mon Jun 20, 2011 1:48 pm    Post subject: Reply with quote

Simply edit the two files and then recompile your kernel.
ctrl + w is the nano editor search command.

# nano -w /usr/src/linux-2.6.39-gentoo-r1/drivers/scsi/scsi_scan.c
ctrl+w: sdev->request_queue->queuedata = sdev;
and one line up...
blk_get_queue(sdev->request_queue);

# nano -w /usr/src/linux-2.6.39-gentoo-r1/drivers/scsi/scsi_sysfs.c
ctrl+w: /* NULL queue means the device can't be used */
and one line up...
blk_put_queue(sdev->request_queue);

# nano -w /usr/src/linux-2.6.39-gentoo-r1/drivers/scsi/scsi_sysfs.c
ctrl+w: struct device_attribute dev_attr_hstate =
static struct device_attribute dev_attr_hstate =

ctrl+w: struct attribute_group scsi_shost_attr_group =
static struct attribute_group scsi_shost_attr_group =

Greetings
Back to top
View user's profile Send private message
virduun
n00b
n00b


Joined: 02 Jun 2011
Posts: 26

PostPosted: Mon Jun 20, 2011 3:24 pm    Post subject: Reply with quote

I performed the modifications you indicated and so far the results look promising. The 8GB flash drive which usually causes issues has worked in both of the front USB ports, and I plugged in the 1GB drive separately and with the 8GB drive also mounted, and that hasn't caused any panics either. I haven't tried my external hard drive yet, but so far it looks like the fix worked. Thank you!! :)
Back to top
View user's profile Send private message
Kiwon Um
n00b
n00b


Joined: 15 Jul 2009
Posts: 49

PostPosted: Thu Jun 23, 2011 12:45 pm    Post subject: Reply with quote

colo-des wrote:
Simply edit the two files and then recompile your kernel.
ctrl + w is the nano editor search command.

# nano -w /usr/src/linux-2.6.39-gentoo-r1/drivers/scsi/scsi_scan.c
ctrl+w: sdev->request_queue->queuedata = sdev;
and one line up...
blk_get_queue(sdev->request_queue);

# nano -w /usr/src/linux-2.6.39-gentoo-r1/drivers/scsi/scsi_sysfs.c
ctrl+w: /* NULL queue means the device can't be used */
and one line up...
blk_put_queue(sdev->request_queue);

# nano -w /usr/src/linux-2.6.39-gentoo-r1/drivers/scsi/scsi_sysfs.c
ctrl+w: struct device_attribute dev_attr_hstate =
static struct device_attribute dev_attr_hstate =

ctrl+w: struct attribute_group scsi_shost_attr_group =
static struct attribute_group scsi_shost_attr_group =

Does this patch work for 2.6.38-r6 (currently gentoo-stable version for amd64) as well?
Thanks.
Back to top
View user's profile Send private message
colo-des
n00b
n00b


Joined: 20 May 2011
Posts: 23

PostPosted: Fri Jun 24, 2011 4:37 am    Post subject: Reply with quote

[/quote]
Does this patch work for 2.6.38-r6 (currently gentoo-stable version for amd64) as well?
Thanks.[/quote]

I have not installed the 2.6.38-r6, but I was comparing the two files of different versions and no change, so it's supposed to work.

Regards
Back to top
View user's profile Send private message
Kiwon Um
n00b
n00b


Joined: 15 Jul 2009
Posts: 49

PostPosted: Fri Jun 24, 2011 4:55 am    Post subject: Reply with quote

colo-des wrote:
I have not installed the 2.6.38-r6, but I was comparing the two files of different versions and no change, so it's supposed to work.

Thanks for your reply. Since the current stable version of official kernel is 2.6.39, I installed 2.6.39-r1 with the patch you suggested, yesterday. It works fine. I'm just little wondering about stability of the gentoo-test version (~arch). In the previous time, did any serious stability issue exist between test and stable versions?
Back to top
View user's profile Send private message
virduun
n00b
n00b


Joined: 02 Jun 2011
Posts: 26

PostPosted: Mon Jun 27, 2011 6:10 pm    Post subject: Reply with quote

Just as a note, I updated my system recently, which includes kernel version 2.6.39-r2, which does seem to have the fix. Plugged some USB drives to test it after switching to the new kernel and it seems to be working fine. :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum