Linux MIPS Architecture development
 help / color / mirror / Atom feed
* Problems writing to USB devices
@ 2007-10-17  8:08 Giuseppe Sacco
  2007-10-17 13:14 ` J. Scott Kasten
  0 siblings, 1 reply; 3+ messages in thread
From: Giuseppe Sacco @ 2007-10-17  8:08 UTC (permalink / raw)
  To: linux-mips

Hi all,
I am still testing new kernels on the ip32 platform (and learning kernel structure :-)). Currently I found problems in writing to USB block devices. I may read from a pendrive without problem, but when I try to write the process stop.
This is the last part of a transcript of strace output for "pvcreate /dev/sdc" command:

[...]
open("/dev/sdc", O_RDWR|O_EXCL|O_LARGEFILE|O_NOATIME) = 4
fstat64(4, {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 32), ...}) = 0
ioctl(4, BLKFLSBUF, 0)                  = 0
close(4)                                = 0
open("/dev/sdc", O_RDONLY|O_LARGEFILE)  = 4
ioctl(4, BLKGETSIZE64, 0x7fbe2260)      = 0
close(4)                                = 0
stat64(0x4e6f00, 0x7fbe2090)            = 0
stat64(0x4e6f00, 0x7fbe2178)            = 0
open("/dev/sdc", O_RDWR|O_LARGEFILE|O_NOATIME) = 4
fstat64(4, {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 32), ...}) = 0
ioctl(4, BLKFLSBUF, 0)                  = 0
ioctl(4, BLKBSZGET, 0x4e6d18)           = 0
_llseek(4, 524222464, [524222464], SEEK_SET) = 0
read(4, "\307^\277\322\244R\36L\252\362G\\\366\3674\310@`K\374\373"..., 4096) = 4096
close(4)                                = 0
stat64(0x7fbe3edd, 0x7fbe21c8)          = 0
open("/dev/urandom", O_RDONLY|O_LARGEFILE) = 4
read(4, "m\v\205x\374S\374\6\347\222MJGPJ|\"\300\207\376\323r\270"..., 32) = 32
close(4)                                = 0
open("/dev/sdc", O_RDONLY|O_LARGEFILE)  = 4
ioctl(4, BLKGETSIZE64, 0x4efbb8)        = 0
close(4)                                = 0
stat64(0x4e6f00, 0x7fbe0fb0)            = 0
stat64(0x4e6f00, 0x7fbe1098)            = 0
open("/dev/sdc", O_RDWR|O_LARGEFILE|O_NOATIME) = 4
fstat64(4, {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 32), ...}) = 0
ioctl(4, BLKFLSBUF, 0)                  = 0
ioctl(4, BLKBSZGET, 0x4e6d18)           = 0
_llseek(4, 4096, [4096], SEEK_SET)      = 0
read(4, "\1\7\2\7\3\7\4\7\5\7\6\7\7\7\10\7\t\7\n\7\v\7\f\7\r\7\16"..., 4096) = 4096
_llseek(4, 4096, [4096], SEEK_SET)      = 0
write(4, "\0\7\2\7\3\7\4\7\5\7\6\7\7\7\10\7\t\7\n\7\v\7\f\7\r\7\16"..., 4096) = 4096
ioctl(4, BLKFLSBUF

The process hung during ioctl(4,BLKFLSBUF,0), but this very ioctl is issued successfully many times during the process. This time the iocl is done just after the first "write()", so I think the problem is in the write() command.

I have the same problem writing a new mbr (with fdisk or cfdisk) on this device: the device will not be changed at all.

Any ideas on what to check?

Thanks (again),
Giuseppe

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problems writing to USB devices
  2007-10-17  8:08 Problems writing to USB devices Giuseppe Sacco
@ 2007-10-17 13:14 ` J. Scott Kasten
  2007-10-17 14:31   ` Giuseppe Sacco
  0 siblings, 1 reply; 3+ messages in thread
From: J. Scott Kasten @ 2007-10-17 13:14 UTC (permalink / raw)
  To: Giuseppe Sacco; +Cc: linux-mips


On Wed, 17 Oct 2007, Giuseppe Sacco wrote:

> Hi all, I am still testing new kernels on the ip32 platform (and 
> learning kernel structure :-)). Currently I found problems in writing to 
> USB block devices. I may read from a pendrive without problem, but when 
> I try to write the process stop. This is the last part of a transcript 
> of strace output for "pvcreate /dev/sdc" command:
>

