mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Kay Sievers" <kay.sievers@vrfy.org>
To: "Peter Osterlund" <petero2@telia.com>
Cc: "Greg KH" <greg@kroah.com>, Nix <nix@esperi.org.uk>,
	linux-kernel@vger.kernel.org, a.zummo@towertech.it
Subject: Re: pktcdvd -> sysfs warning with 2.6.27
Date: Wed, 15 Oct 2008 00:32:23 +0200	[thread overview]
Message-ID: <ac3eb2510810141532m508fab47v8abc87f09ffa4cc7@mail.gmail.com> (raw)
In-Reply-To: <m3d4i32bs8.fsf@telia.com>

On Tue, Oct 14, 2008 at 9:53 PM, Peter Osterlund <petero2@telia.com> wrote:
> Kay Sievers <kay.sievers@vrfy.org> writes:
>> On Tue, 2008-10-14 at 10:38 +0200, Kay Sievers wrote:
>>> On Tue, Oct 14, 2008 at 7:27 AM, Peter Osterlund <petero2@telia.com> wrote:
>>> > Greg KH <greg@kroah.com> writes:
>>> >
>>> >> Both of those should get "real" majors assigned to them.  It's not ok to
>>> >> randomly go grabbing major:minor numbers like this for code that is in
>>> >> mainline.
>>> >
>>> > It's not about random grabbing. It's about getting a dynamically
>>> > assigned number. The pktcdvd driver once had static numbers, but at
>>> > the time when the driver was merged into the mainline kernel, dynamic
>>> > numbers were considered better. Therefore I changed the driver to use
>>> > dynamic numbers.
>>>
>>> The pktcdvd driver allocates a dynamic block major, which is fine. But
>>> doesn't it use the same number, and now not allocated, for the char
>>> devices it uses? That looks like something that needs to fixed, right?
>>>
>>>   static void pkt_sysfs_dev_new(struct pktcdvd_device *pd)
>>>   {
>>>     if (class_pktcdvd) {
>>>       pd->dev = device_create_drvdata(class_pktcdvd, NULL,
>>>                                                 pd->pkt_dev, NULL,
>>>                                                 "%s", pd->name);
>>
>> Something similar to this, with error checking, might be needed. It has
>> two independent majors now in block and char:
>>   $ grep pkt /proc/devices
>>   251 pktcdvd-char
>>   252 pktcdvd
>
> Maybe, but that character device would not be used for anything,
> besides creating sub-directories in /sys/class/pktcdvd. The driver
> implements a block device, not a character device.

Ah, if the char device nodes are dead anyway, care to change it to
MKDEV(0, 0), so we get rid of the warnings? This should also go into
-stable I guess, after it's fixed in the current tree.

> Is it possible to create a custom directory in sysfs corresponding to
> a block device? A directory /sys/block/pktcdvd0 is apparently created
> automatically, but is it possible to extend that directory with driver
> specific data?

A named (will automatically created in a subdir) sysfs attribute group
below the block device maybe?
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=include/linux/sysfs.h;h=37fa24152bd810f7d9dd67b685e738179b5bfdf9;hb=HEAD#l33

Thanks,
Kay

      reply	other threads:[~2008-10-14 22:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-12 12:26 Nix
2008-10-12 18:17 ` Greg KH
2008-10-12 20:25   ` Nix
2008-10-12 22:18     ` Greg KH
2008-10-12 22:36       ` Nix
2008-10-13 10:27   ` Philip Martin
2008-10-13 21:28   ` Nix
2008-10-13 21:47     ` Greg KH
2008-10-13 22:01       ` Alessandro Zummo
2008-10-13 22:03       ` Nix
2008-10-14  5:27       ` Peter Osterlund
2008-10-14  8:38         ` Kay Sievers
2008-10-14  9:20           ` Kay Sievers
2008-10-14 19:53             ` Peter Osterlund
2008-10-14 22:32               ` Kay Sievers [this message]

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=ac3eb2510810141532m508fab47v8abc87f09ffa4cc7@mail.gmail.com \
    --to=kay.sievers@vrfy.org \
    --cc=a.zummo@towertech.it \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nix@esperi.org.uk \
    --cc=petero2@telia.com \
    /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®