2004-10-30 02:22:26

by Paulo da Silva

[permalink] [raw]
Subject: k 2.6.9: ub module causes /dev/sda and /dev/sda1 not being created

I had problems with my pen drive.
Module ub (autolodaded) recognized the pendrive. So /dev/sda
and /dev/sda1 didn't get created. After removing ub module
from kernel config I could mount the pen drive as /dev/sda1.


2004-10-30 10:23:34

by Pasi Savolainen

[permalink] [raw]
Subject: Re: k 2.6.9: ub module causes /dev/sda and /dev/sda1 not being created

* Paulo da Silva <[email protected]>:
> I had problems with my pen drive.
> Module ub (autolodaded) recognized the pendrive. So /dev/sda
> and /dev/sda1 didn't get created. After removing ub module
> from kernel config I could mount the pen drive as /dev/sda1.

Yes, that bit me with CF card reader too. AFAICS The Right Solution is
to create /dev/ub -devices and use them.

Following worked for me:
- -
mknod /dev/uba b 125 0
mknod /dev/uba1 b 125 1
mknod /dev/uba2 b 125 2
mknod /dev/ubb b 125 8
mknod /dev/ubb1 b 125 9
mknod /dev/ubb2 b 125 10
mknod /dev/ubc b 125 16
mknod /dev/ubc1 b 125 17
mknod /dev/ubc2 b 125 18
- -

/dev/sda1 becomes /dev/uba1 etc.

There is a notion that 125 -major number will be going away?:
<https://lists.one-eyed-alien.net/pipermail/usb-storage/2004-August/000709.html>


--
Psi -- <http://www.iki.fi/pasi.savolainen>

2004-10-30 16:18:35

by Pete Zaitcev

[permalink] [raw]
Subject: Re: k 2.6.9: ub module causes /dev/sda and /dev/sda1 not being created

On Sat, 30 Oct 2004 03:19:41 +0100, Paulo da Silva <[email protected]> wrote:

> I had problems with my pen drive.
> Module ub (autolodaded) recognized the pendrive. So /dev/sda
> and /dev/sda1 didn't get created. After removing ub module
> from kernel config I could mount the pen drive as /dev/sda1.

This is intentional. The ub takes over certain functions of usb-storage
when it is configured in. Is it a problem? If yes, why?

-- Pete

2004-10-30 21:41:03

by Adam Sampson

[permalink] [raw]
Subject: Re: k 2.6.9: ub module causes /dev/sda and /dev/sda1 not being created

Pete Zaitcev <[email protected]> writes:

> This is intentional. The ub takes over certain functions of usb-storage
> when it is configured in. Is it a problem? If yes, why?

This happened to me too.

If you build both ub and usb_storage as modules and only load
usb_storage, then you can't use USB Storage devices any more:
usb_storage doesn't get attached to them (you end up with Driver=none
in /proc/bus/usb/devices). Since ub doesn't appear work with my
unbranded el-cheapo card reader, I wasn't able to use it until I
removed ub from my kernel config and rebuilt.

A friend's got a USB hard disk, and has the same problem with
usb_storage not getting used any more; I don't think he's tried ub
yet, but it's clearly the wrong thing to use for the job anyway.

This is how my card reader appears in /proc/bus/usb/devices with only
usb_storage built as a module:

T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 35 Spd=12 MxCh= 0
D: Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0d7d ProdID=0240 Rev= 1.00
S: Manufacturer=
S: Product=USB Reader
S: SerialNumber=FF0390500928
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=83(I) Atr=03(Int.) MxPS= 2 Ivl=1ms

And these are the errors that I got from ub when trying to mount a
card:

Wed Oct 27 19:54:27 2004 warning: ub: sizeof ub_scsi_cmd 60 ub_dev 924
Wed Oct 27 19:54:27 2004 info: uba: device 3 capacity nsec 50 bsize 512
Wed Oct 27 19:54:27 2004 warning: uba: made changed
Wed Oct 27 19:54:27 2004 info: uba: device 3 capacity nsec 50 bsize 512
Wed Oct 27 19:54:27 2004 info: uba: device 3 capacity nsec 50 bsize 512
Wed Oct 27 19:54:27 2004 info: uba:end_request: I/O error, dev uba, sector 0
Wed Oct 27 19:54:27 2004 err: Buffer I/O error on device uba, logical block 0
Wed Oct 27 19:54:27 2004 warning: end_request: I/O error, dev uba, sector 2
Wed Oct 27 19:54:27 2004 err: Buffer I/O error on device uba, logical block 1
Wed Oct 27 19:54:27 2004 warning: end_request: I/O error, dev uba, sector 4
Wed Oct 27 19:54:27 2004 err: Buffer I/O error on device uba, logical block 2
Wed Oct 27 19:54:27 2004 warning: end_request: I/O error, dev uba, sector 6
Wed Oct 27 19:54:27 2004 err: Buffer I/O error on device uba, logical block 3
Wed Oct 27 19:54:27 2004 warning: end_request: I/O error, dev uba, sector 6
Wed Oct 27 19:54:27 2004 err: Buffer I/O error on device uba, logical block 3
Wed Oct 27 19:54:27 2004 warning: end_request: I/O error, dev uba, sector 4
Wed Oct 27 19:54:27 2004 err: Buffer I/O error on device uba, logical block 2
Wed Oct 27 19:54:27 2004 warning: end_request: I/O error, dev uba, sector 2
Wed Oct 27 19:54:27 2004 err: Buffer I/O error on device uba, logical block 1
Wed Oct 27 19:54:27 2004 warning: end_request: I/O error, dev uba, sector 0
Wed Oct 27 19:54:27 2004 err: Buffer I/O error on device uba, logical block 0
Wed Oct 27 19:54:27 2004 warning: unable to read partition table
Wed Oct 27 19:54:27 2004 info: uba:end_request: I/O error, dev uba, sector 2
Wed Oct 27 19:54:27 2004 err: Buffer I/O error on device uba, logical block 1
Wed Oct 27 19:54:27 2004 warning: end_request: I/O error, dev uba, sector 4
Wed Oct 27 19:54:27 2004 err: Buffer I/O error on device uba, logical block 2
Wed Oct 27 19:54:27 2004 warning: end_request: I/O error, dev uba, sector 6
Wed Oct 27 19:54:27 2004 err: Buffer I/O error on device uba, logical block 3
Wed Oct 27 19:54:27 2004 warning: end_request: I/O error, dev uba, sector 0
Wed Oct 27 19:54:27 2004 err: Buffer I/O error on device uba, logical block 0
Wed Oct 27 19:54:27 2004 warning: unable to read partition table
Wed Oct 27 19:54:27 2004 info: usbcore: registered new driver ub
Wed Oct 27 19:55:27 2004 warning: uba: made changed
Wed Oct 27 19:55:27 2004 info: uba: device 3 capacity nsec 50 bsize 512
Wed Oct 27 19:55:27 2004 info: uba: device 3 capacity nsec 50 bsize 512
Wed Oct 27 19:55:27 2004 info: uba:end_request: I/O error, dev uba, sector 2
Wed Oct 27 19:55:27 2004 err: Buffer I/O error on device uba, logical block 1
Wed Oct 27 19:55:27 2004 warning: end_request: I/O error, dev uba, sector 4
Wed Oct 27 19:55:27 2004 err: Buffer I/O error on device uba, logical block 2
Wed Oct 27 19:55:27 2004 warning: end_request: I/O error, dev uba, sector 6
Wed Oct 27 19:55:27 2004 err: Buffer I/O error on device uba, logical block 3
Wed Oct 27 19:55:27 2004 warning: end_request: I/O error, dev uba, sector 0
Wed Oct 27 19:55:27 2004 err: Buffer I/O error on device uba, logical block 0
Wed Oct 27 19:55:27 2004 warning: end_request: I/O error, dev uba, sector 2
Wed Oct 27 19:55:27 2004 err: Buffer I/O error on device uba, logical block 1
Wed Oct 27 19:55:27 2004 warning: end_request: I/O error, dev uba, sector 4
Wed Oct 27 19:55:27 2004 err: Buffer I/O error on device uba, logical block 2
(etc.; lots more "Buffer I/O error" lines)

--
Adam Sampson <[email protected]> <http://offog.org/>

2004-10-31 22:11:35

by Fabio Coatti

[permalink] [raw]
Subject: Re: k 2.6.9: ub module causes /dev/sda and /dev/sda1 not being created

Alle 18:15, sabato 30 ottobre 2004, Pete Zaitcev ha scritto:
> On Sat, 30 Oct 2004 03:19:41 +0100, Paulo da Silva <[email protected]>
wrote:
> > I had problems with my pen drive.
> > Module ub (autolodaded) recognized the pendrive. So /dev/sda
> > and /dev/sda1 didn't get created. After removing ub module
> > from kernel config I could mount the pen drive as /dev/sda1.
>
> This is intentional. The ub takes over certain functions of usb-storage
> when it is configured in. Is it a problem? If yes, why?

Maybe this is not a problem, but it's supposed that a /dev/uba1 is created,
after /dev/uba, instead of sdaX? well, on my system uba is created but
not /dev/uba1, and I've reported below a syslog excerpt for usb flash
pendrive; after that is still possible to mknod a uba1 device, and access the
pendrive, but after the pendrive is removed I get an oops and then usb layer
stops to work.

Insertion:

(linux 2.6.10-rc1-mm1, but seen also in 2.6.9-mm1 and 2.6.9-rc4-mm1)
Oct 28 00:32:22 kefk kernel: ehci_hcd 0000:00:1d.7: GetStatus port 3 status
001803 POWER sig=j CSC CONNECT
Oct 28 00:32:22 kefk kernel: hub 5-0:1.0: port 3, status 0501, change 0001,
480 Mb/s
Oct 28 00:32:22 kefk kernel: hub 5-0:1.0: debounce: port 3: total 100ms stable
100ms status 0x501
Oct 28 00:32:22 kefk kernel: ehci_hcd 0000:00:1d.7: port 3 high speed
Oct 28 00:32:22 kefk kernel: ehci_hcd 0000:00:1d.7: GetStatus port 3 status
001005 POWER sig=se0 PE CONNECT
Oct 28 00:32:22 kefk kernel: usb 5-3: new high speed USB device using ehci_hcd
and address 4
Oct 28 00:32:22 kefk kernel: ehci_hcd 0000:00:1d.7: port 3 high speed
Oct 28 00:32:22 kefk kernel: ehci_hcd 0000:00:1d.7: GetStatus port 3 status
001005 POWER sig=se0 PE CONNECT
Oct 28 00:32:22 kefk kernel: usb 5-3: ep0 maxpacket = 64
Oct 28 00:32:22 kefk kernel: usb 5-3: new device strings: Mfr=1, Product=2,
SerialNumber=3
Oct 28 00:32:22 kefk kernel: usb 5-3: default language 0x0409
Oct 28 00:32:22 kefk kernel: usb 5-3: Product: Mass storage
Oct 28 00:32:22 kefk kernel: usb 5-3: Manufacturer: USB
Oct 28 00:32:22 kefk kernel: usb 5-3: SerialNumber: 142E19413C2FCA34
Oct 28 00:32:22 kefk kernel: usb 5-3: hotplug
Oct 28 00:32:22 kefk kernel: usb 5-3: adding 5-3:1.0 (config #1, interface 0)
Oct 28 00:32:22 kefk kernel: usb 5-3:1.0: hotplug
Oct 28 00:32:22 kefk kernel: ub: sizeof ub_scsi_cmd 64 ub_dev 964
Oct 28 00:32:22 kefk kernel: ub 5-3:1.0: usb_probe_interface
Oct 28 00:32:22 kefk kernel: ub 5-3:1.0: usb_probe_interface - got id
Oct 28 00:32:22 kefk kernel: uba: device 4 capacity nsec 50 bsize 512
Oct 28 00:32:22 kefk kernel: uba: made changed
Oct 28 00:32:22 kefk kernel: uba: device 4 capacity nsec 1024000 bsize 512
Oct 28 00:32:22 kefk kernel: uba: device 4 capacity nsec 1024000 bsize 512
Oct 28 00:32:22 kefk kernel: uba: uba1
Oct 28 00:32:22 kefk kernel: uba: uba1
Oct 28 00:32:22 kefk kernel: kobject_register failed for uba1 (-17)
Oct 28 00:32:22 kefk kernel: [<c01f1fd7>] kobject_register+0x51/0x5f
Oct 28 00:32:22 kefk kernel: [<c0184720>] add_partition+0xbb/0xf0
Oct 28 00:32:22 kefk kernel: [<c0184898>] register_disk+0xee/0x11d
Oct 28 00:32:22 kefk kernel: [<c024ba2e>] add_disk+0x36/0x41
Oct 28 00:32:22 kefk kernel: [<c024b9e4>] exact_match+0x0/0x7
Oct 28 00:32:22 kefk kernel: [<c024b9eb>] exact_lock+0x0/0xd
Oct 28 00:32:22 kefk kernel: [<f8b3ce70>] ub_probe+0x291/0x2f4 [ub]
Oct 28 00:32:22 kefk kernel: [<c02981e6>] usb_probe_interface+0xb8/0xe1
Oct 28 00:32:22 kefk kernel: [<c02435a8>] bus_match+0x32/0x6a
Oct 28 00:32:22 kefk kernel: [<c02436d0>] driver_attach+0x46/0x85
Oct 28 00:32:22 kefk kernel: [<c01f1fa8>] kobject_register+0x22/0x5f
Oct 28 00:32:22 kefk kernel: [<c0243b34>] bus_add_driver+0x91/0xcb
Oct 28 00:32:22 kefk kernel: [<c02982b8>] usb_register+0x49/0x9f
Oct 28 00:32:22 kefk kernel: [<f89ad03f>] ub_init+0x3f/0x5f [ub]
Oct 28 00:32:22 kefk kernel: [<c0131dfb>] sys_init_module+0x160/0x246
Oct 28 00:32:22 kefk kernel: [<c0103d69>] sysenter_past_esp+0x52/0x71
Oct 28 00:32:22 kefk kernel: usbcore: registered new driver ub

Removal:

Oct 28 00:32:33 kefk kernel: ehci_hcd 0000:00:1d.7: GetStatus port 3 status
001002 POWER sig=se0 CSC
Oct 28 00:32:33 kefk kernel: hub 5-0:1.0: port 3, status 0100, change 0001, 12
Mb/s
Oct 28 00:32:33 kefk kernel: usb 5-3: USB disconnect, address 4
Oct 28 00:32:33 kefk kernel: usb 5-3: usb_disable_device nuking all URBs
Oct 28 00:32:33 kefk kernel: usb 5-3: unregistering interface 5-3:1.0
Oct 28 00:32:33 kefk kernel: Unable to handle kernel NULL pointer dereference
at virtual address 00000050
Oct 28 00:32:33 kefk kernel: printing eip:
Oct 28 00:32:33 kefk kernel: c0186373
Oct 28 00:32:33 kefk kernel: *pde = 00000000
Oct 28 00:32:33 kefk kernel: Oops: 0000 [#1]
Oct 28 00:32:33 kefk kernel: PREEMPT SMP
Oct 28 00:32:33 kefk kernel: Modules linked in: ub tun md5 ipv6 rfcomm l2cap
bluetooth snd_seq_oss snd_seq_midi_event snd_seq snd_pcm_oss snd_mixer_oss
snd_emu10k1 snd_rawmidi snd_seq_device snd_ac97_codec snd_pcm snd_timer
snd_page_alloc snd_util_mem snd_hwdep snd soundcore lp ipt_REJECT
iptable_filter ip_tables loop nls_utf8 ide_cd i2c_dev w83781d i2c_sensor
i2c_isa i2c_i801 nvidia isofs zlib_inflate e1000 parport_pc ppa parport usblp
ehci_hcd uhci_hcd genrtc
Oct 28 00:32:33 kefk kernel: CPU: 0
Oct 28 00:32:33 kefk kernel: EIP: 0060:[<c0186373>] Tainted: P VLI
Oct 28 00:32:33 kefk kernel: EFLAGS: 00010246 (2.6.10-rc1-mm1)
Oct 28 00:32:33 kefk kernel: EIP is at sysfs_remove_dir+0x1d/0xef
Oct 28 00:32:33 kefk kernel: eax: f20a2688 ebx: f20a2688 ecx: c18ff480
edx: c1000000
Oct 28 00:32:33 kefk kernel: esi: e65ee800 edi: 00000000 ebp: 00000246
esp: c1bb0e20
Oct 28 00:32:33 kefk kernel: ds: 007b es: 007b ss: 0068
Oct 28 00:32:33 kefk kernel: Process khubd (pid: 125, threadinfo=c1bb0000
task=c198a530)
Oct 28 00:32:33 kefk kernel: Stack: 00000000 f20a2688 e65ee800 00000001
00000246 c01f20e7 f20a2688 c01f20f7
Oct 28 00:32:33 kefk kernel: e5f87480 c0184aa0 00000000 e65ee800
00000000 00000246 f8b3cff1 ec9cea28
Oct 28 00:32:33 kefk kernel: 0000003c 00000003 e5f87394 f66fa02c
e5f87480 e5f87380 f8b3f220 f79b4c00
Oct 28 00:32:33 kefk kernel: Call Trace:
Oct 28 00:32:33 kefk kernel: [<c01f20e7>] kobject_del+0x14/0x1c
Oct 28 00:32:33 kefk kernel: [<c01f20f7>] kobject_unregister+0x8/0x10
Oct 28 00:32:33 kefk kernel: [<c0184aa0>] del_gendisk+0x1d/0xd5
Oct 28 00:32:33 kefk kernel: [<f8b3cff1>] ub_disconnect+0x11e/0x171 [ub]
Oct 28 00:32:33 kefk kernel: [<c029826d>] usb_unbind_interface+0x5e/0x60
Oct 28 00:32:33 kefk kernel: [<c0243765>] device_release_driver+0x56/0x58
Oct 28 00:32:33 kefk kernel: [<c024396b>] bus_remove_device+0x53/0x90
Oct 28 00:32:33 kefk kernel: [<c0242a86>] device_del+0x54/0x91
Oct 28 00:32:33 kefk kernel: [<c02a0007>] usb_disable_device+0xda/0x147
Oct 28 00:32:33 kefk kernel: [<c029aa8a>] usb_disconnect+0xab/0x198
Oct 28 00:32:33 kefk kernel: [<c029bfec>] hub_port_connect_change+0x371/0x4a4
Oct 28 00:32:33 kefk kernel: [<c029c3f3>] hub_events+0x2d4/0x4ac
Oct 28 00:32:33 kefk kernel: [<c029c600>] hub_thread+0x35/0x10e
Oct 28 00:32:33 kefk kernel: [<c0115111>] finish_task_switch+0x3b/0x87
Oct 28 00:32:33 kefk kernel: [<c012d9c1>] autoremove_wake_function+0x0/0x43
Oct 28 00:32:33 kefk kernel: [<c0103c9a>] ret_from_fork+0x6/0x14
Oct 28 00:32:33 kefk kernel: [<c012d9c1>] autoremove_wake_function+0x0/0x43
Oct 28 00:32:33 kefk kernel: [<c029c5cb>] hub_thread+0x0/0x10e
Oct 28 00:32:33 kefk kernel: [<c0102025>] kernel_thread_helper+0x5/0xb
Oct 28 00:32:33 kefk kernel: Code: aa 3e 32 c0 e9 4d ff ff ff e9 23 ff ff ff
55 57 56 53 83 ec 04 8b 78 30 85 ff 74 0d 8b 07 85 c0 0f 84 ca 00 00 00 f0 ff
0
7 85 ff <8b> 57 50 0f 84 b4 00 00 00 8b 47 10 8d 48 78 f0 ff 48 78 0f 88



--
Fabio Coatti http://members.ferrara.linux.it/cova
Ferrara Linux Users Group http://ferrara.linux.it
GnuPG fp:9765 A5B6 6843 17BC A646 BE8C FA56 373A 5374 C703
Old SysOps never die... they simply forget their password.

2004-10-31 22:57:45

by Pete Zaitcev

[permalink] [raw]
Subject: Re: k 2.6.9: ub module causes /dev/sda and /dev/sda1 not being created

On Sun, 31 Oct 2004 23:10:43 +0100, Fabio Coatti <[email protected]> wrote:

> Maybe this is not a problem, but it's supposed that a /dev/uba1 is created,
> after /dev/uba, instead of sdaX? well, on my system uba is created but
> not /dev/uba1, and I've reported below a syslog excerpt for usb flash
> pendrive;
>[...]
> Oct 28 00:32:22 kefk kernel: uba: device 4 capacity nsec 50 bsize 512
> Oct 28 00:32:22 kefk kernel: uba: made changed
> Oct 28 00:32:22 kefk kernel: uba: device 4 capacity nsec 1024000 bsize 512
> Oct 28 00:32:22 kefk kernel: uba: device 4 capacity nsec 1024000 bsize 512
> Oct 28 00:32:22 kefk kernel: uba: uba1
> Oct 28 00:32:22 kefk kernel: uba: uba1
> Oct 28 00:32:22 kefk kernel: kobject_register failed for uba1 (-17)

In your case, it's a bug which needs to be fixed. It hasn't got anything to
do with usb-storage or SCSI. But I'm still trying to find an approach which
works well. The basic problem is a combination of:
1. failure to start the device before calling add_disk
2. calling check_disk_change for all opens
3. returning a failure from media_present

If any of these conditions is removed, you will not see the problem.
I tried #1 for so-called "Key Distributed on Kernel Summit", but this
is not general enough, in particular your device appears resilient to that.

#2 would require distinguishing opens coming from user level from opens
called by the partition reading code, called indirectly from do_open.
I do not see how I can do that smoothly.

#3 causes the boolean logics on flags to become too involved.

-- Pete

2004-11-23 17:53:07

by Pete Zaitcev

[permalink] [raw]
Subject: Re: k 2.6.9: ub module causes /dev/sda and /dev/sda1 not being created

On Sat, 30 Oct 2004 10:23:28 +0000 (UTC), Pasi Savolainen <[email protected]> wrote:

> There is a notion that 125 -major number will be going away?:
> <https://lists.one-eyed-alien.net/pipermail/usb-storage/2004-August/000709.html>

Yes, it has to go. I have received number 180 from LANANA.

I am sorry for the delay. My original plan was to use dynamic majors,
but a few people wanted to use ub on systems with 2.6 kernels but without
hald or udev, so a static major was needed. In such a case, it has to be
non-conflicting.

-- Pete