Gentoo Archives: gentoo-user

From: meino.cramer@×××.de
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] USB Problems
Date: Sun, 12 Jun 2011 23:58:26
Message-Id: 20110612235653.GE3061@solfire
In Reply to: Re: [gentoo-user] USB Problems by john
1 john <jdm@×××××××××××××××××××.uk> [11-06-13 01:13]:
2 > On Sun, 12 Jun 2011 21:20:48 +0200
3 > meino.cramer@×××.de wrote:
4 >
5 > > john <jdm@×××××××××××××××××××.uk> [11-06-12 20:52]:
6 > > > On Sun, 12 Jun 2011 16:45:38 +0200
7 > > > meino.cramer@×××.de wrote:
8 > > >
9 > > > > john <jdm@×××××××××××××××××××.uk> [11-06-12 16:36]:
10 > > > > > Gents
11 > > > > >
12 > > > > > Whenever I insert external USB device my machine locks and I
13 > > > > > have to do a hard reset (sys req does not even work). I have
14 > > > > > tried this in a graphical environment and without. Machine
15 > > > > > boots up fine with USB keyboard and mouse but will not boot up
16 > > > > > with usb storage (memory stick
17 > > > > > - tried several)
18 > > > > >
19 > > > > > I have recently upgrade kernel to 2.6.38-r6 when this error
20 > > > > > started (approx). Hav also tried 2.6.38-r7 (which according to
21 > > > > > bugzilla should fix an issue similar to this) the error still
22 > > > > > happens.
23 > > > > >
24 > > > > > Any suggestions on kernel config options, debugging would be
25 > > > > > appreciated. And how to trap full error message.
26 > > > > >
27 > > > > > Error message alongs these lines
28 > > > > >
29 > > > > > Kernel panic not syncing - fatal exception in iterrupt
30 > > > > > ksoftirqd/1 Not tainted
31 > > > > >
32 > > > > >
33 > > > > >
34 > > > > >
35 > > > > > --
36 > > > > > --------------
37 > > > > > --------------
38 > > > > > John D Maunder
39 > > > > > jdm@×××××××××××××××××××.uk
40 > > > > >
41 > > > >
42 > > > > Hi John,
43 > > > >
44 > > > > may be this could help to track th eerror more closely:
45 > > > > Recompile the kernel with CONFIG_USB_DEBUG set.
46 > > > > If not already done, enable CONFIG_MAGIC_SYSRQ and
47 > > > > read about the available commands in the according
48 > > > > docs under /usr/src/linux/Documentation/.
49 > > > > This is a overall life saver in many other cases too.
50 > > > > But it may be a security hole also -- you can disable
51 > > > > it in /proc/ later.
52 > > > > If possible change /etc/fstab to mount the partition
53 > > > > to which logging will go with the "sync" option so
54 > > > > every log entry will go directly onto the bare metal
55 > > > > instead of a RAM buffer.
56 > > > >
57 > > > > Reboot into console mode (no X).
58 > > > > cd to the logging directory and
59 > > > > do a tail -f onto the logfile in question
60 > > > >
61 > > > > Insert the "USB stick of death" ;) and
62 > > > > see, whether you can see anything in the
63 > > > > tailed log.
64 > > > >
65 > > > > If not do the magic sysrq dance to sync hds,
66 > > > > remount readonly and finally reboot.
67 > > > >
68 > > > > Take a closer look into the resulting logs.
69 > > > >
70 > > > > Good luck!
71 > > > >
72 > > > > Nevertheless have a nice weekend!
73 > > > > Best regards,
74 > > > > mcc
75 > > > >
76 > > > >
77 > > > >
78 > > >
79 > > > Thanks mmc,
80 > > > CONFIG_MAGIC_SYSRQ and CONFIG_USB_DEBUG set to y
81 > > >
82 > > > When I plug in USB device SYSREQ does not work. I have tested when
83 > > > system is normal and all ok with SYSREQ so USB device is locking up
84 > > > system completely.
85 > > >
86 > > > I have put sync in mount table but when device is inserted error log
87 > > > is not being produced (in /var/log/messages, etc). I may end up
88 > > > having to take a photo of error log(lol). Or there maybe some other
89 > > > way of catching error which Gentoo gurus may advise.
90 > > >
91 > > > I have tried 3 memory sticks and they all lock system up. These work
92 > > > on another PC using Arch and work on this PC dual booting with
93 > > > Windows. I have a usb hard drive which works ok so it is a memory
94 > > > stick only issue!!!!????
95 > > >
96 > > > Hmmm.
97 > > >
98 > > > --
99 > > > --------------
100 > > > --------------
101 > > > John D Maunder
102 > > > jdm@×××××××××××××××××××.uk
103 > > >
104 > >
105 > > Hi John,
106 > >
107 > > if sysreq does not work after inserting the usbstick then the kernel
108 > > stops working completly (the sysreq-code of the kernel is not
109 > > entered), which seems to be that something happening on very low
110 > > level (the problem not the sysreq-code of course... ;)
111 > >
112 > > Just another shot into the dark:
113 > > Do you have modularized all usb-related stuff? This also may help to
114 > > let the usb-sticks work correctly.
115 > >
116 > > Ah! Another thing: Insert the related modules into
117 > > /etc/conf.d/modules so that they get loaded in a very early
118 > > phase of the bootprocess.
119 > >
120 > > With modules loaded and with no usb-sticks as root inspect the
121 > > according modules with modinfo -p <modulename> to see, whether
122 > > there a additional parameters you may pass to the modules to get
123 > > an extra of informations or - better - to fix the issue.
124 > >
125 > > Modify under "Kernel hacking" in the kernel config the
126 > > "Default message log level" to see more.
127 > >
128 > > Furthermore there is a switch "Kernel debugging" with sub-options.
129 > > May be turning on these may also help to get closer to all evil ;)
130 > >
131 > > Last thing:
132 > > If there is nothing valueable stored on the usbsticks:
133 > > Try to reformat the usbsticks. Instead of putting a FAT32-fs on the
134 > > bare device, create a regular partition and create a Linux-fs
135 > > (reiserfs, ext2/3/4 or like that) on that partition.
136 > >
137 > > This may not be good idea in general, but - if it works - this would
138 > > give a hint, where to search next.
139 > >
140 > > Good luck!
141 > >
142 > > Best regards,
143 > > mcc
144 > >
145 > >
146 > >
147 > >
148 > >
149 > >
150 > >
151 > >
152 > >
153 >
154 > Thanks Meino,
155 > Have recompliled USB as modules (ehci-hcd, ohci-hcd and usb-storage and
156 > load with /etc/conf.d/modules but still locks ups. Hope these are the
157 > right ones. I'll try scsi next.
158 >
159 > Also tried fdisk Linux file system and format ext3. But all to no avail.
160 > Still locking up.
161 >
162 > Have configure kernel hacking options as suggested.
163 >
164 > Error message as follows:-
165 >
166 > --------------------------------------------------------
167 > Bug: unable to handle kernel null pointer dereference at
168 > 0000000000000048
169 >
170 > IP [<ffffffff811ddb8e>]elv_queue_empty+0x12/0x27
171 >
172 > Oops 000 [#1] SMP
173 >
174 > last sys file: /sys/devices/virtual/bdi/8:32/uevent
175 >
176 > Pid: 1-, comm: ksoftirqd/1 Tainted: P 2.6.38-gentoo-r7 #4 MICRO-STAR
177 > MS-7388
178 >
179 > RIP 0010[<ffffffff811ddb8e7>] elv-queue_empty+0x12/0x27
180 > --------------------------------------------------------
181 >
182 >
183 > From my very limited knowledge, I would suspect kernel problem (ksoft)
184 > and irq (software interrupt perhaps). Please put me right if I'm out of
185 > order here. I'm Linux noobie
186 >
187 >
188 > Think I'll drop back to an older kernel to see if I'm still getting the
189 > issue as this may elliminate hardware issue.
190 >
191 > Unsure how to pass options to modules when loading. is this just done
192 > through /etc/conf.d/modules
193 >
194 > I like the error messages though Oops, RIP (someone has a sense of
195 > humour)
196 >
197 >
198 > Thanks for you help
199 >
200 > At least you learn while debgging
201 >
202 >
203 > --
204 > --------------
205 > --------------
206 > John D Maunder
207 > jdm@×××××××××××××××××××.uk
208 >
209
210 Hi John,
211
212 yes, the kernel panics due to a NULL pointer dereference.
213 It happens at the memory adress 0000000000000048, which
214 looks to me as a suspicously low address...hmmm. But who knows...:)
215
216 As the usb stick runs fine when the mobo runs windows I think
217 there is no your-mobo-alone-hardware bug, but it may be still
218 a hardware issue, which is known to the driver programmers and
219 which was "fixed" (circumvented) with a windows-only driver.
220 The linux driver may not know of this and runs into an undefined
221 state here. But this is all is more like guessing than anything
222 else.
223
224 You can pass options to modules like this (this is from my
225 /etc/conf.d/modules):
226
227 modules_2_6="${modules_2_6} microcode"
228 module_microcode_args_2_6=""
229 modules_2_6="${modules_2_6} gspca_main"
230 module_gspca_main_args_2_6=""
231
232 One module per line...
233
234 Here I have left off the arguments by giving "" accordingly.
235 Below I have inserted a section from that file which gives commented
236 examples how to pass options/arguments:
237
238 # Give the modules some arguments if needed, per version if necessary.
239 #module_ieee1394_args="debug"
240 #module_ieee1394_args_2_6_23_gentoo_r5="ieee1394 ohci1394"
241 #module_ieee1394_args_2_6_23="tun ieee1394"
242 #module_ieee1394_args_2_6="tun"
243
244
245 Yes, the kernel messages are humorous...its just to sweeten the bitter
246 pill of a kernel panic.
247 If you like that kind of humor (Question to a couple (both hackers):
248 "Do you have children?" Answers: "Yes" Question: "Girl or boy" Answer:
249 "Yes"...which is 100% correct at least from the logical point of
250 view...;) I would suggest you to take a look here:
251 http://www.catb.org/jargon/
252
253 8)
254
255 It would be interesting (and would help the kernel hackers to get
256 closer to the may-be kernel problem) if a previous kernel would
257 run your usb-stick without a panic...
258
259 Good luck!
260 Best regards
261 mcc