Skip to contentSkip to conversation

oops in 2.6.8.1-mm4 and usb

DISCUSSION Pete Zaitcev 2 participants 2 messages Sep 1, 2004 1 message not in the archive Block layer

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 7 lines · On Tue, 31 Aug 2004 18:26:51 +0900 Clemens Schwaighofer <[email protected]>…

So I could mount it and then copied some files there. But when I tried to unmount the disk light on the iriver never went of. So after ~1 hour I just pulled the usb cable. I got the oops (see below).

end_request: I/O error, dev uba, sector 64
FAT bread failed in fat_clusters_flush

Unable to handle kernel NULL pointer dereference at virtual address 0000004c
Quoted 10 lines

EFLAGS: 00010202 (2.6.8.1-mm4)
EIP is at kobject_get+0xf/0x4e
~ [<c02b03ee>] get_device+0x18/0x21
~ [<c02b0209>] device_remove_file+0x1b/0x4e
~ [<e19d7e4c>] ub_disconnect+0x105/0x1b5 [ub]
~ [<c032d855>] usb_unbind_interface+0x7a/0x7c
~ [<c02b1271>] device_release_driver+0x64/0x66
~ [<c02b148a>] bus_remove_device+0x64/0xa5
~ [<c02b045e>] device_del+0x5d/0x9b
~ [<c0334ac1>] usb_disable_device+0xb9/0xf9

This oops is very mysterious, because it indicates that sc->intf was NULL, which is not possible when device_remove_file was called.

I'll look at it. For the moment, just make sure you have this:

drivers/block/ub.c +8 -0
@@ -1185,9 +1217,17 @@
 		goto error;
 	}
 
+	/*
+	 * ``If the allocation length is eighteen or greater, and a device
+	 * server returns less than eithteen bytes of data, the application
+	 * client should assume that the bytes not transferred would have been
+	 * zeroes had the device server returned those bytes.''
+	 */
 	memset(&sc->top_sense, 0, UB_SENSE_SIZE);
+
 	scmd = &sc->top_rqs_cmd;
 	scmd->cdb[0] = REQUEST_SENSE;
+	scmd->cdb[4] = UB_SENSE_SIZE;
 	scmd->cdb_len = 6;
 	scmd->dir = UB_DIR_READ;
 	scmd->state = UB_CMDST_INIT;

It won't resolve your oops, but at least the I/O should succeed now, so you would have a chance to unmount the thing before unplugging.

-- Pete

#2 lore raw
Quoted 6 lines · Pete Zaitcev

This oops is very mysterious, because it indicates that sc->intf was NULL, which is not possible when device_remove_file was called.

I'll look at it. For the moment, just make sure you have this:

I can confirm that this patch fixes the problem of the oops during unmount/shutdown (or reboot). Thanks.

lg, clemens