[linux-usb-devel] PATCH: hcd (unlink in periodic completion)

2002-01-15 Thread David Brownell
This patch removes the need for a workaround when unlinking periodic urbs in their completion handlers, removing a FIXME. Against 2.5.2-pre11 but it should work also against 2.5.2 final. - Dave hcd-0115.patch Description: Binary data

[linux-usb-devel] Any luck?

2002-01-15 Thread Dylan Egan
Hi i was just inquiring into whether anyone had a chance to look at my email containing info about the diamond data usb cdrw and had some input they would like to share? i really want to get my cdrw working under linux then i wont have to keep windows on my machine anymore. Regards, Dylan

Re: [linux-usb-devel] Re: freeing urbs in completion handler -reallyseriously meant

2002-01-15 Thread David Brownell
> > > There are hundreds of drivers, and three hcds. Surely it would be better > > > to let the HCD do the relevant hoop jumping in these cases. > > > > They do. Apart from some massive (and it "really serioiusly" > > appears to me, intentional) confusion on Oliver's part, I don't > > see a probl

Re: [linux-usb-devel] Re: freeing urbs in completion handler -reallyseriously meant

2002-01-15 Thread David Brownell
> refcounting is based on the fact that the object is freed when the count > hits zero. It doesn't matter who drops the last reference, at that point > nobody is using it. Didn't we just have a similar discussion with respect to usb_dec_dev_use(dev) One of the issues is that really only t

[linux-usb-devel] CVS e-mail?

2002-01-15 Thread Matthew Dharm
I was just browsing, and I noticed that the linux-hfsplus project on sourceforge has a system to automatically generate e-mail whenever someone does a checkin. I'd like to add this functionality to support at least the usb-storage development module... Any objections? Matt -- Matthew Dharm

Re: [linux-usb-devel] Re: freeing urbs in completion handler - really

2002-01-15 Thread David Brownell
> > Having refcount mechanisms doesn't help when the basic > > problem is keeping pointers around after they've become > > invalid (for whatever reason). > > It helps with the underlying problem of "when can I reference this". But it's not sufficient. You're still DOA if you try to do what Oliv

Re: [linux-usb-devel] Re: freeing urbs in completion handler - really

2002-01-15 Thread Greg KH
On Wed, Jan 16, 2002 at 01:22:20AM +, Alan Cox wrote: > > People are struggling to get the drivers right, and we haven't even got to > the full party game of > > "I'm in my completion handler removing the urb while on cpu #2 >the irq handler might be running, cpu 3 someone is c

Re: [linux-usb-devel] Re: freeing urbs in completion handler - really

2002-01-15 Thread Alan Cox
> Having refcount mechanisms doesn't help when the basic > problem is keeping pointers around after they've become > invalid (for whatever reason). It helps with the underlying problem of "when can I reference this". You always know that answer o If someone passed it to me it is safe o

Re: [linux-usb-devel] Re: freeing urbs in completion handler - reallyseriously meant

2002-01-15 Thread Alan Cox
> count" function does an automatic free when the count hits zero. Yes, it > means that you need to manage the refcounts. But is that such a problem? > If nothing else, doing explicitly will clear up the ambiguities. I dont think its a big problem. When you are passed an urb its referenced by t

Re: [linux-usb-devel] Re: freeing urbs in completion handler - reallyseriously meant

2002-01-15 Thread Alan Cox
> wakes the driver, but that can be solved by the driver setting a flag > that indicates that the urb should be freed when the count reaches zero. > The actual freeing is done as the HCD drops its reference. refcounting is based on the fact that the object is freed when the count hits zero. It do

Re: [linux-usb-devel] Re: freeing urbs in completion handler - reallyseriously meant

2002-01-15 Thread Oliver Neukum
On Wednesday 16 January 2002 01:33, Matthew Dharm wrote: > hrm.. I know I shouldn't jump in to something like this late, but... > > I'm starting to agree with Alan Cox. The problem with Oliver's suggestion > below (keep a reference to a submitted URB) is that I still don't know when > it's safe t

