Here are the latest kernel messages: usb-storage: device found at 4 usb-storage: waiting for device to settle before scanning usb-storage: device scan complete scsi scan: INQUIRY result too short (5), using 36 scsi 4:0:0:0: Direct-Access PENTAX DIGITAL_CAMERA 1.00 PQ: 0 ANSI: 0 sd 4:0:0:0: [sdc] 3985409 512-byte hardware sectors (2041 MB) sd 4:0:0:0: [sdc] Write Protect is off sd 4:0:0:0: [sdc] Mode Sense: 0a 0a 00 01 sd 4:0:0:0: [sdc] Assuming drive cache: write through sd 4:0:0:0: [sdc] 3985409 512-byte hardware sectors (2041 MB) sd 4:0:0:0: [sdc] Write Protect is off sd 4:0:0:0: [sdc] Mode Sense: 0a 0a 00 01 sd 4:0:0:0: [sdc] Assuming drive cache: write through sdc: sdc1 sd 4:0:0:0: [sdc] Attached SCSI removable disk sd 4:0:0:0: Attached scsi generic sg2 type 0 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 However, no /dev/sdc exists for this what I think should be a mass storage device. I'm using sys-fs/udev-124-r1 and sys-kernel/gentoo-sources-2.6.27-r5.
Created attachment 174734 [details] lsusb output for the camera
Created attachment 174737 [details] kernel configuration
In addition to the kernel messages above, the following kernel messages had also appeared before I shut down the camera in the end: usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 sd 4:0:0:0: [sdc] Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK,SUGGEST_OK end_request: I/O error, dev sdc, sector 3985408 Buffer I/O error on device sdc, logical block 3985408 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 sd 4:0:0:0: [sdc] Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK,SUGGEST_OK end_request: I/O error, dev sdc, sector 3985408 Buffer I/O error on device sdc, logical block 3985408 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 sd 4:0:0:0: [sdc] Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK,SUGGEST_OK end_request: I/O error, dev sdc, sector 3985408 Buffer I/O error on device sdc, logical block 3985408 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 sd 4:0:0:0: [sdc] Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK,SUGGEST_OK end_request: I/O error, dev sdc, sector 3985408 Buffer I/O error on device sdc, logical block 3985408 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: reset full speed USB device using uhci_hcd and address 4 usb 2-1: USB disconnect, address 4 scsi 4:0:0:0: [sdc] Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK,SUGGEST_OK end_request: I/O error, dev sdc, sector 3985408 Buffer I/O error on device sdc, logical block 3985408 scsi 4:0:0:0: [sdc] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK,SUGGEST_OK end_request: I/O error, dev sdc, sector 735 Buffer I/O error on device sdc1, logical block 488 Buffer I/O error on device sdc1, logical block 489 Buffer I/O error on device sdc1, logical block 490 Buffer I/O error on device sdc1, logical block 491 Buffer I/O error on device sdc1, logical block 492 Buffer I/O error on device sdc1, logical block 493 Buffer I/O error on device sdc1, logical block 494 Buffer I/O error on device sdc1, logical block 495 Buffer I/O error on device sdc1, logical block 496 scsi 4:0:0:0: rejecting I/O to dead device PS: The device shows no problems on Windows XP, although I don't know whether that specific windows installation had any Pentax drivers installed (if such drivers exist at all).
I don't believe that this has something to do with our gentoo-sources or udev. Probably, your usb physical connection(cable, connectors etc.) is problematic. Try to CONFIG_USB_DEBUG=y and CONFIG_USB_STORAGE_DEBUG=y in order to see some more verbose messages about what really happens. Maybe you need to enable CONFIG_USB_<something> or CONFIG_USB_STORAGE_<something>. I don't want to assign any bug to the kernel team before we 're sure that this isn't a misconfiguration or something of your side(cables etc.). Reply here when you're sure that it's a bug in udev or gentoo-sources.
Created attachment 174848 [details] kernel (debug) messages Ok, I recompiled the kernel with USB and USB mass storage verbose debug messages. Here are all kernel messages that I think might be related to this case. This is what I changed in the kernel configuration just in case. I'm quite certain the other USB options presented by the kernels xconfig are irrelevant. CONFIG_USB_DEBUG=y CONFIG_USB_SUSPEND=y CONFIG_USB_STORAGE_DEBUG=y CONFIG_USB_LD=y According to drivers/usb/storage/unusual_devs.h, some Pentax Cameras have also been found not strictly follow the USB mass storage specifications. Perhaps that's the case?
I still don't believe that this is gentoo specific. Probably you would experience the same problem with vanilla-sources. But I'm not a kernel expert, so I will let the proper team to reply. Assigned to kernel team.
Created attachment 174857 [details, diff] possible fix Thanks for the detailed debugging logs - helps us get straight to the problem. Your device is crashing when Linux tries to access the very final sector. This is a common problem where the device doesn't follow the SCSI specs -- it is supposed to report the address of the final sector, but it instead reports the number of sectors on the device (which is 1 higher, because sectors start at 0). This patch should fix it, please give it a go.
Please also post the /proc/bus/usb/devices entry for your device (you have already posted equivalent info, but this is the form that kernel developers prefer to see included in the patch description)
The patch works like a charm. Thanks! =) Here's the entry from /proc/bus/usb/devices: T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=0a17 ProdID=006e Rev= 1.00 S: Manufacturer=PENTAX Corporation S: Product=K10D C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 2mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=83(I) Atr=03(Int.) MxPS= 64 Ivl=100ms
Patch was acked by upstream, so I've included it for the next 2.6.26/2.6.27 releases
Fixed in gentoo-sources-2.6.27-r6, closing this bug now as I don't think we'll do more 2.6.26 releases. (but if we do, this patch will be in there)