On Tue, 15 Aug 2006 12:03:05 -0400 (EDT)
Alan Stern <[EMAIL PROTECTED]> wrote:

> On Tue, 15 Aug 2006, Peter Oehry wrote:
> 

> > 
> > I tried to change the configuration in the probe entry point of the
> > module. Obviously it was a bad idea. :-( I got either an immediate
> > deadlock or some hanging modules later on.
> 
> Did you do it by calling the new usb_driver_set_configuration() routine in 
> the patch I sent?

Yes I tried it with your pach. The usb_set_configuration() would not have been
available by the include <linux/usb.h>

I tried the following code in the snd_usb_audio_probe() Function (usbaudio.c)

if (id == USB_ID(0x0763, 0x2012)) { /* warn for configuration */
        if(dev->actconfig->desc.bConfigurationValue==1){
                usb_driver_set_configuration(dev,2);
                goto __err_val;
        }
}

Without the goto __err_val I get nearly every time a deadlock. If I return I 
have different random problem. I one cas I had only no keyboard after the USB 
device plugged in. I was able to get the follwoing errors from the kernel:

usb 1-1: new full speed USB device using uhci_hcd and address 7
usb 1-1: configuration #1 chosen from 2 choices
snd-usb-audio: probe of 1-1:1.0 failed with error -5
snd-usb-audio: probe of 1-1:1.1 failed with error -5
BUG: unable to handle kernel paging request at virtual address 69766725
 printing eip:
c03cd914
*pde = 00000000
Oops: 0000 [#1]
PREEMPT SMP 
Modules linked in: snd_usb_audio snd_usb_lib snd_rawmidi snd_hwdep snd_pcm_oss s
nd_mixer_oss snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device radeon drm i2
c_i801 ehci_hcd usbhid uhci_hcd intel_agp agpgart rtc raid0 snd_intel8x0 snd_ac9
7_codec snd_ac97_bus snd_pcm snd_timer snd snd_page_alloc realtime w83627hf hwmo
n_vid i2c_isa bttv video_buf ir_common compat_ioctl32 btcx_risc lirc_i2c lirc_de
v msp3400 saa7115 tda9887 tuner v4l2_common ivtv firmware_class i2c_algo_bit v4l
1_compat tveeprom i2c_core videodev md_mod
CPU:    0
EIP:    0060:[<c03cd914>]    Not tainted VLI
EFLAGS: 00010296   (2.6.17-gentoo-r4 #2) 
EIP is at usb_set_configuration+0x1d/0x493
eax: 69766564   ebx: dfec1340   ecx: 00000001   edx: f69f4400
esi: dfec134c   edi: 00000000   ebp: 69766564   esp: f7c6fecc
ds: 007b   es: 007b   ss: 0068
Process events/0 (pid: 8, threadinfo=f7c6e000 task=f7c4d0b0)
Stack: f7c4d0b0 c044b9cf c044b429 00000001 f7c4d0b0 c0118d89 00100100 00200200 
       f7dd6070 e545a040 f7c6ff50 dfec1340 00000000 00000000 dfec1340 dfec134c 
       c17fe340 dfec1340 c03cddb2 69766564 40736563 dfec1348 c012f0ed dfec1340 
Call Trace:
 <c044b9cf> _spin_unlock_irqrestore+0xf/0x23  <c044b429> __down+0xcc/0xdb
 <c0118d89> default_wake_function+0x0/0x12  <c03cddb2> driver_set_config_work+0x
28/0x4e
 <c012f0ed> run_workqueue+0x76/0xed  <c03cdd8a> driver_set_config_work+0x0/0x4e
 <c012f2b9> worker_thread+0x155/0x170  <c0118d89> default_wake_function+0x0/0x12
 <c0118d89> default_wake_function+0x0/0x12  <c012f164> worker_thread+0x0/0x170
 <c01328e4> kthread+0xba/0xf0  <c013282a> kthread+0x0/0xf0
 <c0101135> kernel_thread_helper+0x5/0xb 
Code: ff 89 5c 24 10 83 c4 08 5b e9 9e ec d8 ff 55 57 31 ff 56 53 83 ec 38 8b 6c
 24 4c c7 44 24 34 00 00 00 00 c7 44 24 30 00 00 00 00 <0f> b6 85 c1 01 00 00 83
 f8 00 7e 29 8b b5 c4 01 00 00 89 c3 31 
EIP: [<c03cd914>] usb_set_configuration+0x1d/0x493 SS:ESP 0068:f7c6fecc


> 
> Or did you do it by calling the old usb_set_configuration() routine?  That 
> is guaranteed to deadlock if you call it from within a probe method.
> 
> > I can not thing of an other place in the module where the configuration
> > switchin would be in the right place.
> > 
> > More and more I come to the conclusion that your first statement was the
> > best. It has to be done by udev or hotplug. I think I can not expect the
> > usb core module to be adapted for the needs of a single device.
> 
> Adapting a driver for a single device isn't so bad.  It has been done lots 
> of times.  In fact the kernel supports entire architectures which are used 
> by only two or three people in the whole world!
> 
> Alan Stern
> 
>

Peter Oehry


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to