diff options
author | Christoph Hellwig <hch@lst.de> | 2005-11-12 15:10:54 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-11-12 15:10:54 -0500 |
commit | 535f8d65d808421a6e1730990e39d41885b1f951 (patch) | |
tree | abfa0474dc3442e0584a8173cc6a5b1969556cb1 /drivers | |
parent | 4f005551a8fac21b6fec8d10d57cd12d373d79e1 (diff) |
[SPARC]: Fix RTC compat ioctl kernel log spam.
On Fri, Nov 11, 2005 at 12:58:40PM -0800, David S. Miller wrote:
>
> This change:
>
> diff-tree 8ca2bdc7a98b9584ac5f640761501405154171c7 (from feee207e44d3643d19e648aAuthor: Christoph Hellwig <hch@lst.de>
> Date: Wed Nov 9 12:07:18 2005 -0800
>
> [SPARC] sbus rtc: implement ->compat_ioctl
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: David S. Miller <davem@davemloft.net>
>
> results in the console now getting spewed on sparc64 systems
> with messages like:
>
> [ 11.968298] ioctl32(hwclock:464): Unknown cmd fd(3) cmd(401c7014){00} arg(efc
> What's happening is hwclock tries first the SBUS rtc device ioctls
> then the normal rtc driver ones.
>
> So things actually worked better when we had the SBUS rtc compat ioctl
> directly handled via the generic compat ioctl code.
>
> There are _so_ many rtc drivers in the kernel implementing the
> generic rtc ioctls that I don't think putting a ->compat_ioctl
> into all of them to fix this problem is feasible. Unless we
> write a single rtc_compat_ioctl(), export it to modules, and hook
> it into all of those somehow.
>
> But even that doesn't appear to have any pretty implementation.
>
> Any better ideas?
We had similar problems with other ioctls where userspace did things
like that. What we did there was to put the compat handler to generic
code. The patch below does that, adding a big comment about what's
going on and removing the COMPAT_IOCTL entires for these on powerpc
that not only weren't ever useful but are duplicated now aswell.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/sbus/char/rtc.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/drivers/sbus/char/rtc.c b/drivers/sbus/char/rtc.c index 5774bdd0e26f..9b988baf0b51 100644 --- a/drivers/sbus/char/rtc.c +++ b/drivers/sbus/char/rtc.c | |||
@@ -210,27 +210,6 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
210 | } | 210 | } |
211 | } | 211 | } |
212 | 212 | ||
213 | static long rtc_compat_ioctl(struct file *file, unsigned int cmd, | ||
214 | unsigned long arg) | ||
215 | { | ||
216 | int rval = -ENOIOCTLCMD; | ||
217 | |||
218 | switch (cmd) { | ||
219 | /* | ||
220 | * These two are specific to this driver, the generic rtc ioctls | ||
221 | * are hanlded elsewhere. | ||
222 | */ | ||
223 | case RTCGET: | ||
224 | case RTCSET: | ||
225 | lock_kernel(); | ||
226 | rval = rtc_ioctl(file->f_dentry->d_inode, file, cmd, arg); | ||
227 | unlock_kernel(); | ||
228 | break; | ||
229 | } | ||
230 | |||
231 | return rval; | ||
232 | } | ||
233 | |||
234 | static int rtc_open(struct inode *inode, struct file *file) | 213 | static int rtc_open(struct inode *inode, struct file *file) |
235 | { | 214 | { |
236 | int ret; | 215 | int ret; |
@@ -258,7 +237,6 @@ static struct file_operations rtc_fops = { | |||
258 | .owner = THIS_MODULE, | 237 | .owner = THIS_MODULE, |
259 | .llseek = no_llseek, | 238 | .llseek = no_llseek, |
260 | .ioctl = rtc_ioctl, | 239 | .ioctl = rtc_ioctl, |
261 | .compat_ioctl = rtc_compat_ioctl, | ||
262 | .open = rtc_open, | 240 | .open = rtc_open, |
263 | .release = rtc_release, | 241 | .release = rtc_release, |
264 | }; | 242 | }; |