Re: kqueue for usb_dev

2014-02-27 Thread Hans Petter Selasky
On 02/27/14 08:42, Kohji Okuno wrote: From: Hans Petter Selasky h...@bitfrost.no On 02/27/14 08:13, Kohji Okuno wrote: Hi John-Mark, Thank you for you comment. From: John-Mark Gurney j...@funkthat.com Kohji Okuno wrote this message on Thu, Feb 27, 2014 at 14:26 +0900: I tried add kqueue

Re: kqueue for usb_dev

2014-02-27 Thread Hans Petter Selasky
Hi Kohji, Can you verify this commit: http://svnweb.freebsd.org/changeset/base/262550 Please test using both read and write direction. For example you can use the ULPT driver or a /dev/usb/X.X.X node which supports both read and write. Thank you! --HPS

Re: kqueue for usb_dev

2014-02-27 Thread Hans Petter Selasky
On 02/27/14 10:00, Hans Petter Selasky wrote: Hi Kohji, Can you verify this commit: http://svnweb.freebsd.org/changeset/base/262550 Please test using both read and write direction. For example you can use the ULPT driver or a /dev/usb/X.X.X node which supports both read and write. Thank you!

Re: kqueue for usb_dev

2014-02-27 Thread Kohji Okuno
Hi HPS and John-Mark, We should wait for empty of knlist before knlist_destroy(). When I tried 262551, the kernel panic at KN_LIST_LOCK(kn) in kern_event.c. Regards, Kohji Okuno On 02/27/14 10:00, Hans Petter Selasky wrote: Hi Kohji, Can you verify this commit:

Re: kqueue for usb_dev

2014-02-27 Thread Kohji Okuno
Hi HPS and John-Mark, After I changed as the following, the kernel panic does not happen. What do you think about this change? + knlist_clear(f-selinfo.si_note, 0); knlist_destroy(f-selinfo.si_note); Regards, Kohji Okuno We should wait for empty of knlist before

Re: kqueue for usb_dev

2014-02-27 Thread Hans Petter Selasky
On 02/27/14 11:39, Kohji Okuno wrote: Hi HPS and John-Mark, After I changed as the following, the kernel panic does not happen. What do you think about this change? + knlist_clear(f-selinfo.si_note, 0); knlist_destroy(f-selinfo.si_note); Regards, Kohji Okuno Can you try

Re: kqueue for usb_dev

2014-02-27 Thread Kohji Okuno
Hi HPS, Your patch did not resolve the kernel panic. I think, we should check knlist_clear() before knlist_destroy(). When a device is lost suddenly, usb_dev notify to a process in usb_fifo_close() and then calls knlist_destroy(). knlist_destroy() clears knlist-kn_lock and knlist-kn_unlock. But,

kqueue for usb_dev

2014-02-26 Thread Kohji Okuno
Hi, I tried add kqueue I/F to usb_dev.c. I attached my patch. What do you think about my patch? Best regards, Kohji Okuno diff --git a/sys/dev/usb/usb_dev.c b/sys/dev/usb/usb_dev.c index f086a3c..4334be7 100644 --- a/sys/dev/usb/usb_dev.c +++ b/sys/dev/usb/usb_dev.c @@ -120,6 +120,9 @@ static

Re: kqueue for usb_dev

2014-02-26 Thread John-Mark Gurney
Kohji Okuno wrote this message on Thu, Feb 27, 2014 at 14:26 +0900: I tried add kqueue I/F to usb_dev.c. I attached my patch. What do you think about my patch? A few comments... 1) You should just drop the use of flag_iskevent and just unconditionally call KNOTE... since you have the lock

Re: kqueue for usb_dev

2014-02-26 Thread John-Mark Gurney
Kohji Okuno wrote this message on Thu, Feb 27, 2014 at 14:26 +0900: I tried add kqueue I/F to usb_dev.c. I attached my patch. What do you think about my patch? Do you have test cases for these patches? -- John-Mark Gurney Voice: +1 415 225 5579 All that I

Re: kqueue for usb_dev

2014-02-26 Thread Kohji Okuno
Hi John-Mark, I tested the attached sample source with USB mouse. Thanks, Kohji Okuno From: John-Mark Gurney j...@funkthat.com Kohji Okuno wrote this message on Thu, Feb 27, 2014 at 14:26 +0900: I tried add kqueue I/F to usb_dev.c. I attached my patch. What do you think about my patch?

Re: kqueue for usb_dev

2014-02-26 Thread Kohji Okuno
Hi John-Mark, Thank you for you comment. From: John-Mark Gurney j...@funkthat.com Kohji Okuno wrote this message on Thu, Feb 27, 2014 at 14:26 +0900: I tried add kqueue I/F to usb_dev.c. I attached my patch. What do you think about my patch? A few comments... 1) You should just drop the

Re: kqueue for usb_dev

2014-02-26 Thread Hans Petter Selasky
On 02/27/14 07:02, John-Mark Gurney wrote: 2) Why do you try to start read/write transfers in the _filter? You should just check to see if data is available and not do work.. This is also important since kqueue calls the filter just before delivering the knote to userland to verify that there

Re: kqueue for usb_dev

2014-02-26 Thread Hans Petter Selasky
On 02/27/14 08:13, Kohji Okuno wrote: Hi John-Mark, Thank you for you comment. From: John-Mark Gurney j...@funkthat.com Kohji Okuno wrote this message on Thu, Feb 27, 2014 at 14:26 +0900: I tried add kqueue I/F to usb_dev.c. I attached my patch. What do you think about my patch? A few

Re: kqueue for usb_dev

2014-02-26 Thread Kohji Okuno
From: Hans Petter Selasky h...@bitfrost.no On 02/27/14 08:13, Kohji Okuno wrote: Hi John-Mark, Thank you for you comment. From: John-Mark Gurney j...@funkthat.com Kohji Okuno wrote this message on Thu, Feb 27, 2014 at 14:26 +0900: I tried add kqueue I/F to usb_dev.c. I attached my patch.