A few questions...

* Which USB card, or more precisely, which chipset is on the USB card you 
picked?

I've had great luck with NEC and ALI chips thus far.

* Which driver was loaded for the USB controller, OHCI, UHCI, EHCI?

If you have a USB 2.0 controller, the system will probably try to load 
both EHCI and UHCI.  I did run into problems there, for one, the system 
crashed when I pulled the thumb drive out.  It sometimes behaved strangely 
when it was in.  I eventually figured out that removing UHCI and running 
EHCI only was the solution for me.  The UHCI module seemed to be probing 
the hardware incorrectly.  It was reporting 6 ports on the bridge when 
there were only 2.  The EHCI module was reporting the correct number as I 
recall.  Once it was EHCI only, I've never had a problem since.

That was originally under 2.6.17 from gentoo.  I've since been using the 
debian patched 2.6.18.  I'm afraid I haven't yet reached sufficient 
motivation to move into the 20's like the rest of you.  I tend to like my 
box working...  :)  Just joking.....it's on the todo list.

-S-

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problems writing to USB devices
  2007-10-17 13:14 ` J. Scott Kasten
@ 2007-10-17 14:31   ` Giuseppe Sacco
  0 siblings, 0 replies; 3+ messages in thread
From: Giuseppe Sacco @ 2007-10-17 14:31 UTC (permalink / raw)
  To: linux-mips

Il giorno mer, 17/10/2007 alle 09.14 -0400, J. Scott Kasten ha scritto:
> On Wed, 17 Oct 2007, Giuseppe Sacco wrote:
> 
> > Hi all, I am still testing new kernels on the ip32 platform (and 
> > learning kernel structure :-)). Currently I found problems in writing to 
> > USB block devices. I may read from a pendrive without problem, but when 
> > I try to write the process stop. This is the last part of a transcript 
> > of strace output for "pvcreate /dev/sdc" command:
> >
> 
> A few questions...
> 
> * Which USB card, or more precisely, which chipset is on the USB card you 
> picked?
> 
> I've had great luck with NEC and ALI chips thus far.

giuseppe@sgi:~$ (lspci;lspci -n)| sort | grep ^01.08.02
01:08.2 0c03: 1033:00e0 (rev 04)
01:08.2 USB Controller: NEC Corporation USB 2.0 (rev 04)

> * Which driver was loaded for the USB controller, OHCI, UHCI, EHCI?

giuseppe@sgi:~$ lsusb
Bus 003 Device 001: ID 0000:0000  
Bus 002 Device 001: ID 0000:0000  
Bus 001 Device 003: ID 067b:2517 Prolific Technology, Inc. Flash Disk Mass Storage Device
Bus 001 Device 002: ID 067b:2515 Prolific Technology, Inc. Flash Disk Embedded Hub
Bus 001 Device 001: ID 0000:0000

giuseppe@sgi:~$ dmesg | grep 0000:01:08
PCI: Enabling device 0000:01:08.2 (0000 -> 0002)
ehci_hcd 0000:01:08.2: EHCI Host Controller
ehci_hcd 0000:01:08.2: new USB bus registered, assigned bus number 1
ehci_hcd 0000:01:08.2: irq 15, io mem 0x280003000
ehci_hcd 0000:01:08.2: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004

So, I think that PCI device 0000:01:08.2 is managed by ehci and its
assigned USB bus #001.

Bye,
Giuseppe

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-17 14:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-17  8:08 Problems writing to USB devices Giuseppe Sacco
2007-10-17 13:14 ` J. Scott Kasten
2007-10-17 14:31   ` Giuseppe Sacco

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox