Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 185517 - I/O error when reading from Nikon D100 camera
Summary: I/O error when reading from Nikon D100 camera
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Daniel Drake (RETIRED)
URL: http://bugs.gentoo.org/show_bug.cgi?i...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-16 12:47 UTC by Stefan de Konink
Modified: 2007-07-28 16:00 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Update session (changes) (changes.log.gz,7.63 KB, application/x-gzip)
2007-07-16 14:49 UTC, Stefan de Konink
Details
lsusb -v (nikond100.txt,12.84 KB, text/plain)
2007-07-16 15:29 UTC, Stefan de Konink
Details
output of error (output.dmesg,5.58 KB, text/plain)
2007-07-16 15:30 UTC, Stefan de Konink
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan de Konink 2007-07-16 12:47:00 UTC
Since a week or so I had problems with my Nikon D100 camera reading my CompactFlash cards. On my 'normal' PC this ended up in errors, and yesterday I updated my iBook and have the same errors (while my PC was broken, my iBook still worked).

Jul 15 22:20:36 iBook end_request: I/O error, dev sda, sector 2000880
Jul 15 22:20:36 iBook Buffer I/O error on device sda, logical block 2000880

Now It is very interesting, because the device itself has 2000881 sectors.


It ends up in an error also described here:
http://bugs.gentoo.org/show_bug.cgi?id=84725#c14

Interesting enough... "can't read superblock", is the error. But there is *no* data comming from this device, even with a dd noerror command. I verified it isn't the cable or device. My neighbor is able to read the camera and Compact Flash card with Vista, and the camera doesn't complain about reading the card.

I know it is not glibc related, but suspect it has a background in udev.


I have tested a normal USB1 memorystick, which *still* works as expected.


Reproducible: Always

Steps to Reproduce:
1. plugin in camera Nikon D100
2. /dev/sda and /dev/sda1 are made
3. mount /dev/sda1 /mnt/floppy -t vfat
4. can't read superblock

Actual Results:  
4. can't read superblock

Expected Results:  
A normal mount like usbstick.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-07-16 14:32:19 UTC
emerge --info please.
Comment 2 Stefan de Konink 2007-07-16 14:49:57 UTC
Created attachment 125027 [details]
Update session (changes)

I currently don't have a portage tree here (holidays), but i'll create it, if the WiFi link is stable enough :)

To provide some information:

Kernel:
2.6.21-gentoo-r4 

Use flags:
*/* dbus -ruby -gpm -bonobo -mikmod -kde -esd -arts -qt -qt3 -qt4 startup-notification msn dvi t1lib pdf cairo -qt -qt3 -qt4 -cups -gnome -eds v4l -postgres -ldap sqlite ilbc tetex opengl sdl xml xsl -odbc tcltk ffmpeg spell X nsplugin jpeg tiff gtk gtk2 nptl nptlonly userlocales pic altivec bzip2 nls -berkdb alsa mmap ogg flac speex dv encode vorbis ieee1394 network theora gsm mp3 fbcon lcms glitz curl png xprint xfs mad xv udev gps mozbranding -gimp -exif hal -gstreamer -doc libnotify sqlite3 -gdbm

And you can find the update session in the attached file. So the ones that jump into my eyes are the HAL update and the udev update. The kernel wasn't updated. Maybe it could be fixed in 2.6.22 (but this wasn't in ~ppc yet).
Comment 3 Stefan de Konink 2007-07-16 15:15:39 UTC
http://linux.derkeiler.com/Mailing-Lists/Kernel/2007-07/msg00779.html

Seems to be for a D50 too...
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2007-07-16 15:17:20 UTC
.
Comment 5 Stefan de Konink 2007-07-16 15:29:36 UTC
Created attachment 125038 [details]
lsusb -v

I have sent Alan Stern these two documents.
Comment 6 Stefan de Konink 2007-07-16 15:30:15 UTC
Created attachment 125040 [details]
output of error
Comment 7 Stefan de Konink 2007-07-16 17:05:01 UTC
Index: usb-2.6/drivers/usb/storage/unusual_devs.h
===================================================================
--- usb-2.6.orig/drivers/usb/storage/unusual_devs.h
+++ usb-2.6/drivers/usb/storage/unusual_devs.h
@@ -313,6 +313,13 @@ UNUSUAL_DEV(  0x04b0, 0x0301, 0x0010, 0x
                US_SC_DEVICE, US_PR_DEVICE,NULL,
                US_FL_NOT_LOCKABLE ),
 
+/* Reported by Stefan de Konink <skinkie@xs4all.nl> */
+UNUSUAL_DEV(  0x04b0, 0x0401, 0x0200, 0x0200,
+               "NIKON",
+               "NIKON DSC D100",
+               US_SC_DEVICE, US_PR_DEVICE, NULL,
+               US_FL_FIX_CAPACITY),
+
 /* Reported by Andreas Bockhold <andreas@bockionline.de> */
 UNUSUAL_DEV(  0x04b0, 0x0405, 0x0100, 0x0100,
                "NIKON",


I have confirmed Alan this is the fix, and it will be included in the next kernel release.
Comment 8 Stefan de Konink 2007-07-16 20:43:41 UTC
I got a reply from Alan on my question if anything was changed in the vanilla-kernel lately, and it wasn't. So an option question stays: is something changed in gentoo-sources that might have caused this camera to stop functioning?

Or should this search be narrowed to the updated userland packages?
Comment 9 Daniel Drake (RETIRED) gentoo-dev 2007-07-16 23:55:36 UTC
Gentoo's patches are very light, we don't change anything in this area and haven't done in a long while. Please keep us updated on the fate of the patch...
Comment 10 Stefan de Konink 2007-07-17 00:27:01 UTC
(In reply to comment #9)
> Gentoo's patches are very light, we don't change anything in this area and
> haven't done in a long while. Please keep us updated on the fate of the
> patch...
> 

Fate:

This patch (as938) adds an unusual_devs entry for the Nikon DSC D100.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>


But you must agree it is strange that two systems stop working after upgrading? Currently I'm holiday, but I have at home at least one machine that is still running on an old kernel and basesystem. So it my be interesting to find out what in userspace is the cause for this. Since I was running 2.6.21 from April, I'm pretty sure that it is the only component that was not changed. (thanks to /var/log/messages)
Comment 11 Daniel Drake (RETIRED) gentoo-dev 2007-07-17 02:15:03 UTC
The quirk added indicates that the device reports an off-by-one capacity. You will not see any problems until something tries to access the last sector on the disk, and at that point, everything else will screw up.

So, it's not unreasonable to think that previously, nothing was trying to access that sector, but now something is.

Reopening the bug so that we can track the patch and include it in gentoo-sources.
Comment 12 Stefan de Konink 2007-07-18 16:07:02 UTC
This is a note to let you know that I've just added the patch titled

     Subject: USB: usb-storage: unusual_devs entry for Nikon D100

to my gregkh-2.6 tree.  Its filename is

     usb-usb-storage-unusual_devs-entry-for-nikon-d100.patch

This tree can be found at 
    http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/
Comment 13 Daniel Drake (RETIRED) gentoo-dev 2007-07-22 04:13:38 UTC
Thanks for the update, will include in future releases
Comment 14 Daniel Drake (RETIRED) gentoo-dev 2007-07-28 16:00:58 UTC
Fixed in gentoo-sources-2.6.22-r2 (genpatches-2.6.22-3)