From: Grant Likely <grant.likely@secretlab.ca>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: Greg KH <gregkh@suse.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Export device_add_attributes() so drivers can use it.
Date: Thu, 26 Feb 2009 16:52:58 -0700 [thread overview]
Message-ID: <fa686aa40902261552ibc36057p5e9173a0f8a5a8dd@mail.gmail.com> (raw)
In-Reply-To: <ac3eb2510902261428n297063f5webb06fc105e5ef0a@mail.gmail.com>
Thanks, this is exactly what I want. I'll read through and write up a
little blurb to describe the recommended model.
g.
On Thu, Feb 26, 2009 at 3:28 PM, Kay Sievers <kay.sievers@vrfy.org> wrote:
> On Fri, Feb 20, 2009 at 16:28, Grant Likely <grant.likely@secretlab.ca> wrote:
>> Thanks for the reply, it clarifies a lot. It sounds like this really
>> should be documented (in Documentation/driver-model/device.txt?). I'm
>> happy to add a blurb to that effect and send a patch, but I want to
>> make sure I really understand the model before I do so. I've got a
>> couple more questions below:
>>
>> On Thu, Feb 19, 2009 at 4:08 PM, Kay Sievers <kay.sievers@vrfy.org> wrote:
>> [...]
>>> If an attribute is not available at event time, nothing of this can
>>> ever work. If you look a the device a second later, you will see the
>>> proper looking files and values, and all the test programs will work,
>>> but it will always fail at device creation.
>> [...]
>>> That all might not be needed for your specific setup/driver/device and
>>> may work fine for your need. But we don't want to encourage anybody
>>> with another new API which creates the usual trouble we need to fix
>>> later.
>>
>> Fair enough
>>
>>> And we need to fix things like this all the time.
>>
>> Can you point me at a 'textbook' example of one of these fixups?
>
> Here are a few cases of broken atribute timing, a quick git search has found:
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f7120a4f75168df3c02efacd10403a4ba0bcb29d
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8a89efd18aa15bb832778baa4e6eee3857ecada4
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3b23dd6f8a718e5339de4f7d86ce76a078b5f771
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2e5f10e4f0a9649186d8a8c793822b2e0dae8373
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bfd129445f23c037d9a440ebfa4109e11c220301
>
> Regarding the split of the driver device and the device to bind to:
> the platform stuff is kind of "special", because it is often used for
> devices/buses which can not be enumerated. With buses which need
> enumeration, it's pretty obvious that the enumeration creates their
> own devices, which then a driver can bind to, and where the driver
> creates its own driver instance for it. Like nobody would expect a
> network driver to add the netif properties directly to the pci device,
> and so on.
>
> Many platform devices are just static placeholders, and then it is not
> obvious that userspace still prefers another device instance while
> binding a driver, but in most cases it's worth the effort, because
> then all devices, regardless which bus is backing them, can be handled
> the same way with a "hotplug handler" like udev.
>
> Thanks,
> Kay
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
next prev parent reply other threads:[~2009-02-26 23:53 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-18 15:11 Grant Likely
2009-02-18 15:29 ` Greg KH
2009-02-18 15:45 ` Kay Sievers
2009-02-18 15:48 ` Grant Likely
2009-02-18 15:53 ` Kay Sievers
2009-02-18 16:34 ` Grant Likely
2009-02-18 16:49 ` Kay Sievers
2009-02-18 17:51 ` Grant Likely
2009-02-18 18:32 ` Kay Sievers
2009-02-18 18:39 ` Greg KH
2009-02-18 19:14 ` Kay Sievers
2009-02-19 6:50 ` Grant Likely
2009-02-19 23:08 ` Kay Sievers
2009-02-20 15:28 ` Grant Likely
2009-02-20 18:35 ` Greg KH
2009-02-26 22:28 ` Kay Sievers
2009-02-26 23:52 ` Grant Likely [this message]
2009-02-18 15:46 ` Grant Likely
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=fa686aa40902261552ibc36057p5e9173a0f8a5a8dd@mail.gmail.com \
--to=grant.likely@secretlab.ca \
--cc=gregkh@suse.de \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®