The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH] perf: sysfs type id
Date: Wed, 10 Nov 2010 12:45:44 +1100	[thread overview]
Message-ID: <1289353544.22787.49.camel@concordia> (raw)
In-Reply-To: <AANLkTin_VixECn4AdQW_xC=_5ZNY5wBsif6cW5dDEJFe@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3050 bytes --]

On Wed, 2010-11-10 at 02:19 +0100, Kay Sievers wrote:
> On Wed, Nov 10, 2010 at 02:10, Michael Ellerman <michael@ellerman.id.au> wrote:
> > On Wed, 2010-11-10 at 01:57 +0100, Kay Sievers wrote:
> >> Stay on the list please, with any possible reply. Thanks!
> >
> > You dropped the CC when you replied, or is my mailer being weird?
> 
> You replied to me only:
>   From: Michael Ellerman <michael@ellerman.id.au>
>   To: Kay Sievers <kay.sievers@vrfy.org>

Because you replied to me only, or at least that's what I see at my end.

> >> On Wed, Nov 10, 2010 at 01:52, Michael Ellerman <michael@ellerman.id.au> wrote:
> >> > On Wed, 2010-11-10 at 00:45 +0100, Kay Sievers wrote:
> >> The pseudo-convenience device_register/device_unregister should also
> >> not be used.
> >
> > Why are they in the tree if they shouldn't be used?
> 
> Because they save one line and do improper error handling.
> They should all be converted to device_init+device_add/device_del/device_put.

I don't see device_init(), or do you mean device_initialize()? It
returns void?

> > So far you are failing to dispel my notion that sysfs is a place where
> > mortals dare not tread ;)
> 
> Oh, you are welcome to join the endless fixing rounds. Most of the
> weird stuff if from people who moved to islands far away and never
> touched any Linux code anymore (no kidding). :)

Yeah fair enough :)

It is a pet peeve of mine when APIs are "deprecated" but no where is
that documented, least of all by using __deprecated. I guess that's
because it spews warnings, maybe we need __future_deprecated or
something.

> >> > And I'm looking at eg. drivers/usb/serial/bus.c as an example bus.
> >> >
> >> > But in my case (and I think perf too), we don't need a bus that probes
> >> > etc. it's just a virtual bus that groups things, so it seems like it
> >> > should be simple.
> >> >
> >> > Anyway I feel like I'm missing something, so hopefully you can clue me
> >> > in :)
> >>
> >> Buses without drivers do not probe at all, they behave like classes.
> >
> > OK, good, that would seem to be a prerequisite for replacing the latter
> > with the former.
> >
> > I'm just not clear on how that actually works in the code. For example I
> > have a device which is on a bus (that's how it got probed), how do I
> > also put it on another bus (my virtual bus replacing my class) ?
> 
> Nothing gets probed ever, if no driver is registered. To get a device
> on a bus, just assign the bus to the 'struct device' before calling
> device_add, that's all.

Cool, that sounds simple enough.

> Devices can never be on two subsystems at the same time. Not with
> classes, not with buses, that was never, and probably will never be
> possible.

OK, I guess I'm getting my terminology wrong. My devices, which show up
in /sys/class/foo are symlinks into /sys/devices/virtual/foo, so they
_appear_ to be in two places.

I also see entries for example in /sys/class/scsi_disk that link
into /sys/devices/pci.

cheers


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2010-11-10  1:45 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-09 21:45 [RFC][PATCH] perf: sysfs type id Peter Zijlstra
2010-11-09 22:11 ` Kay Sievers
2010-11-09 22:22   ` Peter Zijlstra
2010-11-09 22:40     ` Kay Sievers
2010-11-09 22:13 ` Greg KH
2010-11-09 23:36   ` Michael Ellerman
     [not found]     ` <AANLkTi=UftgQn0ydRd2wszqFtpRrkEcW7dzfapKKix_V@mail.gmail.com>
     [not found]       ` <1289350360.22787.9.camel@concordia>
     [not found]         ` <AANLkTikGHNkUN6t9rPhdE6XOQiqb5xAzH_9eY6L9h2H2@mail.gmail.com>
2010-11-10  1:10           ` Michael Ellerman
2010-11-10  1:19             ` Kay Sievers
2010-11-10  1:45               ` Michael Ellerman [this message]
2010-11-10  1:59                 ` Kay Sievers
2010-11-10  3:37                   ` Michael Ellerman
2010-11-10  2:11                 ` Kay Sievers
2010-11-10 17:31     ` Greg KH
2010-11-10 12:27   ` Peter Zijlstra
2010-11-10 13:36     ` sysfs: Add an 'events' class. (was: Re: [RFC][PATCH] perf: sysfs type id) Ingo Molnar
2010-11-10 14:14       ` Kay Sievers
2010-11-10 15:00         ` Ingo Molnar
2010-11-11  6:39           ` Kay Sievers
2010-11-10 13:01 ` [RFC][PATCH] perf: sysfs type id Stephane Eranian
2010-11-10 14:10   ` Peter Zijlstra
2010-11-10 14:19     ` Peter Zijlstra
2010-11-10 20:08       ` Stephane Eranian
2010-11-10 20:32         ` Peter Zijlstra
2010-11-10 20:53           ` Stephane Eranian
2010-11-10 21:05             ` Peter Zijlstra
2010-11-17  2:35               ` Corey Ashford
2010-11-17  7:02                 ` Kyle Moffett
2010-11-17 11:30                   ` Peter Zijlstra
2010-11-17 11:25                 ` Peter Zijlstra
2010-11-17 19:47                   ` Corey Ashford
2010-11-17 19:57                     ` Peter Zijlstra
2010-11-17 20:01                       ` Peter Zijlstra
2010-11-17 21:39                         ` Corey Ashford
2010-11-10 14:24     ` Stephane Eranian

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=1289353544.22787.49.camel@concordia \
    --to=michael@ellerman.id.au \
    --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