Discussion:
[PATCH] [2.6.23.13] udev hangs USB-storage (HP r707 camera)
Grant Grundler
2008-01-20 05:25:53 UTC
Permalink
On Sat, Jan 19, 2008 at 10:11:05PM -0600, James Bottomley wrote:
...
Add the device to drivers/usb/storage/unusual_devs.h with
US_FL_FIX_CAPACITY. You'll need to know it's USB ids as well for this
file.
James,
Thanks! Patch below (for Alan) works for me.

Jan 19 20:50:17 localhost kernel: USB Mass Storage support registered.
Jan 19 20:50:22 localhost kernel: scsi scan: INQUIRY result too short (5), using 36
Jan 19 20:50:22 localhost kernel: scsi 0:0:0:0: Direct-Access HP PhotoSmart R707 A001 PQ: 0 ANSI: 0
Jan 19 20:50:22 localhost kernel: sd 0:0:0:0: [sda] 60800 512-byte hardware sectors (31 MB)
Jan 19 20:50:22 localhost kernel: sd 0:0:0:0: [sda] Write Protect is off
Jan 19 20:50:22 localhost kernel: sd 0:0:0:0: [sda] 60800 512-byte hardware sectors (31 MB)
Jan 19 20:50:22 localhost kernel: sd 0:0:0:0: [sda] Write Protect is off
Jan 19 20:50:22 localhost kernel: sda: sda1
Jan 19 20:50:22 localhost kernel: sd 0:0:0:0: [sda] Attached SCSI removable disk

FTR, previous sd output was showing 60801 sectors.

***@mb500:~ # lsusb
Bus 001 Device 007: ID 03f0:4002 Hewlett-Packard PhotoSmart 720 / PhotoSmart 935 (storage)
Bus 001 Device 004: ID 046d:c030 Logitech, Inc. iFeel Mouse
Bus 001 Device 003: ID 0451:1446 Texas Instruments, Inc. TUSB2040/2070 Hub
Bus 001 Device 002: ID 7fff:bfff
Bus 001 Device 001: ID 0000:0000



Thanks!
grant

Commit Log entry:

Add "FIX_CAPACITY" entry for HP Photosmart r707 Camera in "Disk" mode.
Camera will wedge when /lib/udev/vol_id attempts to access the last sector,
EIO gets reported to dmesg, and block device is marked "offline" (it is).
Reproduced vol_id behavior with:
"dd if=/dev/sda of=/dev/null skip=60800 count=1"

With patch, linux now reports 60800 sectors and udev is happy.

email thread reference:
http://marc.info/?t=120076483300002&r=1&w=2

Signed-off-by: Grant Grundler <***@parisc-linux.org>

--- linux-2.6.23.13/drivers/usb/storage/unusual_devs.h 2008-01-19 19:59:15.000000000 -0800
+++ linux-2.6.23-GGG/drivers/usb/storage/unusual_devs.h 2008-01-19 20:40:40.000000000 -0800
@@ -86,6 +86,14 @@
US_SC_8070, US_PR_USBAT, init_usbat_cd, 0),
#endif

