]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.9.52/scsi-zfcp-trace-high-part-of-new-64-bit-scsi-lun.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.9.52 / scsi-zfcp-trace-high-part-of-new-64-bit-scsi-lun.patch
CommitLineData
721db3cc
GKH
1From 5d4a3d0a2ff23799b956e5962b886287614e7fad Mon Sep 17 00:00:00 2001
2From: Steffen Maier <maier@linux.vnet.ibm.com>
3Date: Fri, 28 Jul 2017 12:30:58 +0200
4Subject: scsi: zfcp: trace high part of "new" 64 bit SCSI LUN
5
6From: Steffen Maier <maier@linux.vnet.ibm.com>
7
8commit 5d4a3d0a2ff23799b956e5962b886287614e7fad upstream.
9
10Complements debugging aspects of the otherwise functionally complete
11v3.17 commit 9cb78c16f5da ("scsi: use 64-bit LUNs").
12
13While I don't have access to a target exporting 3 or 4 level LUNs,
14I did test it by explicitly attaching a non-existent fake 4 level LUN
15by means of zfcp sysfs attribute "unit_add".
16In order to see corresponding trace records of otherwise successful
17events, we had to increase the trace level of area SCSI and HBA to 6.
18
19$ echo 6 > /sys/kernel/debug/s390dbf/zfcp_0.0.1880_scsi/level
20$ echo 6 > /sys/kernel/debug/s390dbf/zfcp_0.0.1880_hba/level
21
22$ echo 0x4011402240334044 > \
23 /sys/bus/ccw/drivers/zfcp/0.0.1880/0x50050763031bd327/unit_add
24
25Example output formatted by an updated zfcpdbf from the s390-tools
26package interspersed with kernel messages at scsi_logging_level=4605:
27
28Timestamp : ...
29Area : REC
30Subarea : 00
31Level : 1
32Exception : -
33CPU ID : ..
34Caller : 0x...
35Record ID : 1
36Tag : scsla_1
37LUN : 0x4011402240334044
38WWPN : 0x50050763031bd327
39D_ID : 0x00......
40Adapter status : 0x5400050b
41Port status : 0x54000001
42LUN status : 0x41000000
43Ready count : 0x00000001
44Running count : 0x00000000
45ERP want : 0x01
46ERP need : 0x01
47
48scsi 2:0:0:4630896905707208721: scsi scan: INQUIRY pass 1 length 36
49scsi 2:0:0:4630896905707208721: scsi scan: INQUIRY successful with code 0x0
50
51Timestamp : ...
52Area : HBA
53Subarea : 00
54Level : 6
55Exception : -
56CPU ID : ..
57Caller : 0x...
58Record ID : 1
59Tag : fs_norm
60Request ID : 0x<inquiry2-req-id>
61Request status : 0x00000010
62FSF cmnd : 0x00000001
63FSF sequence no: 0x...
64FSF issued : ...
65FSF stat : 0x00000000
66FSF stat qual : 00000000 00000000 00000000 00000000
67Prot stat : 0x00000001
68Prot stat qual : ........ ........ 00000000 00000000
69Port handle : 0x...
70LUN handle : 0x...
71|
72Timestamp : ...
73Area : SCSI
74Subarea : 00
75Level : 6
76Exception : -
77CPU ID : ..
78Caller : 0x...
79Record ID : 1
80Tag : rsl_nor
81Request ID : 0x<inquiry2-req-id>
82SCSI ID : 0x00000000
83SCSI LUN : 0x40224011
84SCSI LUN high : 0x40444033 <=======================
85SCSI result : 0x00000000
86SCSI retries : 0x00
87SCSI allowed : 0x03
88SCSI scribble : 0x<inquiry2-req-id>
89SCSI opcode : 12000000 a4000000 00000000 00000000
90FCP rsp inf cod: 0x00
91FCP rsp IU : 00000000 00000000 00000000 00000000
92 00000000 00000000
93
94scsi 2:0:0:4630896905707208721: scsi scan: INQUIRY pass 2 length 164
95scsi 2:0:0:4630896905707208721: scsi scan: INQUIRY successful with code 0x0
96scsi 2:0:0:4630896905707208721: scsi scan: peripheral device type of 31, \
97no device added
98
99Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
100Fixes: 9cb78c16f5da ("scsi: use 64-bit LUNs")
101Reviewed-by: Benjamin Block <bblock@linux.vnet.ibm.com>
102Reviewed-by: Jens Remus <jremus@linux.vnet.ibm.com>
103Signed-off-by: Benjamin Block <bblock@linux.vnet.ibm.com>
104Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
105Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
106
107---
108 drivers/s390/scsi/zfcp_dbf.c | 2 +-
109 drivers/s390/scsi/zfcp_dbf.h | 4 +++-
110 2 files changed, 4 insertions(+), 2 deletions(-)
111
112--- a/drivers/s390/scsi/zfcp_dbf.c
113+++ b/drivers/s390/scsi/zfcp_dbf.c
114@@ -563,8 +563,8 @@ void zfcp_dbf_scsi(char *tag, int level,
115 rec->scsi_retries = sc->retries;
116 rec->scsi_allowed = sc->allowed;
117 rec->scsi_id = sc->device->id;
118- /* struct zfcp_dbf_scsi needs to be updated to handle 64bit LUNs */
119 rec->scsi_lun = (u32)sc->device->lun;
120+ rec->scsi_lun_64_hi = (u32)(sc->device->lun >> 32);
121 rec->host_scribble = (unsigned long)sc->host_scribble;
122
123 memcpy(rec->scsi_opcode, sc->cmnd,
124--- a/drivers/s390/scsi/zfcp_dbf.h
125+++ b/drivers/s390/scsi/zfcp_dbf.h
126@@ -204,7 +204,7 @@ enum zfcp_dbf_scsi_id {
127 * @id: unique number of recovery record type
128 * @tag: identifier string specifying the location of initiation
129 * @scsi_id: scsi device id
130- * @scsi_lun: scsi device logical unit number
131+ * @scsi_lun: scsi device logical unit number, low part of 64 bit, old 32 bit
132 * @scsi_result: scsi result
133 * @scsi_retries: current retry number of scsi request
134 * @scsi_allowed: allowed retries
135@@ -214,6 +214,7 @@ enum zfcp_dbf_scsi_id {
136 * @host_scribble: LLD specific data attached to SCSI request
137 * @pl_len: length of paload stored as zfcp_dbf_pay
138 * @fsf_rsp: response for fsf request
139+ * @scsi_lun_64_hi: scsi device logical unit number, high part of 64 bit
140 */
141 struct zfcp_dbf_scsi {
142 u8 id;
143@@ -230,6 +231,7 @@ struct zfcp_dbf_scsi {
144 u64 host_scribble;
145 u16 pl_len;
146 struct fcp_resp_with_ext fcp_rsp;
147+ u32 scsi_lun_64_hi;
148 } __packed;
149
150 /**