[PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl v2

2008-01-19 Thread Cyrill Gorcunov
This patch does convert ioctl call to unlocked_ioctl form. It is possible (in that simple way) due to a spinlock protection. Signed-off-by: Cyrill Gorcunov <[EMAIL PROTECTED]> Acked-by: Jiri Slaby <[EMAIL PROTECTED]> --- drivers/char/ip27-rtc.c |9 - 1 files changed, 4

[PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl v2

2008-01-19 Thread Cyrill Gorcunov
This patch does convert ioctl call to unlocked_ioctl form. It is possible (in that simple way) due to a spinlock protection. Signed-off-by: Cyrill Gorcunov [EMAIL PROTECTED] Acked-by: Jiri Slaby [EMAIL PROTECTED] --- drivers/char/ip27-rtc.c |9 - 1 files changed, 4 insertions(+), 5

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-14 Thread Cyrill Gorcunov
[Jiri Slaby - Mon, Jan 14, 2008 at 05:27:00PM +0100] > On 01/14/2008 05:07 PM, Cyrill Gorcunov wrote: >> Yes, process would be stopped, and not *just* stopped but could spend >> all his cpu time-slice in attempt to get spinlock (espec if set time is >> much longer than read), but if we use mutex

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-14 Thread Jiri Slaby
On 01/14/2008 05:07 PM, Cyrill Gorcunov wrote: Yes, process would be stopped, and not *just* stopped but could spend all his cpu time-slice in attempt to get spinlock (espec if set time is much longer than read), but if we use mutex here the process could just sleep instead of trying to get

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-14 Thread Cyrill Gorcunov
[Jiri Slaby - Mon, Jan 14, 2008 at 04:59:22PM +0100] > On 01/14/2008 04:38 PM, Cyrill Gorcunov wrote: >> Jiri, I mean rtc_open() is protected by spinlock+status from being >> opened simultaneously by a few processes. *But* lets imagine the >> following situation - this fd (file descriptor) is

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-14 Thread Jiri Slaby
On 01/14/2008 04:38 PM, Cyrill Gorcunov wrote: Jiri, I mean rtc_open() is protected by spinlock+status from being opened simultaneously by a few processes. *But* lets imagine the following situation - this fd (file descriptor) is opened by one multithreaded application so all threads have an

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-14 Thread Cyrill Gorcunov
[Jiri Slaby - Mon, Jan 14, 2008 at 04:14:18PM +0100] > On 01/14/2008 07:38 AM, Cyrill Gorcunov wrote: >> This patch converts ioctl call to unlocked_ioctl form. It's possible >> due to rtl_lock spinlock protection. >> Signed-off-by: Cyrill Gorcunov <[EMAIL PROTECTED]> >> --- >> The patch is *not*

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-14 Thread Jiri Slaby
On 01/14/2008 07:38 AM, Cyrill Gorcunov wrote: This patch converts ioctl call to unlocked_ioctl form. It's possible due to rtl_lock spinlock protection. Signed-off-by: Cyrill Gorcunov <[EMAIL PROTECTED]> --- The patch is *not* tested but the patch does not bring _much_ changes so it wouldn't

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-14 Thread Jiri Slaby
On 01/14/2008 07:38 AM, Cyrill Gorcunov wrote: This patch converts ioctl call to unlocked_ioctl form. It's possible due to rtl_lock spinlock protection. Signed-off-by: Cyrill Gorcunov [EMAIL PROTECTED] --- The patch is *not* tested but the patch does not bring _much_ changes so it wouldn't

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-14 Thread Cyrill Gorcunov
[Jiri Slaby - Mon, Jan 14, 2008 at 04:59:22PM +0100] On 01/14/2008 04:38 PM, Cyrill Gorcunov wrote: Jiri, I mean rtc_open() is protected by spinlock+status from being opened simultaneously by a few processes. *But* lets imagine the following situation - this fd (file descriptor) is opened by

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-14 Thread Jiri Slaby
On 01/14/2008 05:07 PM, Cyrill Gorcunov wrote: Yes, process would be stopped, and not *just* stopped but could spend all his cpu time-slice in attempt to get spinlock (espec if set time is much longer than read), but if we use mutex here the process could just sleep instead of trying to get

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-14 Thread Jiri Slaby
On 01/14/2008 04:38 PM, Cyrill Gorcunov wrote: Jiri, I mean rtc_open() is protected by spinlock+status from being opened simultaneously by a few processes. *But* lets imagine the following situation - this fd (file descriptor) is opened by one multithreaded application so all threads have an

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-14 Thread Cyrill Gorcunov
[Jiri Slaby - Mon, Jan 14, 2008 at 05:27:00PM +0100] On 01/14/2008 05:07 PM, Cyrill Gorcunov wrote: Yes, process would be stopped, and not *just* stopped but could spend all his cpu time-slice in attempt to get spinlock (espec if set time is much longer than read), but if we use mutex here the

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-13 Thread Cyrill Gorcunov
This patch converts ioctl call to unlocked_ioctl form. It's possible due to rtl_lock spinlock protection. Signed-off-by: Cyrill Gorcunov <[EMAIL PROTECTED]> --- The patch is *not* tested but the patch does not bring _much_ changes so it wouldn't break the compilation procedure. If there is

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-13 Thread Andi Kleen
On Sunday 13 January 2008 21:32:23 Cyrill Gorcunov wrote: > This patch converts ioctl call to unlocked_ioctl form with > explicit big-kernel-lock. > Also it makes a bit of cleanup > converting miscdevice structure initialization to C99 form. First please always send cleanup patches separately.

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-13 Thread Cyrill Gorcunov
Thanks Jiri. Will do that all tomorrow. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-13 Thread Jiri Slaby
On 01/13/2008 10:22 PM, Jiri Slaby wrote: This routine seems to be re-entrant due to parameters on stack + the spin lock, hence the lock is not needed here at all. s/parameters/variables/; too slpy. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-13 Thread Cyrill Gorcunov
Thanks, Alexey for review, i'll make it updated tomorrow. (sorry for top-post) On 1/14/08, Alexey Dobriyan <[EMAIL PROTECTED]> wrote: > On Sun, Jan 13, 2008 at 11:32:23PM +0300, Cyrill Gorcunov wrote: > > This patch converts ioctl call to unlocked_ioctl form with > > explicit big-kernel-lock.

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-13 Thread Jiri Slaby
On 01/13/2008 09:32 PM, Cyrill Gorcunov wrote: This patch converts ioctl call to unlocked_ioctl form with explicit big-kernel-lock. Also it makes a bit of cleanup converting miscdevice structure initialization to C99 form. Signed-off-by: Cyrill Gorcunov <[EMAIL PROTECTED]> --- Any comments are

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-13 Thread Alexey Dobriyan
On Sun, Jan 13, 2008 at 11:32:23PM +0300, Cyrill Gorcunov wrote: > This patch converts ioctl call to unlocked_ioctl form with > explicit big-kernel-lock. Also it makes a bit of cleanup > converting miscdevice structure initialization to C99 form. > > Signed-off-by: Cyrill Gorcunov <[EMAIL

[PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-13 Thread Cyrill Gorcunov
This patch converts ioctl call to unlocked_ioctl form with explicit big-kernel-lock. Also it makes a bit of cleanup converting miscdevice structure initialization to C99 form. Signed-off-by: Cyrill Gorcunov <[EMAIL PROTECTED]> --- Any comments are welcome. This is untested code - i've no such

[PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-13 Thread Cyrill Gorcunov
This patch converts ioctl call to unlocked_ioctl form with explicit big-kernel-lock. Also it makes a bit of cleanup converting miscdevice structure initialization to C99 form. Signed-off-by: Cyrill Gorcunov [EMAIL PROTECTED] --- Any comments are welcome. This is untested code - i've no such chip

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-13 Thread Alexey Dobriyan
On Sun, Jan 13, 2008 at 11:32:23PM +0300, Cyrill Gorcunov wrote: This patch converts ioctl call to unlocked_ioctl form with explicit big-kernel-lock. Also it makes a bit of cleanup converting miscdevice structure initialization to C99 form. Signed-off-by: Cyrill Gorcunov [EMAIL PROTECTED]

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-13 Thread Jiri Slaby
On 01/13/2008 09:32 PM, Cyrill Gorcunov wrote: This patch converts ioctl call to unlocked_ioctl form with explicit big-kernel-lock. Also it makes a bit of cleanup converting miscdevice structure initialization to C99 form. Signed-off-by: Cyrill Gorcunov [EMAIL PROTECTED] --- Any comments are

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-13 Thread Cyrill Gorcunov
Thanks, Alexey for review, i'll make it updated tomorrow. (sorry for top-post) On 1/14/08, Alexey Dobriyan [EMAIL PROTECTED] wrote: On Sun, Jan 13, 2008 at 11:32:23PM +0300, Cyrill Gorcunov wrote: This patch converts ioctl call to unlocked_ioctl form with explicit big-kernel-lock. Also it

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-13 Thread Jiri Slaby
On 01/13/2008 10:22 PM, Jiri Slaby wrote: This routine seems to be re-entrant due to parameters on stack + the spin lock, hence the lock is not needed here at all. s/parameters/variables/; too slpy. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-13 Thread Cyrill Gorcunov
Thanks Jiri. Will do that all tomorrow. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-13 Thread Andi Kleen
On Sunday 13 January 2008 21:32:23 Cyrill Gorcunov wrote: This patch converts ioctl call to unlocked_ioctl form with explicit big-kernel-lock. Also it makes a bit of cleanup converting miscdevice structure initialization to C99 form. First please always send cleanup patches separately. I

Re: [PATCH] driver: ip27-rtc - convert ioctl to unlocked_ioctl

2008-01-13 Thread Cyrill Gorcunov
This patch converts ioctl call to unlocked_ioctl form. It's possible due to rtl_lock spinlock protection. Signed-off-by: Cyrill Gorcunov [EMAIL PROTECTED] --- The patch is *not* tested but the patch does not bring _much_ changes so it wouldn't break the compilation procedure. If there is problem