All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rene Herman <rene.herman@keyaccess.nl>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: Ingo Oeser <ioe-lkml@rameria.de>,
	linux-kernel@vger.kernel.org, Takashi Iwai <tiwai@suse.de>,
	Greg KH <gregkh@suse.de>,
	ALSA devel <alsa-devel@alsa-project.org>
Subject: Re: [ALSA STABLE 3/3] a few more -- unregister platform device again if probe was unsuccessful
Date: Thu, 13 Apr 2006 20:47:14 +0200	[thread overview]
Message-ID: <443E9CB2.8020500@keyaccess.nl> (raw)
In-Reply-To: <20060413170549.GB7805@flint.arm.linux.org.uk>

Russell King wrote:

> On Thu, Apr 13, 2006 at 06:17:49PM +0200, Rene Herman wrote:

>> Okay, thanks, that's relevant information. Please explain though
>> what's incorrect about the fact that for these ISA devices on the
>> plain old PC, with nothing other than the driver available to probe
>> for them, just keeping them registered after failing a probe turns
>> /sys/devices/platform into a view of "what drivers did we load".
> 
> If a driver for an ISA device only wants to register a device and
> driver if the hardware exists, it needs to handle behaviour itself
> and not force such behaviour on the upper layers (which is what
> you're arguing for.)

Nono, please note I'm arguing for nothing of the sort. The original 
patch to bus_add_device() to pass up the probe() return was submitted 
with just a "if I do this, things work as I expect. is it correct?" 
question attached. Given that everything uses that same code, it wasn't 
correct. What I am arguing for is that it would be good if the driver 
model provided me the _option_ to fail a registration if the driver 
tells it there are no devices. ie, the flag that I could set that would 
make the driver model interpret an ENODEV from probe() to really mean NODEV.

The current work-around of using drvdata() as a success flag is exactly 
what you say -- ALSA doing it all by itself. This thread specifically 
only started due to Ingo Oeser suggesting that work-around would go into 
platform_device_register_simple()...

>> M'kay. I believe there's one clean way out of this. We could add an "isa 
>> bus", where the _user_ would first need to setup the hardware from 
>> userspace by echoing values into sysfs. Say, something like:
> 
> Maybe this is the best solution for ISA devices - they do appear to
> have differing semantics at the probe level from platform devices.
> Maybe this "discovery" should be part of the bus matching method, prior
> to the driver probe method being called?  With an ISA bus type, you can
> certainly arrange for that to happen without changing existing driver
> model behaviour.

I can try and see if I can come up with something sensible I guess. Will 
need time though...

Takashi: anyways, these patches are good to go. Already saw the ISA 
driver ones present in 1.0.11-rc5. I by the way do not see them in the 
ALSA CVS at http://cvs.sourceforge.net/viewcvs.py/alsa/. How's that?

Rene.



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

WARNING: multiple messages have this Message-ID (diff)
From: Rene Herman <rene.herman@keyaccess.nl>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: Ingo Oeser <ioe-lkml@rameria.de>,
	linux-kernel@vger.kernel.org, Takashi Iwai <tiwai@suse.de>,
	Greg KH <gregkh@suse.de>,
	ALSA devel <alsa-devel@alsa-project.org>
Subject: Re: [ALSA STABLE 3/3] a few more -- unregister platform device again if probe was unsuccessful
Date: Thu, 13 Apr 2006 20:47:14 +0200	[thread overview]
Message-ID: <443E9CB2.8020500@keyaccess.nl> (raw)
In-Reply-To: <20060413170549.GB7805@flint.arm.linux.org.uk>

Russell King wrote:

> On Thu, Apr 13, 2006 at 06:17:49PM +0200, Rene Herman wrote:

>> Okay, thanks, that's relevant information. Please explain though
>> what's incorrect about the fact that for these ISA devices on the
>> plain old PC, with nothing other than the driver available to probe
>> for them, just keeping them registered after failing a probe turns
>> /sys/devices/platform into a view of "what drivers did we load".
> 
> If a driver for an ISA device only wants to register a device and
> driver if the hardware exists, it needs to handle behaviour itself
> and not force such behaviour on the upper layers (which is what
> you're arguing for.)

Nono, please note I'm arguing for nothing of the sort. The original 
patch to bus_add_device() to pass up the probe() return was submitted 
with just a "if I do this, things work as I expect. is it correct?" 
question attached. Given that everything uses that same code, it wasn't 
correct. What I am arguing for is that it would be good if the driver 
model provided me the _option_ to fail a registration if the driver 
tells it there are no devices. ie, the flag that I could set that would 
make the driver model interpret an ENODEV from probe() to really mean NODEV.

The current work-around of using drvdata() as a success flag is exactly 
what you say -- ALSA doing it all by itself. This thread specifically 
only started due to Ingo Oeser suggesting that work-around would go into 
platform_device_register_simple()...

>> M'kay. I believe there's one clean way out of this. We could add an "isa 
>> bus", where the _user_ would first need to setup the hardware from 
>> userspace by echoing values into sysfs. Say, something like:
> 
> Maybe this is the best solution for ISA devices - they do appear to
> have differing semantics at the probe level from platform devices.
> Maybe this "discovery" should be part of the bus matching method, prior
> to the driver probe method being called?  With an ISA bus type, you can
> certainly arrange for that to happen without changing existing driver
> model behaviour.

I can try and see if I can come up with something sensible I guess. Will 
need time though...

Takashi: anyways, these patches are good to go. Already saw the ISA 
driver ones present in 1.0.11-rc5. I by the way do not see them in the 
ALSA CVS at http://cvs.sourceforge.net/viewcvs.py/alsa/. How's that?

Rene.


  reply	other threads:[~2006-04-13 18:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-13  1:46 [ALSA STABLE 3/3] a few more -- unregister platform device again if probe was unsuccessful Rene Herman
2006-04-13  9:26 ` Ingo Oeser
2006-04-13  9:31   ` Russell King
2006-04-13 14:05   ` Rene Herman
2006-04-13 14:05   ` Rene Herman
2006-04-13 14:57     ` Russell King
2006-04-13 16:17       ` Rene Herman
2006-04-13 16:17       ` Rene Herman
2006-04-13 17:05         ` Russell King
2006-04-13 17:05         ` Russell King
2006-04-13 18:47           ` Rene Herman [this message]
2006-04-13 18:47             ` Rene Herman
2006-04-13 22:02           ` Greg KH
2006-04-13 22:02           ` Greg KH
2006-04-13 23:12             ` Rene Herman
2006-04-13 23:12               ` Rene Herman
2006-04-15 13:16               ` Takashi Iwai
2006-04-15 13:16                 ` Takashi Iwai
2006-04-13 14:57     ` Russell King
  -- strict thread matches above, loose matches on Subject: below --
2006-04-13  1:46 Rene Herman

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=443E9CB2.8020500@keyaccess.nl \
    --to=rene.herman@keyaccess.nl \
    --cc=alsa-devel@alsa-project.org \
    --cc=gregkh@suse.de \
    --cc=ioe-lkml@rameria.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+lkml@arm.linux.org.uk \
    --cc=tiwai@suse.de \
    /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.