All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <tom.leiming@gmail.com>
To: Samu Onkalo <samu.p.onkalo@nokia.com>
Cc: gregkh@suse.de, hmh@hmh.eng.br, alan@linux.intel.com,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] device-core: sysfs open - close notify
Date: Mon, 1 Nov 2010 00:14:04 +0800	[thread overview]
Message-ID: <AANLkTikRSF-4o=Jnyg2_Wa4gg7E+s_tM9ZD3g+f7hyWm@mail.gmail.com> (raw)
In-Reply-To: <1288529170-28890-1-git-send-email-samu.p.onkalo@nokia.com>

2010/10/31 Samu Onkalo <samu.p.onkalo@nokia.com>:
> Device drivers have no idea when somebody in userspace keeps some sysfs entry
> open. The driver just received read or write calls. The driver may want to
> control HW state based on activity so it either have to turn HW on and off
> for each sysfs access or it needs separate enable disable entry which controls
> the HW state. In cases where sysfs is used to pass some events under interrupt
> control (like proximity events from the proximity sensors) it is not enough to
> just keep sysfs entry open in userspace.

Since very few drivers have this kind of requirement, why not take notifier
call chain mechanism to do such thing? eg. register a notifier function
if the driver is interested in such kind of open/close events.

Your patch may cause many unnecessary memory waste because
most of drivers does not need attribute file .open/.close notifier.


thanks,
-- 
Lei Ming

  reply	other threads:[~2010-10-31 16:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-31 12:46 [RFC PATCH] device-core: sysfs open - close notify Samu Onkalo
2010-10-31 16:14 ` Ming Lei [this message]
2010-11-01 17:11   ` Alan Cox
2010-11-02  6:30     ` Onkalo Samu
2010-11-16  3:14       ` Enrico Weigelt

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='AANLkTikRSF-4o=Jnyg2_Wa4gg7E+s_tM9ZD3g+f7hyWm@mail.gmail.com' \
    --to=tom.leiming@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@linux.intel.com \
    --cc=gregkh@suse.de \
    --cc=hmh@hmh.eng.br \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samu.p.onkalo@nokia.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.