Re: [linux-usb-devel] Re: freeing urbs in completion handler - reallyseriously meant

2002-01-15 Thread Matthew Dharm
hrm.. I know I shouldn't jump in to something like this late, but... I'm starting to agree with Alan Cox. The problem with Oliver's suggestion below (keep a reference to a submitted URB) is that I still don't know when it's safe to free such a beast. If we say that an URB is referenced by both

Re: [linux-usb-devel] Re: freeing urbs in completion handler - reallyseriously meant

2002-01-15 Thread Oliver Neukum
On Wednesday 16 January 2002 00:15, David Brownell wrote: > > There are hundreds of drivers, and three hcds. Surely it would be better > > to let the HCD do the relevant hoop jumping in these cases. > > They do. Apart from some massive (and it "really serioiusly" > appears to me, intentional) con

[linux-usb-devel] *****ADVERTISE TO 12 MILLION PEOPLE FREE!

2002-01-15 Thread 98089866
Dear [EMAIL PROTECTED], Would you like to send an Email Advertisement to OVER 12,000,000 PEOPLE DAILY for FREE? Do you have a product or service to sell? Do you want an extra 100 orders per week? NOTE: (If y

Re: [linux-usb-devel] Re: freeing urbs in completion handler - reallyseriously meant

2002-01-15 Thread David Brownell
The problem I see is that Oliver has been trying to avoid writing the line of code setting that pointer to zero when it's no longer in use. The problems he's describing will not show up when such lines exist in the driver. Having refcount mechanisms doesn't help when the basic problem is keeping

Re: [linux-usb-devel] Re: freeing urbs in completion handler - reallyseriously meant

2002-01-15 Thread David Brownell
> There are hundreds of drivers, and three hcds. Surely it would be better > to let the HCD do the relevant hoop jumping in these cases. They do. Apart from some massive (and it "really serioiusly" appears to me, intentional) confusion on Oliver's part, I don't see a problem. - Dave ___

Re: [linux-usb-devel] Re: freeing urbs in completion handler - reallyseriously meant

2002-01-15 Thread David Brownell
> > I'm sure you can figure several of them out if you think about it for a > > few minutes. (Hint: if you have a spinlock that protects access to > > a pointer outside the completion handler, and that pointer is nulled > > when its data is freed, what else might you need to do??) > > Using a s

Re: [linux-usb-devel] Re: freeing urbs in completion handler - really seriously meant

2002-01-15 Thread Oliver Neukum
> I'm sure you can figure several of them out if you think about it for a > few minutes. (Hint: if you have a spinlock that protects access to > a pointer outside the completion handler, and that pointer is nulled > when its data is freed, what else might you need to do??) Using a spinlock is

Re: [linux-usb-devel] Re: freeing urbs in completion handler - really seriously meant

2002-01-15 Thread Alan Cox
> > The amount of bugs and crap refcounting has removed elsewhere in the kernel > > and more importantly the amount of "if I do X very occasionally [list of > > weirdness]" things that just went away testify to its value. > > That sounds sensible. However is the urb counted as referenced during t

Re: [linux-usb-devel] Re: freeing urbs in completion handler - really seriously meant

2002-01-15 Thread Oliver Neukum
> The amount of bugs and crap refcounting has removed elsewhere in the kernel > and more importantly the amount of "if I do X very occasionally [list of > weirdness]" things that just went away testify to its value. That sounds sensible. However is the urb counted as referenced during the execut

Re: [linux-usb-devel] Re: freeing urbs in completion handler - really seriously meant

2002-01-15 Thread Alan Cox
> The rule of never unlinking an urb that can be freed from the > completion handler is in all likelihood known to less than > five people on earth. And it is very, very counterintuitive. There are hundreds of drivers, and three hcds. Surely it would be better to let the HCD do the relevant hoop

[linux-usb-devel] Re: freeing urbs in completion handler - really seriously meant

2002-01-15 Thread David Brownell
> And how is the comment in hcd.c on unlinking urbs and > the validity of the pointers supposed to be understood. I only see a FIXME that doesn't mention pointer validity ... since pointer validity isn't the issue. It does mention a need to remember some state, but I realized recently that such

[linux-usb-devel] Re: freeing urbs in completion handler - really seriously meant

2002-01-15 Thread David Brownell
> You _cannot_ even in principle synchronize between a completion > handler and process context. It's a one way street of communication. > That race is unavoidable. What about spinlocked data structures? And waitqueues? And the various other constructs specifically designed for achieving such sy

[linux-usb-devel] Re: freeing urbs in completion handler - really seriously meant

2002-01-15 Thread Oliver Neukum
On Tuesday 15 January 2002 21:37, David Brownell wrote: > > After further checking, I found that no HCD driver can cope > > with unlinking an urb that can be freed from the completion > > handler. > > Without any checking whatsoever, I'll say that no driver in > the Linux kernel will cope with bei

[linux-usb-devel] Re: freeing urbs in completion handler - really seriously meant

2002-01-15 Thread Oliver Neukum
On Tuesday 15 January 2002 21:21, David Brownell wrote: > > > > I really doubt that this issue can be not exposed. > > > > > > And why is that? I just gave you an argument from first > > > principles. You can't refute that by pointing to a bug in > > > one current driver. > > > > Because all the

[linux-usb-devel] Re: freeing urbs in completion handler - really seriously meant

2002-01-15 Thread David Brownell
> After further checking, I found that no HCD driver can cope > with unlinking an urb that can be freed from the completion > handler. Without any checking whatsoever, I'll say that no driver in the Linux kernel will cope with being passed pointers to memory that's been freed. In fact, most part

[linux-usb-devel] Re: freeing urbs in completion handler - really seriously meant

2002-01-15 Thread Oliver Neukum
> > I really doubt that this issue can be not exposed. > > And why is that? I just gave you an argument from first > principles. You can't refute that by pointing to a bug in After further checking, I found that no HCD driver can cope with unlinking an urb that can be freed from the completion

[linux-usb-devel] Re: freeing urbs in completion handler - really seriously meant

2002-01-15 Thread David Brownell
> > > I really doubt that this issue can be not exposed. > > > > And why is that? I just gave you an argument from first > > principles. You can't refute that by pointing to a bug in > > one current driver. > > Because all the HCD has is a pointer that may or may not be valid. Drivers that don

Re: [linux-usb-devel] Problems with interrupt mode transfer on OHCIcontroller...

2002-01-15 Thread David Brownell
> Tx interval > is set to zero for one-shot mode (although it makes no difference if > I set to the interval value from the endpoint). I think that "one shot interrupts" are a UHCI-ism. Unlink the urb in the completion handler, if you need it to complete only one of its transfers. > driv

[linux-usb-devel] Re: freeing urbs in completion handler - really seriously meant

2002-01-15 Thread Oliver Neukum
> > I really doubt that this issue can be not exposed. > > And why is that? I just gave you an argument from first > principles. You can't refute that by pointing to a bug in Because all the HCD has is a pointer that may or may not be valid. > one current driver: > > If I may point you to the

[linux-usb-devel] Re: freeing urbs in completion handler - really seriously meant

2002-01-15 Thread David Brownell
> > > The problem is basically that the usbcore in case of an unlink has > > > to wait while the hardware might be dealing with an urb and the > > > completion handler is running. > > > > Classic urb-unlink issue inside the hcd, doesn't need > > to be exposed outside. Any given URB is either goin

[linux-usb-devel] Re: freeing urbs in completion handler - really seriously meant

2002-01-15 Thread Oliver Neukum
On Tuesday 15 January 2002 19:42, David Brownell wrote: > > The problem is basically that the usbcore in case of an unlink has > > to wait while the hardware might be dealing with an urb and the > > completion handler is running. > > Classic urb-unlink issue inside the hcd, doesn't need > to be ex

[linux-usb-devel] Re: freeing urbs in completion handler - really seriously meant

2002-01-15 Thread David Brownell
> The problem is basically that the usbcore in case of an unlink has > to wait while the hardware might be dealing with an urb and the > completion handler is running. Classic urb-unlink issue inside the hcd, doesn't need to be exposed outside. Any given URB is either going to have completed nor

Re: [linux-usb-devel] can't get ioctl to work

2002-01-15 Thread David Brownell
> In the usb_driver structure I've set an ioctl function. I know my > driver loads and works, it is running the device just fine. For now, I > manually look at /proc/bus/usb/devices to find the bus and device number my > driver is at. Then I hardcode that into my app, > open("/proc/bus/usb/

Re: [linux-usb-devel] can't get ioctl to work

2002-01-15 Thread Greg KH
On Tue, Jan 15, 2002 at 12:49:05PM -0500, Steve Urquhart wrote: > Hi, > > I'm having a problem trying to get my user mode application to ioctl my usb > driver. In the usb_driver structure I've set an ioctl function. I know my > driver loads and works, it is running the device just fine. For no

[linux-usb-devel] can't get ioctl to work

2002-01-15 Thread Steve Urquhart
Hi, I'm having a problem trying to get my user mode application to ioctl my usb driver. In the usb_driver structure I've set an ioctl function. I know my driver loads and works, it is running the device just fine. For now, I manually look at /proc/bus/usb/devices to find the bus and device num

[linux-usb-devel] bringing up dsbr100 to 2.5 module usage counting

2002-01-15 Thread Oliver Neukum
Hi, this patch applies to 2.5.2-pre11 and uses modern module usage counting and removes code dead in a V4L driver. Regards Oliver --- dsbr100.c.alt Mon Jan 14 21:33:09 2002 +++ dsbr100.c Mon Jan 14 21:35:51 2002 @@ -101,6 +101,7 @@ static struct video_device u

[linux-usb-devel] request for official minor number for LEGO USB Tower driver

2002-01-15 Thread Juergen Stuber
Hi, I'd like to request a minor number for the LEGO USB Tower driver. The driver is currently beginning to become useable, and IMHO it would become confusing if we continue with an unofficial number for much longer. I think a single minor number will be fine, IMHO there will be very few people wh

[linux-usb-devel] Problems with interrupt mode transfer on OHCI controller...

2002-01-15 Thread Stuart Northfield
Hi, I'm working on a device driver which uses interrupt mode transfers in both directions. The reception side is working happily, but I'm having some problems with the transmission side. My understanding is that the following pseudo-code is how I should attempt to use the USB system (main s

Re: [linux-usb-devel] Help writing a driver for usb digital camera

2002-01-15 Thread Bill Bland
Hello all, I spent the whole weekend forcing a win2000 CD that was meant only for Dell computers to install on my (very much non-Dell) compuer... great fun ;-) It all paid off though. The usb sniffer worked perfectly. To avoid clogging-up your inboxes with the logs I have put them on

Re: [linux-usb-devel] [PATCH] Add some PID stuff and fix HID debug prettyprinting

2002-01-15 Thread Bj|rn Augustsson
Quoting Greg KH <[EMAIL PROTECTED]>: > On Tue, Jan 15, 2002 at 12:17:49AM +0100, Bj|rn Augustsson wrote: > You should copy the maintainer of the HID code too. He needs to aprove > it. OK, done. > > * Changes the type of unit_exponent to be signed in a few places > > (Including possibly use

[linux-usb-devel] freeing urbs in completion handler - really seriously meant

2002-01-15 Thread Oliver Neukum
Hi David, I certainly don't argue for the sake of arguing. I see a real problem here. > > Not from a driver standpoint. If a driver unlinks an urb, it needs > > to be dead, > > As it will be -- after a delay to make sure the hardware finished. > > THINK!! It is NOT immediate. For synchronous u