public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Dominik Brodowski <linux-JhLEnvuH02M@public.gmane.org>
To: "Grover, Andrew" <andrew.grover-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: "'Cagle,
	John (ISS-Houston)'" <john.cagle-VXdhtT5mjnY@public.gmane.org>,
	acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: RE: 'rmmod button' doesn't remove /proc/acpi/button
Date: Mon, 11 Nov 2002 21:49:26 +0100	[thread overview]
Message-ID: <20021111214926.B801@brodo.de> (raw)
In-Reply-To: <EDC461A30AC4D511ADE10002A5072CAD04C7A4E9-OU+JdkIUtvd9zuciVAfUoVDQ4js95KgL@public.gmane.org>; from andrew.grover-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org on Mon, Nov 11, 2002 at 12:01:35PM -0800

On Mon, Nov 11, 2002 at 12:01:35PM -0800, Grover, Andrew wrote:
> > From: Cagle, John (ISS-Houston) [mailto:john.cagle-VXdhtT5mjnY@public.gmane.org] 
> > I found a minor bug in button.c's acpi_button_exit() routine. 
> >  It doesn't remove the top-level 'button' directory when 
> > unloading the module, and if you insmod/rmmod multiple times, 
> > you'll end up with lots of 'button' directories in /proc/acpi.
> 
> This actually reveals a bug in *all* of the client drivers. They all depend
> upon a global variable with the name acpi_{battery,button,etc}_dir to see if
> they need to make their class proc entry when adding their first device.
> This has the benefit of only creating a "button" directory if there actually
> is a button, but has the bad feature of not working for insmod...because the
> global variables go away, and so we blindly add the proc entries again.
> 
> I think the best thing is to make the semantics "the proc dir is there if
> the driver is loaded, even with no devices present" instead of "the proc dir
> is there only if an actual instance of the device is present".
> 
> This allows us to move the creation of the dir to the driver init function,
> instead of the device add function.

Actually, I think this would confuse users even more than currently: If an
OSPM-module is loaded, but no entry is found in the DSDT (or anywhere), it
is still loaded; doesn't complain in dmesg (actually, doesn't add any output
to dmesg) and so causes some users to think "well, everything seems to be
working fine". Now, if the proc dir is added even if no such device is
added, the confusion enlargens.

Instead, I'd propose adding an acpi_{battery,button,etc}_dir_count, and when
this reaches zero in acpi_button_remove_fs(), for example, remove_proc_entry
the acpi_button_dir.

	Dominik 
who is very busy at the moment, else I'd write a patch :-)


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

  parent reply	other threads:[~2002-11-11 20:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-11 20:01 'rmmod button' doesn't remove /proc/acpi/button Grover, Andrew
     [not found] ` <EDC461A30AC4D511ADE10002A5072CAD04C7A4E9-OU+JdkIUtvd9zuciVAfUoVDQ4js95KgL@public.gmane.org>
2002-11-11 20:49   ` Dominik Brodowski [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-11-11 20:24 Cagle, John (ISS-Houston)
2002-11-11 20:48 Grover, Andrew
2002-11-11 23:00 Cagle, John (ISS-Houston)

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=20021111214926.B801@brodo.de \
    --to=linux-jhlenvuh02m@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=andrew.grover-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=john.cagle-VXdhtT5mjnY@public.gmane.org \
    /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