+/* Reported by Grant Grundler <***@parisc-linux.org>
+ * HP r707 camera in "Disk" mode with 2.00.23 or 2.00.24 firmware.
+ */
+UNUSUAL_DEV( 0x03f0, 0x4002, 0x0001, 0x0001,
+ "HP",
+ "PhotoSmart R707",
+ US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_CAPACITY),
+
/* Reported by Sebastian Kapfer <***@gmx.net>
* and Olaf Hering <***@suse.de> (different bcd's, same vendor/product)
* for USB floppies that need the SINGLE_LUN enforcement.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
linux-usb-***@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Phil Dibowitz
2008-01-23 05:27:09 UTC
Permalink
Post by Grant Grundler
...
Add the device to drivers/usb/storage/unusual_devs.h with
US_FL_FIX_CAPACITY. You'll need to know it's USB ids as well for this
file.
James,
Thanks! Patch below (for Alan) works for me.
Patch looks fine to me. Let me get my tree in order (sorry, been really
swamped lately so I haven't updated in a while), make sure this diff's
nicely against the latest rc's, and I'll pass it on up. .24 is already
(essentially) done, so I'll get it to Greg in the next day or so and it
should make it into .25.

Sorry for the delay, and thanks Alan for pinging me on this.

As for Grant - more information on "Protocol" vs "Subclass" can be found on
my unusual_devs page here:

http://www.phildev.net/linux/usb-unusualdevs-notes.html
--
Phil Dibowitz phil-***@public.gmane.org
Open Source software and tech docs Insanity Palace of Metallica
http://www.phildev.net/ http://www.ipom.com/

"Never write it in C if you can do it in 'awk';
Never do it in 'awk' if 'sed' can handle it;
Never use 'sed' when 'tr' can do the job;
Never invoke 'tr' when 'cat' is sufficient;
Avoid using 'cat' whenever possible" -- Taylor's Laws of Programming
Grant Grundler
2008-01-23 06:55:56 UTC
Permalink
On Tue, Jan 22, 2008 at 09:27:09PM -0800, Phil Dibowitz wrote:
...
Post by Phil Dibowitz
Patch looks fine to me. Let me get my tree in order (sorry, been really
swamped lately so I haven't updated in a while), make sure this diff's
nicely against the latest rc's,
It's not. It's against 2.6.23. But I expect it to apply with fuzz
at the worst case.
Post by Phil Dibowitz
and I'll pass it on up. .24 is already
(essentially) done, so I'll get it to Greg in the next day or so and it
should make it into .25.
thanks!
Post by Phil Dibowitz
Sorry for the delay, and thanks Alan for pinging me on this.
As for Grant - more information on "Protocol" vs "Subclass" can be found on
http://www.phildev.net/linux/usb-unusualdevs-notes.html
In general, a very helpful document! Thanks!

"useProtocol - These are listed in protocols.h with explinations. One example:

* US_SC_DEVICE - use whatever the device claims
* see drivers/usb/storage/protocol.h for a full list and comments "

Some issues/comments:
o I don't see any sort of list in protocol.h. And the comments in
protocol.h don't discuss useProtocol or which protocols.
Maybe "the list" moved to include/linux/usb_usual.h?

o US_SC_* and US_PR_* constants both seem like good candidates for enum
(to make sure the right "type" get used with the right field.)

cheers,
grant

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
linux-usb-***@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Grant Grundler
2008-01-23 07:02:30 UTC
Permalink
On Tue, Jan 22, 2008 at 11:55:56PM -0700, Grant Grundler wrote:
...
Post by Grant Grundler
Post by Phil Dibowitz
http://www.phildev.net/linux/usb-unusualdevs-notes.html
In general, a very helpful document! Thanks!
...

I read the rest of the document and explains exactly my confusion.
Can you please include that document into Documentation/usb/ ?
And then add a reference to the location where the US_SC* and US_PR*
constants are defined?

thanks again!
grant
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Phil Dibowitz
2008-01-23 08:50:00 UTC
Permalink
Post by Grant Grundler
...
Post by Grant Grundler
Post by Phil Dibowitz
http://www.phildev.net/linux/usb-unusualdevs-notes.html
In general, a very helpful document! Thanks!
...
I read the rest of the document and explains exactly my confusion.
Can you please include that document into Documentation/usb/ ?
And then add a reference to the location where the US_SC* and US_PR*
constants are defined?
They moved since I wrote that document with the birth of libusual.

include/linux/usb_usual.h is where you can find them. I'll try to get around
to updating that doc sometime soon.
--
Phil Dibowitz ***@ipom.com
Open Source software and tech docs Insanity Palace of Metallica
http://www.phildev.net/ http://www.ipom.com/

"Never write it in C if you can do it in 'awk';
Never do it in 'awk' if 'sed' can handle it;
Never use 'sed' when 'tr' can do the job;
Never invoke 'tr' when 'cat' is sufficient;
Avoid using 'cat' whenever possible" -- Taylor's Laws of Programming
Phil Dibowitz
2008-01-24 05:55:31 UTC
Permalink
Post by Grant Grundler
...
Post by Grant Grundler
Post by Phil Dibowitz
http://www.phildev.net/linux/usb-unusualdevs-notes.html
In general, a very helpful document! Thanks!
...
I read the rest of the document and explains exactly my confusion.
Can you please include that document into Documentation/usb/ ?
And then add a reference to the location where the US_SC* and US_PR*
constants are defined?
I went back to look at the document - man, it was *way* out of date. I've
updated it and it should be accurate now. It makes no attempt to explain
libusual, which I should probably add at some point, since it's very tied
together with unusual_devs.h now... but for now, I think my updates should
make things much clearer.
--
Phil Dibowitz ***@ipom.com
Open Source software and tech docs Insanity Palace of Metallica
http://www.phildev.net/ http://www.ipom.com/

"Never write it in C if you can do it in 'awk';
Never do it in 'awk' if 'sed' can handle it;
Never use 'sed' when 'tr' can do the job;
Never invoke 'tr' when 'cat' is sufficient;
Avoid using 'cat' whenever possible" -- Taylor's Laws of Programming
Loading...