* [PATCH] CCISS: Don't print driver version until we actually find a device
@ 2006-07-25 22:36 Bjorn Helgaas
2006-07-25 22:43 ` Jesper Juhl
2006-07-26 14:22 ` Miller, Mike (OS Dev)
0 siblings, 2 replies; 11+ messages in thread
From: Bjorn Helgaas @ 2006-07-25 22:36 UTC (permalink / raw)
To: Andrew Morton; +Cc: Mike Miller, iss_storagedev, linux-kernel
If we don't find any devices, we shouldn't print anything.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Index: work-mm2/drivers/block/cciss.c
===================================================================
--- work-mm2.orig/drivers/block/cciss.c 2006-07-20 16:27:34.000000000 -0600
+++ work-mm2/drivers/block/cciss.c 2006-07-25 16:16:27.000000000 -0600
@@ -3109,12 +3109,16 @@
static int __devinit cciss_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
+ static int cciss_version_printed = 0;
request_queue_t *q;
int i;
int j;
int rc;
int dac;
+ if (cciss_version_printed++ == 0)
+ printk(KERN_INFO DRIVER_NAME "\n");
+
i = alloc_cciss_hba();
if (i < 0)
return -1;
@@ -3370,9 +3374,6 @@
*/
static int __init cciss_init(void)
{
- printk(KERN_INFO DRIVER_NAME "\n");
-
- /* Register for our PCI devices */
return pci_register_driver(&cciss_pci_driver);
}
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] CCISS: Don't print driver version until we actually find a device
2006-07-25 22:36 [PATCH] CCISS: Don't print driver version until we actually find a device Bjorn Helgaas
@ 2006-07-25 22:43 ` Jesper Juhl
2006-07-25 22:47 ` Arjan van de Ven
2006-07-26 14:22 ` Miller, Mike (OS Dev)
1 sibling, 1 reply; 11+ messages in thread
From: Jesper Juhl @ 2006-07-25 22:43 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: Andrew Morton, Mike Miller, iss_storagedev, linux-kernel
On 26/07/06, Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:
> If we don't find any devices, we shouldn't print anything.
>
I disagree.
I find it quite nice to be able to see that the driver loaded even if
it finds nothing. At least then when there's a problem, I can quickly
see that at least it is not because I didn't forget to load the
driver, it's something else. Saves time since I can start looking for
reasons why the driver didn't find anything without first spending
additional time checking if I failed to cause it to load for some
reason.
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] CCISS: Don't print driver version until we actually find a device
2006-07-25 22:43 ` Jesper Juhl
@ 2006-07-25 22:47 ` Arjan van de Ven
2006-07-25 22:51 ` Bjorn Helgaas
2006-07-26 4:41 ` Jeff Garzik
0 siblings, 2 replies; 11+ messages in thread
From: Arjan van de Ven @ 2006-07-25 22:47 UTC (permalink / raw)
To: Jesper Juhl
Cc: Bjorn Helgaas, Andrew Morton, Mike Miller, iss_storagedev,
linux-kernel
On Wed, 2006-07-26 at 00:43 +0200, Jesper Juhl wrote:
> On 26/07/06, Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:
> > If we don't find any devices, we shouldn't print anything.
> >
> I disagree.
> I find it quite nice to be able to see that the driver loaded even if
> it finds nothing. At least then when there's a problem, I can quickly
> see that at least it is not because I didn't forget to load the
> driver, it's something else. Saves time since I can start looking for
> reasons why the driver didn't find anything without first spending
> additional time checking if I failed to cause it to load for some
> reason.
I'll add a second reason: it is a REALLY nice property to be able to see
which driver is started last in case of a crash/hang, so that the guilty
party is more obvious..
>
>
--
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] CCISS: Don't print driver version until we actually find a device
2006-07-25 22:47 ` Arjan van de Ven
@ 2006-07-25 22:51 ` Bjorn Helgaas
2006-07-25 22:53 ` Jesper Juhl
2006-07-26 4:41 ` Jeff Garzik
1 sibling, 1 reply; 11+ messages in thread
From: Bjorn Helgaas @ 2006-07-25 22:51 UTC (permalink / raw)
To: Arjan van de Ven
Cc: Jesper Juhl, Andrew Morton, Mike Miller, iss_storagedev,
linux-kernel
On Tuesday 25 July 2006 16:47, Arjan van de Ven wrote:
> On Wed, 2006-07-26 at 00:43 +0200, Jesper Juhl wrote:
> > On 26/07/06, Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:
> > > If we don't find any devices, we shouldn't print anything.
> > >
> > I disagree.
> > I find it quite nice to be able to see that the driver loaded even if
> > it finds nothing. At least then when there's a problem, I can quickly
> > see that at least it is not because I didn't forget to load the
> > driver, it's something else. Saves time since I can start looking for
> > reasons why the driver didn't find anything without first spending
> > additional time checking if I failed to cause it to load for some
> > reason.
>
> I'll add a second reason: it is a REALLY nice property to be able to see
> which driver is started last in case of a crash/hang, so that the guilty
> party is more obvious..
initcall_debug is a more reliable way to find that. Do you want
all drivers to print something in their init function? Right now,
there's really no consistency. My guess is that the majority don't
print anything until a device is found. But I admit I didn't try
to count them.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] CCISS: Don't print driver version until we actually find a device
2006-07-25 22:51 ` Bjorn Helgaas
@ 2006-07-25 22:53 ` Jesper Juhl
0 siblings, 0 replies; 11+ messages in thread
From: Jesper Juhl @ 2006-07-25 22:53 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Arjan van de Ven, Andrew Morton, Mike Miller, iss_storagedev,
linux-kernel
On 26/07/06, Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:
> On Tuesday 25 July 2006 16:47, Arjan van de Ven wrote:
> > On Wed, 2006-07-26 at 00:43 +0200, Jesper Juhl wrote:
> > > On 26/07/06, Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:
> > > > If we don't find any devices, we shouldn't print anything.
> > > >
> > > I disagree.
> > > I find it quite nice to be able to see that the driver loaded even if
> > > it finds nothing. At least then when there's a problem, I can quickly
> > > see that at least it is not because I didn't forget to load the
> > > driver, it's something else. Saves time since I can start looking for
> > > reasons why the driver didn't find anything without first spending
> > > additional time checking if I failed to cause it to load for some
> > > reason.
> >
> > I'll add a second reason: it is a REALLY nice property to be able to see
> > which driver is started last in case of a crash/hang, so that the guilty
> > party is more obvious..
>
> initcall_debug is a more reliable way to find that. Do you want
> all drivers to print something in their init function?
It's not my call, but that would be my personal preference, yes.
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] CCISS: Don't print driver version until we actually find a device
[not found] ` <6CDSZ-h7-9@gated-at.bofh.it>
@ 2006-07-25 23:14 ` Bodo Eggert
0 siblings, 0 replies; 11+ messages in thread
From: Bodo Eggert @ 2006-07-25 23:14 UTC (permalink / raw)
To: Jesper Juhl, Bjorn Helgaas, Andrew Morton, Mike Miller,
iss_storagedev, linux-kernel
Jesper Juhl <jesper.juhl@gmail.com> wrote:
> On 26/07/06, Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:
>> If we don't find any devices, we shouldn't print anything.
>>
> I disagree.
> I find it quite nice to be able to see that the driver loaded even if
> it finds nothing. At least then when there's a problem, I can quickly
> see that at least it is not because I didn't forget to load the
> driver, it's something else. Saves time since I can start looking for
> reasons why the driver didn't find anything without first spending
> additional time checking if I failed to cause it to load for some
> reason.
I disagree differently: the driver version is a function of the kernel
version, and the load status can easily be obtained. Therefore I suggest
never printing the version number from in-kernel drivers.
Maybe adding a debug kernel parameter that will cause module loads to be more
verbose for all modules is more reasonable.
--
Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF
verbreiteten Lügen zu sabotieren.
http://david.woodhou.se/why-not-spf.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] CCISS: Don't print driver version until we actually find a device
2006-07-25 22:47 ` Arjan van de Ven
2006-07-25 22:51 ` Bjorn Helgaas
@ 2006-07-26 4:41 ` Jeff Garzik
2006-07-27 13:01 ` Dmitry Torokhov
1 sibling, 1 reply; 11+ messages in thread
From: Jeff Garzik @ 2006-07-26 4:41 UTC (permalink / raw)
To: Arjan van de Ven
Cc: Jesper Juhl, Bjorn Helgaas, Andrew Morton, Mike Miller,
iss_storagedev, linux-kernel
Arjan van de Ven wrote:
> On Wed, 2006-07-26 at 00:43 +0200, Jesper Juhl wrote:
>> On 26/07/06, Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:
>>> If we don't find any devices, we shouldn't print anything.
>>>
>> I disagree.
>> I find it quite nice to be able to see that the driver loaded even if
>> it finds nothing. At least then when there's a problem, I can quickly
>> see that at least it is not because I didn't forget to load the
>> driver, it's something else. Saves time since I can start looking for
>> reasons why the driver didn't find anything without first spending
>> additional time checking if I failed to cause it to load for some
>> reason.
>
> I'll add a second reason: it is a REALLY nice property to be able to see
> which driver is started last in case of a crash/hang, so that the guilty
> party is more obvious..
OTOH, it is not a property that scales well at all.
When you build extra drivers into the kernel, or distros load drivers
you don't need (_every_ distro does this), you wind up with a bunch of
version strings for drivers for hardware you don't have.
Jeff
^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: [PATCH] CCISS: Don't print driver version until we actually find a device
2006-07-25 22:36 [PATCH] CCISS: Don't print driver version until we actually find a device Bjorn Helgaas
2006-07-25 22:43 ` Jesper Juhl
@ 2006-07-26 14:22 ` Miller, Mike (OS Dev)
1 sibling, 0 replies; 11+ messages in thread
From: Miller, Mike (OS Dev) @ 2006-07-26 14:22 UTC (permalink / raw)
To: Helgaas, Bjorn, Andrew Morton; +Cc: ISS StorageDev, linux-kernel
> -----Original Message-----
> From: Helgaas, Bjorn
> Sent: Tuesday, July 25, 2006 5:37 PM
> To: Andrew Morton
> Cc: Miller, Mike (OS Dev); ISS StorageDev;
> linux-kernel@vger.kernel.org
> Subject: [PATCH] CCISS: Don't print driver version until we
> actually find a device
>
> If we don't find any devices, we shouldn't print anything.
>
> Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Mike Miller <mike.miller@hp.com>
>
> Index: work-mm2/drivers/block/cciss.c
> ===================================================================
> --- work-mm2.orig/drivers/block/cciss.c 2006-07-20
> 16:27:34.000000000 -0600
> +++ work-mm2/drivers/block/cciss.c 2006-07-25
> 16:16:27.000000000 -0600
> @@ -3109,12 +3109,16 @@
> static int __devinit cciss_init_one(struct pci_dev *pdev,
> const struct pci_device_id *ent) {
> + static int cciss_version_printed = 0;
> request_queue_t *q;
> int i;
> int j;
> int rc;
> int dac;
>
> + if (cciss_version_printed++ == 0)
> + printk(KERN_INFO DRIVER_NAME "\n");
> +
> i = alloc_cciss_hba();
> if (i < 0)
> return -1;
> @@ -3370,9 +3374,6 @@
> */
> static int __init cciss_init(void)
> {
> - printk(KERN_INFO DRIVER_NAME "\n");
> -
> - /* Register for our PCI devices */
> return pci_register_driver(&cciss_pci_driver);
> }
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] CCISS: Don't print driver version until we actually find a device
2006-07-26 4:41 ` Jeff Garzik
@ 2006-07-27 13:01 ` Dmitry Torokhov
2006-07-27 13:28 ` gmu 2k6
0 siblings, 1 reply; 11+ messages in thread
From: Dmitry Torokhov @ 2006-07-27 13:01 UTC (permalink / raw)
To: Jeff Garzik
Cc: Arjan van de Ven, Jesper Juhl, Bjorn Helgaas, Andrew Morton,
Mike Miller, iss_storagedev, linux-kernel
On 7/26/06, Jeff Garzik <jeff@garzik.org> wrote:
> Arjan van de Ven wrote:
> > On Wed, 2006-07-26 at 00:43 +0200, Jesper Juhl wrote:
> >> On 26/07/06, Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:
> >>> If we don't find any devices, we shouldn't print anything.
> >>>
> >> I disagree.
> >> I find it quite nice to be able to see that the driver loaded even if
> >> it finds nothing. At least then when there's a problem, I can quickly
> >> see that at least it is not because I didn't forget to load the
> >> driver, it's something else. Saves time since I can start looking for
> >> reasons why the driver didn't find anything without first spending
> >> additional time checking if I failed to cause it to load for some
> >> reason.
> >
> > I'll add a second reason: it is a REALLY nice property to be able to see
> > which driver is started last in case of a crash/hang, so that the guilty
> > party is more obvious..
>
> OTOH, it is not a property that scales well at all.
>
> When you build extra drivers into the kernel, or distros load drivers
> you don't need (_every_ distro does this), you wind up with a bunch of
> version strings for drivers for hardware you don't have.
>
Given that boot tracing is best done with initcall_debug and
drivers that care about their version string can report it through
/sys/modules/<driver>/version why should version string be printed at
load time at all?
--
Dmitry
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] CCISS: Don't print driver version until we actually find a device
2006-07-27 13:01 ` Dmitry Torokhov
@ 2006-07-27 13:28 ` gmu 2k6
2006-07-27 13:56 ` Dmitry Torokhov
0 siblings, 1 reply; 11+ messages in thread
From: gmu 2k6 @ 2006-07-27 13:28 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Jeff Garzik, Arjan van de Ven, Jesper Juhl, Bjorn Helgaas,
Andrew Morton, Mike Miller, iss_storagedev, linux-kernel
On 7/27/06, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> On 7/26/06, Jeff Garzik <jeff@garzik.org> wrote:
> > Arjan van de Ven wrote:
> > > On Wed, 2006-07-26 at 00:43 +0200, Jesper Juhl wrote:
> > >> On 26/07/06, Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:
> > >>> If we don't find any devices, we shouldn't print anything.
> > >>>
> > >> I disagree.
> > >> I find it quite nice to be able to see that the driver loaded even if
> > >> it finds nothing. At least then when there's a problem, I can quickly
> > >> see that at least it is not because I didn't forget to load the
> > >> driver, it's something else. Saves time since I can start looking for
> > >> reasons why the driver didn't find anything without first spending
> > >> additional time checking if I failed to cause it to load for some
> > >> reason.
> > >
> > > I'll add a second reason: it is a REALLY nice property to be able to see
> > > which driver is started last in case of a crash/hang, so that the guilty
> > > party is more obvious..
> >
> > OTOH, it is not a property that scales well at all.
> >
> > When you build extra drivers into the kernel, or distros load drivers
> > you don't need (_every_ distro does this), you wind up with a bunch of
> > version strings for drivers for hardware you don't have.
> >
>
> Given that boot tracing is best done with initcall_debug and
> drivers that care about their version string can report it through
> /sys/modules/<driver>/version why should version string be printed at
> load time at all?
not every driver provides that file (btw, I guess you mean
/sys/module, don't you?) there anyway so it's still inconsistent.
what if you can see up until loading of the driver and it halts there
without /sys being mounted yet. I don't think you can rely on sysfs
being mounted or modules being loaded.
if I may vote as a CCISS user I say print the version number even if
no device is present.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] CCISS: Don't print driver version until we actually find a device
2006-07-27 13:28 ` gmu 2k6
@ 2006-07-27 13:56 ` Dmitry Torokhov
0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Torokhov @ 2006-07-27 13:56 UTC (permalink / raw)
To: gmu 2k6
Cc: Jeff Garzik, Arjan van de Ven, Jesper Juhl, Bjorn Helgaas,
Andrew Morton, Mike Miller, iss_storagedev, linux-kernel
On 7/27/06, gmu 2k6 <gmu2006@gmail.com> wrote:
> On 7/27/06, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> > On 7/26/06, Jeff Garzik <jeff@garzik.org> wrote:
> > > Arjan van de Ven wrote:
> > > > On Wed, 2006-07-26 at 00:43 +0200, Jesper Juhl wrote:
> > > >> On 26/07/06, Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:
> > > >>> If we don't find any devices, we shouldn't print anything.
> > > >>>
> > > >> I disagree.
> > > >> I find it quite nice to be able to see that the driver loaded even if
> > > >> it finds nothing. At least then when there's a problem, I can quickly
> > > >> see that at least it is not because I didn't forget to load the
> > > >> driver, it's something else. Saves time since I can start looking for
> > > >> reasons why the driver didn't find anything without first spending
> > > >> additional time checking if I failed to cause it to load for some
> > > >> reason.
> > > >
> > > > I'll add a second reason: it is a REALLY nice property to be able to see
> > > > which driver is started last in case of a crash/hang, so that the guilty
> > > > party is more obvious..
> > >
> > > OTOH, it is not a property that scales well at all.
> > >
> > > When you build extra drivers into the kernel, or distros load drivers
> > > you don't need (_every_ distro does this), you wind up with a bunch of
> > > version strings for drivers for hardware you don't have.
> > >
> >
> > Given that boot tracing is best done with initcall_debug and
> > drivers that care about their version string can report it through
> > /sys/modules/<driver>/version why should version string be printed at
> > load time at all?
>
> not every driver provides that file (btw, I guess you mean
> /sys/module, don't you?) there anyway so it's still inconsistent.
Yes, you are right, we drop version string when !MODULE. We need to
keep it if we want to have consistent sysfs data.
> what if you can see up until loading of the driver and it halts there
> without /sys being mounted yet. I don't think you can rely on sysfs
> being mounted or modules being loaded.
Right, so you boot with debug_initcall to see what was the last thing
that we tried to initialize. Hmm, we might need to add debug_modcall
to print names of modules being loaded as well.
--
Dmitry
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2006-07-27 13:56 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-25 22:36 [PATCH] CCISS: Don't print driver version until we actually find a device Bjorn Helgaas
2006-07-25 22:43 ` Jesper Juhl
2006-07-25 22:47 ` Arjan van de Ven
2006-07-25 22:51 ` Bjorn Helgaas
2006-07-25 22:53 ` Jesper Juhl
2006-07-26 4:41 ` Jeff Garzik
2006-07-27 13:01 ` Dmitry Torokhov
2006-07-27 13:28 ` gmu 2k6
2006-07-27 13:56 ` Dmitry Torokhov
2006-07-26 14:22 ` Miller, Mike (OS Dev)
[not found] <6CDJo-8vC-31@gated-at.bofh.it>
[not found] ` <6CDSZ-h7-9@gated-at.bofh.it>
2006-07-25 23:14 ` Bodo Eggert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox