View Full Version : USB and cam system bug?
Seeker
December 14th, 2009, 20:53
# ll /dev/da*
ls: No match.
Now, I plug into USB port my mobile phone(File Transfer mode).
# camcontrol devlist
<SEMC Int.Memory 0000> at scbus0 target 0 lun 0 (da0,pass0)
<SEMC Mem-Stick 0000> at scbus1 target 0 lun 0 (da1,pass1)
# ll /dev/da*
crw-r----- 1 root operator - 0, 147 Dec 14 20:37:26 2009 /dev/da0
crw-r----- 1 root operator - 0, 149 Dec 14 20:37:27 2009 /dev/da1
For mounting, there should be /dev/da1s1 listed, but it is not.
"Something" made it ready/loaded, as I did:
# camcontrol load da1
In /etc/rc.conf:
hald_enable="YES"
dbus_enable="YES"
Now in order to get /dev/da1s1 listed
# camcontrol rescan all
Re-scan of bus 0 was successful
Re-scan of bus 1 was successful
# ll /dev/da*
crw-r----- 1 root operator - 0, 147 Dec 14 20:37:26 2009 /dev/da0
crw-r----- 1 root operator - 0, 149 Dec 14 20:37:27 2009 /dev/da1
Still nothing...
So I do this:
# mount -t msdosfs -o -m=600,-M=700 /dev/da1s1 ~/mobile
mount_msdosfs: /dev/da1s1: No such file or directory
Now watch this!
Excluding slice 1
# mount -t msdosfs -o -m=600,-M=700 /dev/da1 ~/mobile
mount_msdosfs: /dev/da1: Invalid argument
Exactly command above, made /dev/da1s1 to appear
# ll /dev/da*
crw-r----- 1 root operator - 0, 147 Dec 14 20:37:26 2009 /dev/da0
crw-r----- 1 root operator - 0, 149 Dec 14 20:37:27 2009 /dev/da1
crw-r----- 1 root operator - 0, 150 Dec 14 20:46:21 2009 /dev/da1s1
Now I can do:
# mount -t msdosfs -o -m=600,-M=700 /dev/da1s1 ~/mobile
And Voila!
Is this a bug?
jb_fvwm2
December 15th, 2009, 04:26
Maybe explained by my post and others in the thread Nov 2008.
"Can't mount usb flash drive"
(desktop usage >> Multimedia subforum(s).)
Seeker
December 15th, 2009, 14:43
I disagree with you.
Those post are nothing but a trial and error attempts, with no final solution.
I will be very simple. Concentrate on this:
When I plugin USB device, I want it to immidieatly show as:
# ll /dev/da*
crw-r----- 1 root operator - 0, 147 Dec 14 20:37:26 2009 /dev/da0
crw-r----- 1 root operator - 0, 150 Dec 14 20:46:21 2009 /dev/da0s1
crw-r----- 1 root operator - 0, 149 Dec 14 20:37:27 2009 /dev/da1
crw-r----- 1 root operator - 0, 150 Dec 14 20:46:21 2009 /dev/da1s1
insetad of current:
# ll /dev/da*
crw-r----- 1 root operator - 0, 147 Dec 14 20:37:26 2009 /dev/da0
crw-r----- 1 root operator - 0, 149 Dec 14 20:37:27 2009 /dev/da1
pbd
December 15th, 2009, 15:05
(My 8.0-RELEASE does exactly the same with HTC Dream/T-mobile G1.)
Beastie
December 15th, 2009, 15:13
Could be a bug or a regression. Did it behave similarly on 7.x or you have only tried 8.0?
Also, I'm just curious. Why do you enable HAL if you want to manually mount the device? Isn't HAL usually used to auto-detect and auto-mount devices?
pbd
December 15th, 2009, 15:22
Could be a bug or a regression. Did it behave similarly on 7.x or you have only tried 8.0?
I have tried on 7.1-RELEASE-p8: it's the same.
Seeker
December 15th, 2009, 17:32
I use hal because other ports need it(ie: Xorg). Not because this exact case.
It sucks a big time, a fact, that you first have to intentionally cause an error, with attempt to mount device itself in order for device to be rescanned by OS and to properly show device's slices in /dev
jb_fvwm2
December 15th, 2009, 20:47
I recollect one of the moderators on this or
daemonforums.org explaining it better.
aragon
December 15th, 2009, 22:36
Has someone filed a PR?
Seeker
December 16th, 2009, 16:53
I did not. ;)
Actually..., I've never done such a thing, so I have no experience with it.
If someone did, than post a link to it, so we could track a progress.
aragon
December 16th, 2009, 21:17
It's best if someone who can reproduce the bug logs the PR...
crsd
December 16th, 2009, 21:50
Does stopping hald solve the problem?
Seeker
December 17th, 2009, 00:23
I booted without hald.
It didn't affect issue in any way, except that mouse worked in default console, but not when I started X.
I must notice that after a reebot, with usb memory leaved plugged in, all devices were properly showed with theirs slices in /dev/da*
This type of scan is obviously not initiated when usb is plugged in afterwords.
Beastie
December 17th, 2009, 00:42
You aren't connecting indirectly through an external USB hub, are you?
Seeker
December 17th, 2009, 01:32
No, I simply plug it in a usb slot on my midi case
Beastie
December 17th, 2009, 10:54
And other devices such as mice or pendrives work fine?
tingo
December 17th, 2009, 12:02
No, I simply plug it in a usb slot on my midi case
Frontend ports by any chance? If so, try the ports on the back of the case also. I have seen some motherboards where the front / back usb ports worked differently.
Beastie
December 17th, 2009, 12:51
That's why I'm asking the above question. These may all be connected to 1 root hub only. You may check the MoBo diagrams, but I thought plugging a pendrive or mouse in was easier.
Seeker
December 17th, 2009, 15:19
In a back of a case are 4 usb slots.(directly on a MB)
In front of a case are 2 usb slots.(wired to MB)
usb mouse and this mem are always plugged in front case usb slots.
Now I've attached mem in a back of a case.
Nothing changed.
Seeker
December 18th, 2009, 16:11
I tried it on a laptop and all is same.
Here are some sys messages
da1 at umass-sim1 bus 1 scbus1 target 0 lun 0
da1: <SEMC Mem-Stick 0000> Removable Direct Access SCSI-0 device
da1: 1.000MB/s transfers
da1: Attempt to query device size failed: NOT READY, Medium not present
And more when mounting
GEOM: da1: partition 1 does not start on a track boundary.
GEOM: da1: partition 1 does not end on a track boundary.
Beastie
December 18th, 2009, 17:40
Then destroy the slices, recreate them and do a newfs.
Seeker
December 18th, 2009, 18:04
But this is a mobile phone.
I simply bought it formatted "as is".
Factory did this.
Seeker
December 21st, 2009, 11:02
But this doesn't explain, why is all properly displayed/detected, if USB device is attached prior to booting.
If I attach USB device afterwards, then I have to initiate an error, in order to get a properly displayed/detected devices/slices
aragon
December 21st, 2009, 13:23
My phone also formats its memory card with no regard to cylinder boundaries, but I don't have this problem...
Seeker
January 5th, 2010, 01:40
But this doesn't explain, why is all properly displayed/detected, if USB device is attached prior to booting.
If I attach USB device afterwards, then I have to initiate an error, in order to get a properly displayed/detected devices/slices
...
da0 at umass-sim0 bus 0 scbus0 target 0 lun 0
da0: <SEMC Int.Memory 0000> Removable Direct Access SCSI-0 device
da0: 1.000MB/s transfers
da0: Attempt to query device size failed: NOT READY, Medium not present
(probe1:umass-sim1:1:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0
(probe1:umass-sim1:1:0:0): CAM Status: SCSI Status Error
(probe1:umass-sim1:1:0:0): SCSI Status: Check Condition
(probe1:umass-sim1:1:0:0): UNIT ATTENTION asc:29,0
(probe1:umass-sim1:1:0:0): Power on, reset, or bus device reset occurred
(probe1:umass-sim1:1:0:0): Retrying Command (per Sense Data)
(probe1:umass-sim1:1:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0
(probe1:umass-sim1:1:0:0): CAM Status: SCSI Status Error
(probe1:umass-sim1:1:0:0): SCSI Status: Check Condition
(probe1:umass-sim1:1:0:0): NOT READY asc:3a,0
(probe1:umass-sim1:1:0:0): Medium not present
(probe1:umass-sim1:1:0:0): Unretryable error
da1 at umass-sim1 bus 1 scbus1 target 0 lun 0
da1: <SEMC Mem-Stick 0000> Removable Direct Access SCSI-0 device
da1: 1.000MB/s transfers
da1: Attempt to query device size failed: NOT READY, Medium not present
can't re-use a leaf (minimum_cmd_size)!
ugen4.2: <Sony Ericsson> at usbus4 (disconnected)
umass0: at uhub4, port 2, addr 2 (disconnected)
(da0:umass-sim0:0:0:0): lost device
(da0:umass-sim0:0:0:0): removing device entry
umass1: at uhub4, port 2, addr 2 (disconnected)
(da1:umass-sim1:1:0:0): lost device
(da1:umass-sim1:1:0:0): removing device entry
What does this tell you?
Any indication to this issue?
Seeker
January 6th, 2010, 19:42
Ok guys, I've just destroyed the slices, recreate them and did a newfs_msdos FAT16, then restored data and NADA! :(
I guess it is time for filling a pr.
jb_fvwm2
January 6th, 2010, 21:27
Have you loaded ehci.ko? (Useful in v8 vs v7). If
that helps.
Seeker
January 6th, 2010, 21:39
Have you loaded ehci.ko? (Useful in v8 vs v7). If
that helps.
I can't load it. :P
# kldstat
Id Refs Address Size Name
1 24 0xc0400000 b7abe0 kernel
2 1 0xc0f7b000 1a60 accf_data.ko
3 1 0xc0f7d000 2534 accf_http.ko
4 1 0xc0f80000 2030 wlan_xauth.ko
5 1 0xc46c4000 3000 pflog.ko
6 1 0xc46c7000 35000 pf.ko
7 1 0xc4983000 e000 fuse.ko
8 2 0xc4aa4000 7a000 osscore.ko
9 1 0xc4b2a000 6000 oss_audigyls.ko
10 1 0xc4c93000 68000 radeon.ko
11 1 0xc4cfb000 14000 drm.ko
# kldload ehci
kldload: can't load ehci: File exists
# locate ehci.ko
/boot/kernel/ehci.ko
/boot/kernel/ehci.ko.symbols
richardpl
January 6th, 2010, 21:59
Is this because hald and dbus are enabled?
Seeker
January 6th, 2010, 22:03
Some ports depend on it.
I'll disable them.
Seeker
January 7th, 2010, 00:42
I disabled hald and dbus and even moused(strange that my usb mouse works in console).
I still can't kldload ehci
crsd
January 7th, 2010, 00:51
# kldload ehci
kldload: can't load ehci: File exists
means that ehci is already built in kernel. You can check it using kldstat -v | grep ehci
I disabled hald and dbus and even moused(strange that my usb mouse works in console).
/usr/sbin/moused is started by devd upon USB mouse attach (and is killed on detach). You can check /etc/devd.conf, line with device-name "ums[0-9]+";
Seeker
January 7th, 2010, 01:40
# kldload ehci
kldload: can't load ehci: File exists
means that ehci is already built in kernel. You can check it using kldstat -v | grep ehci
Yeah! ;)
# kldstat -v | grep ehci
280 ehci/usbus
275 pci/ehci
/usr/sbin/moused is started by devd upon USB mouse attach (and is killed on detach). You can check /etc/devd.conf, line with device-name "ums[0-9]+";
Aaaaa... :stud
And I've been asking, what initiates:
# ps -U root | grep moused
675 ?? Is 0:02.34 /usr/sbin/moused -p /dev/ums0 -t auto -I /var/run/moused.ums0.pid
So I need moused_enable="YES", only for PS/2 mouses? ;)
Seeker
January 28th, 2010, 08:59
Just to say that all this post is based on my mobile phone, which I attach to USB and am using it as a USB memory.
Yesterday, I plugged in real USB memory stick and slice was immediately recognized.
That is..., it worked as I want my mobile phone, to work.
Seeker
February 13th, 2010, 01:04
Ok, this is state, which I achieve when I leave mobile phone plugged in and reboot:
http://www.starforce.biz/LOAD_boot.txt
And this is state from this post when I plug in already booted system:
http://www.starforce.biz/LOAD_after_boot.txt
Seeker
February 15th, 2010, 20:26
GUYS!
Point is that link 1, contains a SOLUTION, as all slices are recognized and listed properly.
So boot time code DOES SOMETHING, that after boot procedure DOESN'T DO.
Which cmd, I need to execute in order to have a same effect from first link, that is..., to have slices recognized, too?
mav@
February 15th, 2010, 22:39
I've recently merged some potentially related CAM code to 8-STABLE. So it can be a good time to update.
Other option - it can be hardware issue. Phone reports that it has no media inserted. Probably when plugged after boot it is probed faster, that possible gives phone not enough time to initialize. You may try `false > /dev/da0` command after attach to trigger media re-taste.
Seeker
February 16th, 2010, 00:10
O no! I had enough of STABLE, for whole my life! :P
# false > /dev/da0
# false > /dev/da1
Worked quietly and flawlessly!
Thx! :)
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.