mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mike Frysinger" <vapier.adi@gmail.com>
To: "David Brownell" <david-b@pacbell.net>
Cc: "Tomas Janousek" <tomi@nomi.cz>,
	linux-kernel@vger.kernel.org,
	"Alessandro Zummo" <alessandro.zummo@towertech.it>
Subject: Re: [PATCH] rtc-dev: stop periodic interrupts on device release
Date: Sat, 26 Jul 2008 23:03:57 -0400	[thread overview]
Message-ID: <8bd0f97a0807262003y4000f55eh45d5d1b8c866fd10@mail.gmail.com> (raw)
In-Reply-To: <200807261350.55524.david-b@pacbell.net>

On Sat, Jul 26, 2008 at 4:50 PM, David Brownell wrote:
> On Saturday 26 July 2008, Tomas Janousek wrote:
>> I am aware that some drivers, like rtc-sh, handle userspace PIE sets in their
>> ioctl op, exporting the irq_set_state op at the same time. The logic in
>> rtc_irq_set_state should make sure it doesn't matter and the driver should not
>> need to care stopping periodic interrupts in its release routine any more.
>> I did not look at other drivers though.
>
> A quick grep shows that out of 42 (wow!) current RTC drivers:
>
>  - rtc-{bfin,sa1100,sh,test} support ioctl(PIE_ON/PIE_OFF), at least
>   before some recent patches fixing that glitch (not in my tree) by
>   switching to irq_set_state().

the rtc-bfin.c patches are in some queue somewhere to fix this ;)

>  - Of those:  rtc-{bfin,s3c,sa1100,sh,vr41xx} all have release()
>   methods ... though it looks to me like most of those wrongly
>   disable *all* IRQs, even ones in use by something other than
>   the /dev client closing that FD.

rtc-bfin.c turns off all irqs and frees it in the release() function
(since the irq is requested in the open() function).  i guess that
isnt supposed to happen huh.

> That suggests there's quite a mess yet to be fixed.  This patch
> will ensure that periodic IRQs get properly shut off by close()
> or exit() of a task that started them.  Those release() methods
> shouldn't then be second-guessing things.
>
> And then there are the other two types of IRQ.  Update IRQs can
> only be enabled through ioctl(UIE_ON), so they're fair game to
> turn off when closing /dev files.  Alarms seem to be a special
> case -- best not touched when closing files.

specific drivers shouldnt worry about this then right ?  handle it in rtc-dev ?
-mike

  reply	other threads:[~2008-07-27  3:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-26 15:46 Tomas Janousek
2008-07-26 17:55 ` Alessandro Zummo
2008-07-26 18:06   ` Tomáš Janoušek
2008-07-26 18:13     ` Alessandro Zummo
2008-07-26 19:58       ` David Brownell
2008-07-26 20:50 ` David Brownell
2008-07-27  3:03   ` Mike Frysinger [this message]
2008-07-27  5:03     ` David Brownell
2008-07-28 20:41   ` Tomáš Janoušek
2008-07-28 20:47     ` Alessandro Zummo
2008-07-28 22:05     ` David Brownell
2008-07-28 23:36       ` Tomáš Janoušek
2008-07-29 20:08         ` David Brownell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8bd0f97a0807262003y4000f55eh45d5d1b8c866fd10@mail.gmail.com \
    --to=vapier.adi@gmail.com \
    --cc=alessandro.zummo@towertech.it \
    --cc=david-b@pacbell.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tomi@nomi.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®