linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
To: Grant Grundler <grundler-6jwH94ZQLHl74goWV3ctuw@public.gmane.org>
Cc: Stefan Richter
	<stefanr-MtYdepGKPcBMYopoZt5u/LNAH6kLmebB@public.gmane.org>,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: udev hangs USB-storage (HP r707 camera)
Date: Sat, 19 Jan 2008 22:11:05 -0600	[thread overview]
Message-ID: <1200802265.11214.8.camel@localhost.localdomain> (raw)
In-Reply-To: <20080120031008.GI11553-lGaJ6EKWmV+kGg0756fqLw@public.gmane.org>


On Sat, 2008-01-19 at 20:10 -0700, Grant Grundler wrote:
> On Sat, Jan 19, 2008 at 08:56:31PM -0600, James Bottomley wrote:
> ....
> > > it's children a few days ago (probably with 2.6.22-14-generic (Ubuntu
> > > kernel). I've appended everything for PID 17972 (which is only 12k, full
> > > output is 559KB). Key bit is this:
> > > 17972 _llseek(3, 31129600, [31129600], SEEK_SET) = 0
> > > 17972 read(3,  <unfinished ...>
> > > 17972 <... read resumed> 0x804dc80, 512) = -1 EIO (Input/output error)
> > > 
> > > given the device reports "60801 512-byte hardware sectors (31 MB)"
> > > and "31129600/512 == 60800"...it's obvious vol_id is trying to read
> > > the last sector on the disk (I assume it's to verify the size).
> > > ISTR "reading the last sector" caused problems else where.
> > > I'll try to hunt that down.
> > 
> > If this is the problem, it ought to be reproducible without vol_id by
> > doing
> > 
> > dd bs=512b if=/dev/<dev> of=/dev/null seek=60800 count=1
> 
> root@mb500:~ # dd bs=512b if=/dev/sda of=/dev/null seek=60800 count=1
> 1+0 records in
> 1+0 records out
> 262144 bytes (262 kB) copied, 0.433933 seconds, 604 kB/s
> 
> but since 512B is the default (I thought), I tried:
> root@mb500:~ # dd if=/dev/sda of=/dev/null seek=60800 count=1
> 1+0 records in
> 1+0 records out
> 512 bytes (512 B) copied, 0.0239289 seconds, 21.4 kB/s
> 
> and got different output....wth?
> 
> Oh...and you mean "skip", not "seek"...no wonder that worked.
> 
> root@mb500:~ # strace -o strace-dd-HPr707.out dd if=/dev/sda of=/dev/null skip=60800 count=1
> dd: reading `/dev/sda': Input/output error
> 0+0 records in
> 0+0 records out
> 0 bytes (0 B) copied, 55.7303 seconds, 0.0 kB/s
> 
> 
> dmesg output:
> Jan 19 19:08:12 localhost kernel: usb 1-1.1.4: reset full speed USB device using uhci_hcd and address 8
> Jan 19 19:08:37 localhost last message repeated 3 times
> Jan 19 19:08:37 localhost kernel: sd 3:0:0:0: scsi: Device offlined - not ready after error recovery
> Jan 19 19:08:37 localhost kernel: sd 3:0:0:0: [sda] Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK,SUGGEST_OK
> Jan 19 19:08:37 localhost kernel: end_request: I/O error, dev sda, sector 60800
> 
> 
> > There is a READ_CAPACITY bug where incompetent usb vendors misread the
> > SCSI standard and actually report one sector more than the actual
> > capacity (and crash when this is accessed), but let's verify first.
> 
> This seems to be exactly the case.
> What's the work around?

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

  parent reply	other threads:[~2008-01-20  4:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-19 17:45 udev hangs USB-storage (HP r707 camera) Grant Grundler
2008-01-20  0:53 ` Stefan Richter
2008-01-20  2:28   ` Grant Grundler
2008-01-20  2:56     ` James Bottomley
     [not found]       ` <1200797791.11214.3.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-01-20  3:10         ` Grant Grundler
     [not found]           ` <20080120031008.GI11553-lGaJ6EKWmV+kGg0756fqLw@public.gmane.org>
2008-01-20  3:12             ` Grant Grundler
2008-01-20  4:11             ` James Bottomley [this message]
2008-01-20  5:25               ` [PATCH] [2.6.23.13] " Grant Grundler
     [not found]                 ` <20080120052553.GA5452-lGaJ6EKWmV+kGg0756fqLw@public.gmane.org>
2008-01-23  5:27                   ` [linux-usb-devel] " Phil Dibowitz
2008-01-23  6:55                     ` Grant Grundler
2008-01-23  7:02                       ` [linux-usb-devel] " Grant Grundler
2008-01-23  8:50                         ` Phil Dibowitz
2008-01-24  5:55                         ` [linux-usb-devel] " Phil Dibowitz
     [not found]     ` <20080120022829.GG11553-lGaJ6EKWmV+kGg0756fqLw@public.gmane.org>
2008-01-20  2:57       ` Grant Grundler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1200802265.11214.8.camel@localhost.localdomain \
    --to=james.bottomley-d9phhud1jfjcxq6kfmz53/egyhegw8jk@public.gmane.org \
    --cc=grundler-6jwH94ZQLHl74goWV3ctuw@public.gmane.org \
    --cc=linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=stefanr-MtYdepGKPcBMYopoZt5u/LNAH6kLmebB@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).