Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1132565yba; Thu, 4 Apr 2019 05:03:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlOd0Fsnlxkm6pGH1AzJzwSFkxYCmJGfV1ufTxhbKYfjdPI/YoJ55LRqXUlziTz7PjbdeS X-Received: by 2002:a63:2ad4:: with SMTP id q203mr5465760pgq.43.1554379388631; Thu, 04 Apr 2019 05:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554379388; cv=none; d=google.com; s=arc-20160816; b=n5YYH00YT8Ts9kjLhmIG+yS801EeTzjMS/Djq+9hCvlURj/0UBH2DnXw6yet3k6G6L kI0kHM4C1rMXCmmifPzBbDr1qNNJLNQqm9Mbfwike8sBQtPd/gqZ41yc9jKw0lFdshBo Sn1YtA7VxCSFd/R6IG1XInrSydWNA+Ci+DbCG+ecdrKcIycEn27xZVOdzbTpLtXW8BtC McYSQPuh90qMBplTjZm92PVM+drhzCXy2tEZVRtRPzf00cYyEUSYzdHznw1MTGEXCs8z 8HVwCBIszJHbNUYkpGAMdfz3ViLUxhrZUxZkVYentMEfpJMEl/biUXuzMwwREr3dKIXz nFZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=BSKBSfwvcOrcT8zDFaDH0qGS+VYveB83aC4ROjswyd0=; b=wvjVrHM5VluIq3t+ij+Dty68piGJmvXrPQdCmr71DV0A2x7wAS3X4cy5CiB1jsLodt gdDW2DMQBtP3bkhaI7Ep78Uu7BYkm6zrpML0gfCFXAWk8goJsqw/y6Nu2fBq6g4pdFcj SMeEnmck6CTA0ro/vraDdaTTNGdR/DMZxXRPbvR+KB12xLIJ6Q+PsfCyCkNZ9Ntti7Hf k3V3xsdtYdtyTcf+xLmiGdZK7uYSPV+gEMIwLF9Hu+0UJmrQlkSpodMo6JZkKD2ijPhm 2xYZBtFqh91VqNDQFxKAOYEj+fvxErVn5oYuniEkS/ZRJPzrrzkmQ9gEYBktZM/XhlWn 0Gmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h126si3622242pgc.508.2019.04.04.05.02.53; Thu, 04 Apr 2019 05:03:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729619AbfDDMCE (ORCPT + 99 others); Thu, 4 Apr 2019 08:02:04 -0400 Received: from ns.iliad.fr ([212.27.33.1]:48546 "EHLO ns.iliad.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729134AbfDDMCD (ORCPT ); Thu, 4 Apr 2019 08:02:03 -0400 Received: from ns.iliad.fr (localhost [127.0.0.1]) by ns.iliad.fr (Postfix) with ESMTP id E820721806; Thu, 4 Apr 2019 14:02:01 +0200 (CEST) Received: from [192.168.108.8] (freebox.vlq16.iliad.fr [213.36.7.13]) by ns.iliad.fr (Postfix) with ESMTP id CFD8C20720; Thu, 4 Apr 2019 14:02:01 +0200 (CEST) Subject: Re: correcting incorrect peripheral device type 0x0 To: "Martin K. Petersen" , Douglas Gilbert Cc: Avri Altman , Alim Akhtar , SCSI , LKML References: From: Marc Gonzalez Message-ID: <69474538-b097-f672-a263-aefd5958dc90@free.fr> Date: Thu, 4 Apr 2019 14:02:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP ; ns.iliad.fr ; Thu Apr 4 14:02:02 2019 +0200 (CEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; }