LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [JANITOR-PATCH] rtc: switch to unlocked_ioctl
@ 2008-03-04 21:06 Harvey Harrison
  2008-03-04 22:58 ` Jiri Slaby
  0 siblings, 1 reply; 5+ messages in thread
From: Harvey Harrison @ 2008-03-04 21:06 UTC (permalink / raw)
  To: Russell King, Andi Kleen; +Cc: LKML

Make the lock/unlock_kernel explicit.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 arch/arm/common/rtctime.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/common/rtctime.c b/arch/arm/common/rtctime.c
index f53bca4..2062f92 100644
--- a/arch/arm/common/rtctime.c
+++ b/arch/arm/common/rtctime.c
@@ -173,8 +173,7 @@ static unsigned int rtc_poll(struct file *file, poll_table *wait)
 	return data != 0 ? POLLIN | POLLRDNORM : 0;
 }
 
-static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
-		     unsigned long arg)
+static int rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
 	struct rtc_ops *ops = file->private_data;
 	struct rtc_time tm;
@@ -182,6 +181,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 	void __user *uarg = (void __user *)arg;
 	int ret = -EINVAL;
 
+	lock_kernel();
 	switch (cmd) {
 	case RTC_ALM_READ:
 		ret = rtc_arm_read_alarm(ops, &alrm);
@@ -276,6 +276,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 			ret = ops->ioctl(cmd, arg);
 		break;
 	}
+	unlock_kernel();
 	return ret;
 }
 
@@ -333,7 +334,7 @@ static const struct file_operations rtc_fops = {
 	.llseek		= no_llseek,
 	.read		= rtc_read,
 	.poll		= rtc_poll,
-	.ioctl		= rtc_ioctl,
+	.unlocked_ioctl	= rtc_ioctl,
 	.open		= rtc_open,
 	.release	= rtc_release,
 	.fasync		= rtc_fasync,
-- 
1.5.4.3.500.g83a2c




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [JANITOR-PATCH] rtc: switch to unlocked_ioctl
  2008-03-04 21:06 [JANITOR-PATCH] rtc: switch to unlocked_ioctl Harvey Harrison
@ 2008-03-04 22:58 ` Jiri Slaby
  2008-03-05 10:16   ` Andi Kleen
  0 siblings, 1 reply; 5+ messages in thread
From: Jiri Slaby @ 2008-03-04 22:58 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: Russell King, Andi Kleen, LKML

Harvey Harrison napsal(a):
> Make the lock/unlock_kernel explicit.
> 
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> ---
>  arch/arm/common/rtctime.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/common/rtctime.c b/arch/arm/common/rtctime.c
> index f53bca4..2062f92 100644
> --- a/arch/arm/common/rtctime.c
> +++ b/arch/arm/common/rtctime.c
> @@ -173,8 +173,7 @@ static unsigned int rtc_poll(struct file *file, poll_table *wait)
>  	return data != 0 ? POLLIN | POLLRDNORM : 0;
>  }
>  
> -static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
> -		     unsigned long arg)
> +static int rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)

long? I guess you need to get a cross-compiler...

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [JANITOR-PATCH] rtc: switch to unlocked_ioctl
  2008-03-04 22:58 ` Jiri Slaby
@ 2008-03-05 10:16   ` Andi Kleen
  2008-03-06  8:16     ` Russell King
  0 siblings, 1 reply; 5+ messages in thread
From: Andi Kleen @ 2008-03-05 10:16 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: Harvey Harrison, Russell King, LKML

On Tuesday 04 March 2008 23:58:01 Jiri Slaby wrote:
> Harvey Harrison napsal(a):
> > Make the lock/unlock_kernel explicit.
> > 
> > Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> > ---
> >  arch/arm/common/rtctime.c |    7 ++++---
> >  1 files changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/arch/arm/common/rtctime.c b/arch/arm/common/rtctime.c
> > index f53bca4..2062f92 100644
> > --- a/arch/arm/common/rtctime.c
> > +++ b/arch/arm/common/rtctime.c
> > @@ -173,8 +173,7 @@ static unsigned int rtc_poll(struct file *file, poll_table *wait)
> >  	return data != 0 ? POLLIN | POLLRDNORM : 0;
> >  }
> >  
> > -static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
> > -		     unsigned long arg)
> > +static int rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
> 
> long? I guess you need to get a cross-compiler...

Yes please do these transformations only for code that you can compile.

One easy way to do that is to do an allyesconfig build once and save the log (or 
fetch http://halobates.de/allyes/i386-2.6.24-rc6-git12 and 
http://halobates.de/allyes/x86_64-2.6.24-rc6-git12 as an older example) 
and always check if the file you're changing is compiled in the log.

Then after changing do at least a make allyesconfig ; make path/to/file.o

-Andi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [JANITOR-PATCH] rtc: switch to unlocked_ioctl
  2008-03-05 10:16   ` Andi Kleen
@ 2008-03-06  8:16     ` Russell King
  2008-03-06  8:19       ` Andi Kleen
  0 siblings, 1 reply; 5+ messages in thread
From: Russell King @ 2008-03-06  8:16 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Jiri Slaby, Harvey Harrison, LKML

On Wed, Mar 05, 2008 at 11:16:45AM +0100, Andi Kleen wrote:
> One easy way to do that is to do an allyesconfig build once and
> save the log

Don't bother.  As I keep saying and have been saying since the all*config
targets were introduced, they're useless for ARM, because ARM is soo
diverse.

You need to find a platform configuration which uses the file.

Eg,

$ grep rtctime arch/arm/common/Makefile
obj-y                           += rtctime.o

In this case, any one will do.

But lets say you modify arch/arm/common/uengine.c:

$ grep uengine arch/arm/common/Makefile
obj-$(CONFIG_ARCH_IXP2000)      += uengine.o
obj-$(CONFIG_ARCH_IXP23XX)      += uengine.o
$ grep CONFIG_ARCH_IXP2000= arch/arm/configs/*
arch/arm/configs/ixp2000_defconfig:CONFIG_ARCH_IXP2000=y
$ grep CONFIG_ARCH_IXP23XX= arch/arm/configs/*
arch/arm/configs/ixp23xx_defconfig:CONFIG_ARCH_IXP23XX=y

So now you know you need to use ixp2000_defconfig or ixp23xx_defconfig as
a basis for building uengine.c.  (which is reasonable because it's an
IXP2000 or IXP2300 specific support file.)

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [JANITOR-PATCH] rtc: switch to unlocked_ioctl
  2008-03-06  8:16     ` Russell King
@ 2008-03-06  8:19       ` Andi Kleen
  0 siblings, 0 replies; 5+ messages in thread
From: Andi Kleen @ 2008-03-06  8:19 UTC (permalink / raw)
  To: Russell King; +Cc: Andi Kleen, Jiri Slaby, Harvey Harrison, LKML

On Thu, Mar 06, 2008 at 08:16:58AM +0000, Russell King wrote:
> On Wed, Mar 05, 2008 at 11:16:45AM +0100, Andi Kleen wrote:
> > One easy way to do that is to do an allyesconfig build once and
> > save the log
> 
> Don't bother.  As I keep saying and have been saying since the all*config
> targets were introduced, they're useless for ARM, because ARM is soo
> diverse.

It's more a white list for x86. Yes it would mean there will be no
such patches for ARM.

-Andi

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-03-06  8:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-04 21:06 [JANITOR-PATCH] rtc: switch to unlocked_ioctl Harvey Harrison
2008-03-04 22:58 ` Jiri Slaby
2008-03-05 10:16   ` Andi Kleen
2008-03-06  8:16     ` Russell King
2008-03-06  8:19       ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).