From: Matthew Wilcox <matthew@wil.cx>
To: Patrick Mansfield <patmans@us.ibm.com>
Cc: linux-scsi@vger.kernel.org, Greg KH <greg@kroah.com>,
linux-kernel@vger.kernel.org
Subject: dev_printk output
Date: Fri, 19 May 2006 14:11:42 -0600 [thread overview]
Message-ID: <20060519201142.GB2826@parisc-linux.org> (raw)
In-Reply-To: <20060518200957.GA29200@us.ibm.com>
On Thu, May 18, 2006 at 01:09:57PM -0700, Patrick Mansfield wrote:
> Funky how loading sd after sg changes the output ... and using the driver
> name as a prefix sometimes messes this up for scsi.
>
> i.e. scan without sd_mod or sg loaded (and distro I'm using loads sg
> before sd_mod via udev rules):
>
> 0:0:0:0: Attached scsi generic sg0 type 0
> 0:0:0:1: Attached scsi generic sg1 type 0
>
> Then remove/add those devices, and sg lines become:
>
> sd 1:0:0:0: Attached scsi generic sg0 type 0
> sd 1:0:0:1: Attached scsi generic sg1 type 0
I find that a bit confusing too. Obviously, we should distinguish
different kinds of bus_id from each other somehow -- but isn't the
obvious thing to use the bus name? That must already be unique as sysfs
relies on it. ie this patch:
(seems that dev->bus isn't always set; I got a null ptr dereference when
booting without that check).
Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Index: include/linux/device.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/linux/device.h,v
retrieving revision 1.25
diff -u -p -r1.25 device.h
--- include/linux/device.h 13 May 2006 04:12:30 -0000 1.25
+++ include/linux/device.h 19 May 2006 19:54:04 -0000
@@ -412,7 +412,7 @@ extern void firmware_unregister(struct s
/* debugging and troubleshooting/diagnostic helpers. */
#define dev_printk(level, dev, format, arg...) \
- printk(level "%s %s: " format , (dev)->driver ? (dev)->driver->name : "" , (dev)->bus_id , ## arg)
+ printk(level "%s %s: " format , (dev)->bus ? (dev)->bus->name : "", (dev)->bus_id , ## arg)
#ifdef DEBUG
#define dev_dbg(dev, format, arg...) \
next parent reply other threads:[~2006-05-19 20:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060511150015.GJ12272@parisc-linux.org>
[not found] ` <20060512170854.GA11215@us.ibm.com>
[not found] ` <20060513050059.GR12272@parisc-linux.org>
[not found] ` <20060518183652.GM1604@parisc-linux.org>
[not found] ` <20060518200957.GA29200@us.ibm.com>
2006-05-19 20:11 ` Matthew Wilcox [this message]
2006-05-19 20:28 ` dev_printk output Greg KH
2006-05-20 4:55 ` Matthew Wilcox
2006-05-20 13:46 ` James Bottomley
2006-05-20 21:21 ` Greg KH
2006-05-29 3:57 ` Matthew Wilcox
2006-05-29 16:30 ` James Bottomley
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=20060519201142.GB2826@parisc-linux.org \
--to=matthew@wil.cx \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=patmans@us.ibm.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