From: Marc Gonzalez <marc.w.gonzalez@free.fr>
To: "Martin K. Petersen" <martin.petersen@oracle.com>,
Douglas Gilbert <dgilbert@interlog.com>
Cc: Avri Altman <avri.altman@wdc.com>,
Alim Akhtar <alim.akhtar@samsung.com>,
SCSI <linux-scsi@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: correcting incorrect peripheral device type 0x0
Date: Thu, 4 Apr 2019 14:02:01 +0200 [thread overview]
Message-ID: <69474538-b097-f672-a263-aefd5958dc90@free.fr> (raw)
In-Reply-To: <yq1zhp6satq.fsf@oracle.com>
On 04/04/2019 05:34, Martin K. Petersen wrote:
> Marc wrote:
>
>> scsi 0:0:0:49488: scsi_add_lun: correcting incorrect peripheral device type 0x0 for W-LUN 0x c150hN
>
> ^^^^^ Where do these crazy LUN numbers come from? That
> looks like something which needs fixing...
sdev_printk(KERN_WARNING, sdev, "%s: correcting incorrect peripheral device type 0x%x for W-LUN 0x%16xhN\n",
__func__, sdev->type, (unsigned int)sdev->lun);
What does the "hN" suffix stand for? It seems redundant with the "0x" prefix...
(Looks like hN might be "hexadecimal Number")
scsi 0:0:0:49488 -> 0xc150
scsi 0:0:0:49476 -> 0xc144
scsi 0:0:0:49456 -> 0xc130
4.7.7.5.1 Well known logical unit addressing
Table 37 — Well known logical unit extended addressing format
Bit 7 6 5 4 3 2 1 0
ADDRESS METHOD (11b) LENGTH (00b) EXTENDED ADDRESS METHOD (1h)
1100 0001 = 0xc1
So W-LUN 0x50, 0x44, 0x30.
"The W-LUN field specifies the well known logical unit to be addressed (see SPC-4)."
Does anything seem out-of-place?
I'd change the log message like this:
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 53380e07b40e..d28c5a30f60a 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -820,8 +820,8 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
*/
if (scsi_is_wlun(sdev->lun) && sdev->type != TYPE_WLUN) {
sdev_printk(KERN_WARNING, sdev,
- "%s: correcting incorrect peripheral device type 0x%x for W-LUN 0x%16xhN\n",
- __func__, sdev->type, (unsigned int)sdev->lun);
+ "%s: correcting incorrect peripheral device type 0x%x for W-LUN 0x%016llx\n",
+ __func__, sdev->type, (unsigned long long)sdev->lun);
sdev->type = TYPE_WLUN;
}
next prev parent reply other threads:[~2019-04-04 12:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-02 15:05 correcting incorrect peripheral device type 0x0 Marc Gonzalez
2019-04-02 15:40 ` Avri Altman
2019-04-04 3:34 ` Martin K. Petersen
2019-04-04 4:04 ` Douglas Gilbert
2019-04-04 12:02 ` Marc Gonzalez [this message]
2019-04-04 13:02 ` Avri Altman
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=69474538-b097-f672-a263-aefd5958dc90@free.fr \
--to=marc.w.gonzalez@free.fr \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=dgilbert@interlog.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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;
as well as URLs for NNTP newsgroup(s).