public inbox for linux-kernel@vger.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 18:17:49 +0200	[thread overview]
Message-ID: <443E79AD.50505@keyaccess.nl> (raw)
In-Reply-To: <20060413145756.GA29959@flint.arm.linux.org.uk>

Russell King wrote:

> On Thu, Apr 13, 2006 at 04:05:33PM +0200, Rene Herman wrote:

>> Not honouring/passing up probe() method error returns, not even -ENODEV, 
>> makes some sense for discoverable busses such as PCI where you at least 
>> have a driver independent bus_id sitting in /sys/devices/pci* that you 
>> can later echo into /sys/bus/pci/drivers/*/bind to make the driver bind 
>> to a device, but not much sense for the platform bus. Platform devices 
>> only "exist" (in /sys/devices/platform) due to the driver creating them 
>> itself and keeping them after failing a probe means that directory 
>> becomes an enumeration of the drivers we loaded, rather than a view of 
>> what's present in the system.
> 
> Incorrect.  In some circumstances, they may be created by architecture
> support code, and might be created and destroyed dynamically by
> architecture support code.

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".

>> The driver model crowd did not seem exceedingly interested in the 
>> problem though:
>>
>> http://marc.theaimsgroup.com/?l=linux-kernel&m=114417829014332&w=2
> 
> Incorrect summary.  The ALSA use model of the driver model doesn't fit
> with the driver model use model.  It's not that we're not interested
> in it - it's that it's perverted to the way driver model folk intend
> the subsystem to work, and the way that platform devices are used on
> some architectures.

And I take it that interest is reflected in getting a grand total of 0 
comments from anyone on my own feeble attempts to suggest things in that 
thread such as the settable flag that would make the driver model pass 
up the error return from probe when set, or having an additional 
.discover method, or ..

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:

echo -n foo		>/sys/devices/isa0/new
echo -n "io 0x220"	>/sys/devices/isa0/foo/resources
echo -n "irq 5"		>/sys/devices/isa0/foo/resources
echo -n "dma 1"		>/sys/devices/isa0/foo/resources

and so on. The type of resources would be modelled after ISA-PnP (and to 
make them more equal, you could do multiple device id's per bus id, card 
id's, in PNP lingo, but this principle at least)

The driver would them request id "foo" as an agreed upon ID (snd-sb8 
would request "sb8", say) or we could pass in the id as a module parameter.

I actually think this would be Great. Comments? Pitchforks?

 From the driver's standpoint, there would not be a difference with 
ISA-PnP anymore other than ISA-PnP also providing for the possibilty to 
change them -- something which ALSA also uses, but which it should 
probably not; has annoyed me for some time. We could then in fact also 
integrate this into ISA-PnP itself, using PnP-like device IDs and all, 
so that from the driver's standpoint, it _is_ always speaking to an 
ISA-PnP device.

Rene.

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

Thread overview: 11+ 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:57     ` Russell King
2006-04-13 16:17       ` Rene Herman [this message]
2006-04-13 17:05         ` Russell King
2006-04-13 18:47           ` Rene Herman
2006-04-13 22:02           ` Greg KH
2006-04-13 23:12             ` Rene Herman
2006-04-15 13:16               ` Takashi Iwai

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=443E79AD.50505@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox