Re: [linux-usb-devel] anchors and their use

2007-05-25 Thread Oliver Neukum
Am Freitag, 25. Mai 2007 04:30 schrieb Alan Stern: For a simple example driver, this is getting distressingly complicated. Our API is growing. We've introduced pre/post_reset and autosuspend within a recentlyish timeframe. How could a generic example avoid reflecting that? Instead of

Re: [linux-usb-devel] anchors and their use

2007-05-24 Thread Oliver Neukum
Am Dienstag, 22. Mai 2007 21:48 schrieb David Brownell: On Tuesday 22 May 2007, Alan Stern wrote: Timeouts are specified in jiffies, so your timeout argument should be long or unsigned long, not int. Timeouts are best specified in milliseconds though... that's been the policy

Re: [linux-usb-devel] anchors and their use

2007-05-24 Thread Alan Stern
On Thu, 24 May 2007, Oliver Neukum wrote: Hi, here's the use of anchors to implement a couple of methods in the skeleton driver, which is thus brought up to standard. This patch does: - correctly handle disconnect with an anchor - correctly handle suspend with an anchor - correctly

Re: [linux-usb-devel] anchors and their use

2007-05-23 Thread Oliver Neukum
Am Dienstag, 22. Mai 2007 17:12 schrieb Alan Stern: Very good. I did notice two more things: Timeouts are specified in jiffies, so your timeout argument should be long or unsigned long, not int. There's a race if two threads call usb_unanchor_urb() for the same

Re: [linux-usb-devel] anchors and their use

2007-05-23 Thread Alan Stern
On Wed, 23 May 2007, Oliver Neukum wrote: OK, these are fixed and the timeout given in milliseconds, as David recommended. I looked into the inlining issue and the inlined version wins in terms of size. @@ -1270,6 +1287,11 @@ extern struct urb *usb_get_urb(struct ur extern int

Re: [linux-usb-devel] anchors and their use

2007-05-23 Thread Oliver Neukum
Am Mittwoch, 23. Mai 2007 17:39 schrieb Alan Stern: On Wed, 23 May 2007, Oliver Neukum wrote: OK, these are fixed and the timeout given in milliseconds, as David recommended. I looked into the inlining issue and the inlined version wins in terms of size. @@ -1270,6 +1287,11 @@

Re: [linux-usb-devel] anchors and their use

2007-05-23 Thread Alan Stern
On Wed, 23 May 2007, Oliver Neukum wrote: +extern int usb_wait_anchor_empty_timeout +(struct usb_anchor *anchor, unsigned long timeout); Suspicious line break. This is what I get when I want to keep the 80 column limit. I would write it like this: extern int

Re: [linux-usb-devel] anchors and their use

2007-05-23 Thread Oliver Neukum
Here we go again. Regards Oliver --- --- a/drivers/usb/core/hcd.c2007-05-22 14:50:32.0 +0200 +++ b/drivers/usb/core/hcd.c2007-05-22 15:36:17.0 +0200 @@ -1412,6 +1412,8 @@ void usb_hcd_giveback_urb (struct usb_hc }

Re: [linux-usb-devel] anchors and their use

2007-05-22 Thread Oliver Neukum
Am Mittwoch, 16. Mai 2007 17:30 schrieb Alan Stern: This won't build because you forgot to export usb_unanchor_urb(). You could make usb_init_anchor() non-inline. I'm not sure where tradeoff lies, but you might be over the limit. I don't like the way you combined the error handling in

Re: [linux-usb-devel] anchors and their use

2007-05-22 Thread Alan Stern
On Tue, 22 May 2007, Oliver Neukum wrote: Am Mittwoch, 16. Mai 2007 17:30 schrieb Alan Stern: This won't build because you forgot to export usb_unanchor_urb(). You could make usb_init_anchor() non-inline. I'm not sure where tradeoff lies, but you might be over the limit. I

Re: [linux-usb-devel] anchors and their use

2007-05-22 Thread David Brownell
On Tuesday 22 May 2007, Alan Stern wrote: Timeouts are specified in jiffies, so your timeout argument should be long or unsigned long, not int. Timeouts are best specified in milliseconds though... that's been the policy inside the USB stack since someone's search-and-destroy

Re: [linux-usb-devel] anchors and their use

2007-05-22 Thread Oliver Neukum
Am Dienstag, 22. Mai 2007 21:48 schrieb David Brownell: On Tuesday 22 May 2007, Alan Stern wrote:   Timeouts are specified in jiffies, so your timeout argument   should be long or unsigned long, not int. Timeouts are best specified in milliseconds though... that's been the

Re: [linux-usb-devel] anchors and their use

2007-05-21 Thread Alan Stern
On Mon, 21 May 2007, Oliver Neukum wrote: I don't like the way you combined the error handling in usb-skeleton with the anchor stuff. Better to keep the two things in separate patches. Problems with the packaging or the code? Just the packaging. Alan Stern

Re: [linux-usb-devel] anchors and their use

2007-05-20 Thread Oliver Neukum
Am Mittwoch, 16. Mai 2007 17:30 schrieb Alan Stern: On Wed, 16 May 2007, Oliver Neukum wrote: Hi Alan, list, here's the patch to introduce anchors for use with fire-and-forget techniques and a modification for the skeleton driver to use them. This should make implementing

[linux-usb-devel] anchors and their use

2007-05-16 Thread Oliver Neukum
Hi Alan, list, here's the patch to introduce anchors for use with fire-and-forget techniques and a modification for the skeleton driver to use them. This should make implementing pre/post_reset and suspend/resume much easier. Regards Oliver -- --- a/include/linux/usb.h

Re: [linux-usb-devel] anchors and their use

2007-05-16 Thread Alan Stern
On Wed, 16 May 2007, Oliver Neukum wrote: Hi Alan, list, here's the patch to introduce anchors for use with fire-and-forget techniques and a modification for the skeleton driver to use them. This should make implementing pre/post_reset and suspend/resume much easier. This won't build