From patchwork Tue May 23 23:48:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9744465 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BB6506037F for ; Tue, 23 May 2017 23:49:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD9C328818 for ; Tue, 23 May 2017 23:49:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A276F28854; Tue, 23 May 2017 23:49:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D873C28818 for ; Tue, 23 May 2017 23:49:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031581AbdEWXts (ORCPT ); Tue, 23 May 2017 19:49:48 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:4537 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968792AbdEWXta (ORCPT ); Tue, 23 May 2017 19:49:30 -0400 X-IronPort-AV: E=Sophos;i="5.38,383,1491235200"; d="scan'208";a="122509179" Received: from mail-bn3nam01lp0182.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([216.32.180.182]) by ob1.hgst.iphmx.com with ESMTP; 24 May 2017 07:49:06 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=oo3qyTe4fyUQAzOxepjxV1fMlAa9HikHJBpRqZ7edYw=; b=OiEgm5wXFa4OGp2P2DoN7JzFyPFWwKbTs7xFi8ppHvU59Qm2K4zmpb6atRt5p2Ub+GApn+dYCWqq1z3Z1BJSYcn2iT8MOTu846OYZbCxoHBKuUoDy4f2g1Z9GuygipmtYkaiTL55IpXO0kwmZWRLwuRS2jHM46fQXprbDqIzOP8= Received: from BN3PR0401CA0037.namprd04.prod.outlook.com (10.162.159.175) by BN6PR04MB0500.namprd04.prod.outlook.com (10.173.201.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16; Tue, 23 May 2017 23:49:04 +0000 Received: from BN3NAM04FT010.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4e::206) by BN3PR0401CA0037.outlook.office365.com (2a01:111:e400:51d1::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14 via Frontend Transport; Tue, 23 May 2017 23:49:04 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; suse.de; dkim=none (message not signed) header.d=none;suse.de; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by BN3NAM04FT010.mail.protection.outlook.com (10.152.92.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1075.5 via Frontend Transport; Tue, 23 May 2017 23:49:03 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id D7.D1.45291.E6AC4295; Tue, 23 May 2017 16:49:02 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.9.6) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Tue, 23 May 2017 16:48:58 -0700 X-AuditID: 0ac94369-166ac9800001b0eb-f9-5924ca6ee7f0 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 79.F2.18148.A6AC4295; Tue, 23 May 2017 16:48:58 -0700 (PDT) From: Bart Van Assche To: Nicholas Bellinger CC: , Bart Van Assche , Hannes Reinecke , "Christoph Hellwig" , Andy Grover , David Disseldorp Subject: [PATCH 07/33] target: Introduce a function that shows the command state Date: Tue, 23 May 2017 16:48:28 -0700 Message-ID: <20170523234854.21452-8-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170523234854.21452-1-bart.vanassche@sandisk.com> References: <20170523234854.21452-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJLMWRmVeSWpSXmKPExsXCddJ5kW7eKZVIg9un5S32z3rGZPH1/3QW iwVv9rJZrFx9lMmibfUZRovWpW+ZHNg87m8/wuSx+2YDm8f7fVfZPNZvucrisfl0tcfnTXIB bFFcNimpOZllqUX6dglcGT0f17EWPLGumPRvF3sD41yjLkYODgkBE4m726S7GLk4hASWMklc 2TuLEcLZxihx/NxuIIcTrOj0ixdsEImNjBLnf0xnA0mwCRhJfHs/kwXEFhHQkZh19wU7SBGz wG1GiTWPV4MVCQsESHyasQasiEVAVeLIRZAiTg5eAXuJCd/62SE2yEuc3bKTGcTmFHCQWLln GzPIeUJANZe/K4PMlBBYxCrxYeIsZoheQYmTM5+AzWQWkJA4+OIFWFxIQF3i5JL5TBMYhWYh KZuFpGwBI9MqRrHczJzi3PTUAkNTveLEvJTM4my95PzcTYyQCMjcwXj3ifchRgEORiUe3gQH lUgh1sSy4srcQ4wSHMxKIrzLNwCFeFMSK6tSi/Lji0pzUosPMUpzsCiJ856TmRohJJCeWJKa nZpakFoEk2Xi4JRqYOw4v9Gwj/1P/5ODkm1++1q3fDTUyzC5kHDebe/8ydcrHdaLMUVtzbXf dDhxgXvT5/nLL57xKvB9O2X/witvWbL0FcWuTDx/p978iqjipriFZaf+LuRK3p06xd1ib8Wn PTVxyfcOi17k7v97K++lidjKxv01jekas/9vCV5z4jjPqaAbfhNnLnuixFKckWioxVxUnAgA j1JBrnwCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJJMWRmVeSWpSXmKPExsXCtZGTTTfrlEqkweubEhb7Zz1jsjj4s43R 4uv/6SwWC97sZbNYufook0Xb6jOMFq1L3zI5sHvc336EyWP3zQY2j/f7rrJ5TFtznslj/Zar LB6bT1d7fN4kF8AexWWTkpqTWZZapG+XwJXR83Eda8ET64pJ/3axNzDONepi5OSQEDCROP3i BVsXIxeHkMB6RonJU4+ygyTYBIwkvr2fyQJiiwjoSMy6+4IdpIhZ4C6jxJnuT2wgCWGBAIlP M9aAFbEIqEocufgCrJlXwF7i6MrpTBAb5CXObtnJDGJzCjhIrNyzDcjmANpmL3H5u/IERu4F jAyrGMVyM3OKc9MzCwyN9IoT81Iyi7P1kvNzNzFCAidqB+P1ieaHGJk4OKUaGNu5GH6ZKDU0 TZy4den/dX/qRL0r3oi65PadLdv6PNSm9eyGQ5pff39Za/ap+aOqdPGqe04ybufLtv6Zf/hZ yyO71VNfhUZt/qbD8iIrpe1RzWVlceu5r2yrn9vrBqnKSlhvUVhQIlPsf8fx5eT13Zll2fPZ /Erehe78s7VJVDx2qVXGtaVHHJRYijMSDbWYi4oTAQCHdlvMAQAA MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39450400003)(39850400002)(39400400002)(39840400002)(39410400002)(39860400002)(2980300002)(438002)(199003)(189002)(9170700003)(110136004)(6916009)(356003)(77096006)(81166006)(2950100002)(50986999)(76176999)(8936002)(50226002)(36756003)(4326008)(1076002)(478600001)(8676002)(106466001)(38730400002)(189998001)(6666003)(305945005)(50466002)(2906002)(86362001)(575784001)(47776003)(48376002)(54906002)(5003940100001)(5660300001)(33646002)(72206003)(53936002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR04MB0500; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3NAM04FT010; 1:yggcWhg/BJMxUtyOf8+eI1GDxPkc+mbi56bDFEXkUXToXXc9neLLSp5vSssg+R5nJPJrByE+05VkvOZViKPRmdVzc9E33tnpY8wQb2n8TrvE/287Gie2SRe93auoU6Zz34jy7c12bDo/Ds1OaK03qTuCoYoK/ZynlVWrtd4rIIL01U8wm/RzjO0mdScsR2bIpeVXodaP4iFNAA8U1Dr+ZnmObU2E3abubG86/GjBDA4h6nnNohUc2Rla8wXj/lYn4+l22nx9JgRWWHlP1oFlvBlWnDeqQrGiI6Tt/s6WOMSsI/VglJtZ3ZS8/zIr6JA6omAf8tzRM0ZG9P19FaiUYW3QZUx8ebcgQLd4Clbp4YqLDpKnbLpU9zfEPGlmjlfvQpLs3ZQ4Fxxa3/ynjyfK9seYrOsIYuHZXTDsv8r9SdQc+5+xwzY1TQHCzFZlE0zs8NyEoYwDsAfxGYp+C1AehUJkeiI/n088ALdQs1t+tHwJuoAPWAhLXcVG6JqnhQzZasPhRq/trxWZQtriO5HxCgGFcSZp4sQLm+giTYNws90= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 97199328-8d55-43b6-91cf-08d4a2364b48 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:BN6PR04MB0500; X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0500; 3:fDoH0X+QybbAEY3OF+OHNL4oGSTIfMBRTgOiQ/osf+1cjZbVYcy3e8DcFX7TwEhr5pVmfSVRYl32wif6SakyZZhHYKIfgbL4sQY71VtNZc1Ru0iipMhzWGhdb4/JG/NJsk52udOybKKA5sZ4AHz7ybmKJpircwgnU9aw3H9g5O+SXbSiumis9XbZzoUMMU3KMUVsuPXHP89XaMMWPtmaycaXSh5hkKiwsKnAZiOrTJ51lnNkfhNd0ncTkPQyzPhAWGwcJ317u0Uc5q8tGS5hXsKH+KVYlK6oLWVgsCmaYV7v9F+kuXCngIkj6hluQYNc6RkRI3I0sZxGXMaPnxYXTrx1wDj2722y7NYzmOCLKpAedggzhBSSR1NXwYmH1hgEnYx9fH3Z7n9XblZzRIo8Qm7y+rvrR7ttnW2uVhNKEgKN5gA/dFZ8l+hr8jJ10sf7Tziz7b9DQzIWicmawL50X9LTTYTxmnNzQ1pRoZbWoxcDmANgAnUUxOQsZXlyldUL X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0500; 25:9XQfHiQnKexsotdlEGcFm23gB0M7bLO6YIf4s8jDk/J2HbsyBj3n41pXbQxgmh05oSLBfWJZ7XeNZzQI94IvH4xTVlGdfb4kMKBf1FAOcMVKx4PpL/0WqYPbxcTHWVZABXwRlqzcYaQaZo5rM1wSK5C0Jwxk3N/3YX9leyCEwihdYwrMJ/5Lj0qoiYZtTQk+HAJbdve+kQSTa7+pzuEe5E1AlUwP7fsbd874VNGT9Ffszy3GFebUBJeCDyyAA3kkM6ntKjbGYHq8BlF/s4oODlpjp11+GCNWxbQBErKeGU7/A/J2KoZCzdmcqyzHGn/ZqmXoqBmjI0Ugm+Cealn0p36hFD+U/jrc4SGQ5cpptWZdf/UDuolmLOQ6i/RtZ1ppYDPpc7+OUx7f6Q9ge/CC8fvdaE2VqELwk8E/qoIwqTMz1ny/YCO1qo6anR3mdBjmM86+0o1DGHd1cPR5lpnDNyL8gacDA2EBLJ9lZUo3M+g=; 31:CnBMUu56ltdaAPXuVPItRBFInwaAQlzvR4cGO96rmj+lLTOFaprtmTlqSHkNmMiMMRkXQRvtg5Cg1+HpHRl2XK0DPh1TyvOnxzTqS8fus91Xhui6eI+c8puFiEy5Ox+5me3q0wGVRI/NK2GqjlrXNexE09BGg5T1Tog9bcPiL+MBJXdPkzCk00i8DCevYkKy938/j8ChHL30vzsQLzwh0ODJqsWdTdtQa1MLqe/FJ7KPZf4TSsNGKrv6SQ1ravuG6CvPjiCx3QcF9wN9eOshMw== WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0500; 20:FfSWjfKOChp+Mu2LwN+K4ICojfcorOytwLl/FtjHKBQMEXXfySDvZ918C3hiWFgCQntzFQJIJ6hggh12OoMfSx+Z7kTbwP3QPdDNQpPh0frioyabJdxVub4Y5XWKCzPfowTw37wLJYFzu8O1Aor6CMls9I0Zfj/B4imNbfjD6PRzA2VmeW/ZYdTTKXQwuHlO5DOdSvrRNbSXcm2AlSUijyo5a3SQ3qjzl9PutdZ/TGYYk2tkTPrNnGHNRXLGDKhqEmLHIMsHJSCs4KMQgsc1Mb4WdS8m84tU2/mJPvy2bctsvQp92TGMehP8Pu5N6CSIMGumad1IiFkEfaPm0EmhU1Fq9CXyH9svpf4A1Flk+Gym9vIVyDER3/NWHd2XSvIKyMQpvx7/CogFjEy5GJWpQvQtiWrlKzOhBFZEF00Hisy5Nr6Ci577WuKc33VQOuHO3M10ZdMXvi2hCfzzZEE0fb8bPPbR+g5vZrHrSaaYXjwxI0nWH2l/WABh+K6TEbn6 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700051)(100105000095)(100000701051)(100105300095)(100000702051)(100105100095)(6040450)(601004)(2401047)(13018025)(13016025)(5005006)(8121501046)(10201501046)(93006095)(93004095)(3002001)(100000703051)(100105400095)(6055026)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123560025)(20161123555025)(6072148)(100000704051)(100105200095)(100000705051)(100105500095); SRVR:BN6PR04MB0500; BCL:0; PCL:0; RULEID:(100000800051)(100110000095)(100000801051)(100110300095)(100000802051)(100110100095)(100000803051)(100110400095)(100000804051)(100110200095)(100000805043)(100110500095); SRVR:BN6PR04MB0500; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR04MB0500; 4:m9QTaYRgbp753gpMGK04/MaXYMmVmGJnW3MwkSlgKB?= =?us-ascii?Q?OyQpYn1btgNnSncFxVfQ/F6HXKsVp02a47C9rfjV1IaARW9JKseR66kr3+Lw?= =?us-ascii?Q?jJ0ZxJHcPeVNLzwDVCZD3mGhY1RvocPe/Uy5EU2kF+3Qry45yCc7tM7sNT9r?= =?us-ascii?Q?6PjHd6o9AnJOEqkDjocl2BWLa3iMcmnqAttWWjHXXWZ4Wu65PdFPyaiMi2ht?= =?us-ascii?Q?xSk3//FiPPHL32YP5wG+dmsvPajs3eXJ6R9wFnk9/gM5BTrYEoZmbHEFM1Ke?= =?us-ascii?Q?xG18QI7jpss9GD9UUdoAUie4EPsbvGyADxWaxeV41nRXGN1Zebnn/stqA2/x?= =?us-ascii?Q?uSG2JMz2CnEip5PsqpDGmunoMw1mGoVonR2oO1JEOLaHFAtfHgXkv8rcDl+9?= =?us-ascii?Q?xVd6a/qjT94LBMoFQmDidcdkH1EmKCnWBro0qT6fr3H1GcmmO1YvpDTky24U?= =?us-ascii?Q?UTC/y4PVQIxiYCGx6QzsSBY7hNZsY50aXAuFKBMK0F9cvtJAVxBh2MNkbbTl?= =?us-ascii?Q?vpwjMlF2DWT46+0AbffNWJL2VghV0RcbTO3p6U3+8RMLwcEZ7fgIxzBSW16B?= =?us-ascii?Q?KAkF6TYy4cZRkng34Orwr3RkpKAChOvQD665Yia2fc5RiJ5em4wW2zp48FUl?= =?us-ascii?Q?ETin3YXUP38myvlH4HRiEWn0TVssfD1ZfWK+glkam6z2n12Wg6KhuSalm7bt?= =?us-ascii?Q?5T6yrIyg3RhA6jSE8JrUWEoaH2xd2Wi2b38MyqTW60spg6Udv+v7HGK+KnXf?= =?us-ascii?Q?vtc52f6ia/ss1hd/S4kFcl1YihIwjaF9hhcCRtayJ2qDByEFnzKepwTCGMO7?= =?us-ascii?Q?TGvnnv92/wo+1Ih1/EX/ypFpGHS//p1gdWAuhV/ppQymr//fUM4Jehec4YjD?= =?us-ascii?Q?Ltq6zusSmcp1e97L4cJFljVGToP6A57LygpmfFS9DeMMounQgGiLegH9h0Nj?= =?us-ascii?Q?IazAT8J5OZpLKqqaiJaD6bs80RY5WJ1UAEouQWWtkzaob7Se/jKffCVEuInN?= =?us-ascii?Q?9NqYqIR3rKYDz2PCoG8nAKdwKBQ1HkBh1wbBsa0T040/JZG5looWbjDPKEB3?= =?us-ascii?Q?7sBDQKqDk0eAJJsXPHESndjEIAA+K7d6SxHakeWGfgq5m09DdBdaspFdZQYX?= =?us-ascii?Q?9pbT4BRwX48i5oWq8QBqSEEkKgmIUwvB5Saq1iFKwSLpkteGGMhx60p1/MRm?= =?us-ascii?Q?G3hgVo/tFLxE7vZCpobOSU/N95R62X2dHfI8dB4y7eB4on5k248bbySmjoSy?= =?us-ascii?Q?MPZVyiIsvJG/ANvRs=3D?= X-Forefront-PRVS: 0316567485 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR04MB0500; 23:SMxmQZ4buM+yWeECHgcw4sAAczDrs0gZWW9RrqDL0?= =?us-ascii?Q?QcSYRwu1MRM81WBh2AbY74v3IXHlMq/tWBU0imSUdy2zVDL04m6zoBzBZhxW?= =?us-ascii?Q?ENvsHKcmuEWCMxWcdxWtep9nQURlypIbckAVNCMLqY/GDWPueV7dS/MCyWfU?= =?us-ascii?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jpckOO2Wn5mxt1NLcRDxxfUgIoDgzL8FW7+QdGu4L+XdExDhm3LXfFcMEFMJU7C+T+v12BVHawDEHsJtknLgnvZ0NfSOhD8yEegsnXnhUIIS+Of05Wp0HX33SM98dt1S1LQhpBadI/3/5PUxmwrnNVAjm2iJjK70+rZMqE/QT8deP1XjyznCz1uWlflBzK7hcJKwBnPWkkVRs; 24:e2gGg8rG5mOiHs+yFZ1mL4s6xR3fls8Bt8bkB7a7m5yB9XiGk6omGFXMTIJ2li6TbiUAdaQzs5lrKHPi/fLVbqA9KobGBkgJQWA6HEG0imk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0500; 7:aM5DZfoEMLGBdlUnn8kEJQjyWCij5apuyrwH/8jnrY+smDhZcQRp7FsZ50dQPVYFBZd9KShTRsbWkP+WU6dHaPAHttlBOQWGHvcXDdyygYWLymO6fw+7+FZRuK1RZ3za9VpOBZ5awUeOU5/aZhPg6LuzeBOmyOcj/P8KaxoySc7WCGVJnUpiYer8e/NS3niaPQlxyTG9cnhu0QPqhj2YFazjCty6/6jn1ehYbA28Q6WbeOLof19P5PeQMbbB62p8GLAEjhTEqb32LppZFhXy/pn0P6QuhhQAvDsgBMJUu2wgqG7V6i3PRMN4CplAMGt3fyRaG9Hl8P5Vb/24hobcQw==; 20:uemZyFTiZGPApfMxdLd9QSknVWMj50HsHvUIPVAYYjxb61JToPull+KsuguaQeLEbsmL8nVA7H8/cpfqHQITscOU3dQGuz3pJD2BCb9hOYCXVRLOZXoWcSPXioP00br9OSKVzViyOu3jDJFgm9N+Kcv6sXdtZ7xYeKL5NND2cVg= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2017 23:49:03.5438 (UTC) X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b61c8803-16f3-4c35-9b17-6f65f441df86; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR04MB0500 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Introduce target_show_cmd() and use it where appropriate. If transport_wait_for_tasks() takes too long, make it show the state of the command it is waiting for. Signed-off-by: Bart Van Assche Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Andy Grover Cc: David Disseldorp --- drivers/target/target_core_tmr.c | 18 ++--- drivers/target/target_core_transport.c | 121 +++++++++++++++++++++++++++++---- include/target/target_core_fabric.h | 1 + 3 files changed, 113 insertions(+), 27 deletions(-) diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c index dce1e1b47316..1b3e04e4f85d 100644 --- a/drivers/target/target_core_tmr.c +++ b/drivers/target/target_core_tmr.c @@ -355,20 +355,10 @@ static void core_tmr_drain_state_list( cmd = list_entry(drain_task_list.next, struct se_cmd, state_list); list_del_init(&cmd->state_list); - pr_debug("LUN_RESET: %s cmd: %p" - " ITT/CmdSN: 0x%08llx/0x%08x, i_state: %d, t_state: %d" - "cdb: 0x%02x\n", - (preempt_and_abort_list) ? "Preempt" : "", cmd, - cmd->tag, 0, - cmd->se_tfo->get_cmd_state(cmd), cmd->t_state, - cmd->t_task_cdb[0]); - pr_debug("LUN_RESET: ITT[0x%08llx] - pr_res_key: 0x%016Lx" - " -- CMD_T_ACTIVE: %d" - " CMD_T_STOP: %d CMD_T_SENT: %d\n", - cmd->tag, cmd->pr_res_key, - (cmd->transport_state & CMD_T_ACTIVE) != 0, - (cmd->transport_state & CMD_T_STOP) != 0, - (cmd->transport_state & CMD_T_SENT) != 0); + target_show_cmd("LUN_RESET: ", cmd); + pr_debug("LUN_RESET: ITT[0x%08llx] - %s pr_res_key: 0x%016Lx\n", + cmd->tag, (preempt_and_abort_list) ? "preempt" : "", + cmd->pr_res_key); /* * If the command may be queued onto a workqueue cancel it now. diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 33bb2a16ce75..cfe69c1fc879 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1652,15 +1652,9 @@ void transport_generic_request_failure(struct se_cmd *cmd, if (transport_check_aborted_status(cmd, 1)) return; - pr_debug("-----[ Storage Engine Exception for cmd: %p ITT: 0x%08llx" - " CDB: 0x%02x\n", cmd, cmd->tag, cmd->t_task_cdb[0]); - pr_debug("-----[ i_state: %d t_state: %d sense_reason: %d\n", - cmd->se_tfo->get_cmd_state(cmd), - cmd->t_state, sense_reason); - pr_debug("-----[ CMD_T_ACTIVE: %d CMD_T_STOP: %d CMD_T_SENT: %d\n", - (cmd->transport_state & CMD_T_ACTIVE) != 0, - (cmd->transport_state & CMD_T_STOP) != 0, - (cmd->transport_state & CMD_T_SENT) != 0); + pr_debug("-----[ Storage Engine Exception; sense_reason %d\n", + sense_reason); + target_show_cmd("-----[ ", cmd); /* * For SAM Task Attribute emulation for failed struct se_cmd @@ -2653,6 +2647,107 @@ int target_put_sess_cmd(struct se_cmd *se_cmd) } EXPORT_SYMBOL(target_put_sess_cmd); +static const char *data_dir_name(enum dma_data_direction d) +{ + switch (d) { + case DMA_BIDIRECTIONAL: return "BIDI"; + case DMA_TO_DEVICE: return "WRITE"; + case DMA_FROM_DEVICE: return "READ"; + case DMA_NONE: return "NONE"; + } + + return "(?)"; +} + +static const char *cmd_state_name(enum transport_state_table t) +{ + switch (t) { + case TRANSPORT_NO_STATE: return "NO_STATE"; + case TRANSPORT_NEW_CMD: return "NEW_CMD"; + case TRANSPORT_WRITE_PENDING: return "WRITE_PENDING"; + case TRANSPORT_PROCESSING: return "PROCESSING"; + case TRANSPORT_COMPLETE: return "COMPLETE"; + case TRANSPORT_ISTATE_PROCESSING: + return "ISTATE_PROCESSING"; + case TRANSPORT_COMPLETE_QF_WP: return "COMPLETE_QF_WP"; + case TRANSPORT_COMPLETE_QF_OK: return "COMPLETE_QF_OK"; + case TRANSPORT_COMPLETE_QF_ERR: return "COMPLETE_QF_ERR"; + } + + return "(?)"; +} + +static void target_append_str(char **str, const char *txt) +{ + char *prev = *str; + + *str = *str ? kasprintf(GFP_ATOMIC, "%s,%s", *str, txt) : + kstrdup(txt, GFP_ATOMIC); + kfree(prev); +} + +/* + * Convert a transport state bitmask into a string. The caller is + * responsible for freeing the returned pointer. + */ +static char *target_ts_to_str(u32 ts) +{ + char *str = NULL; + + if (ts & CMD_T_ABORTED) + target_append_str(&str, "aborted"); + if (ts & CMD_T_ACTIVE) + target_append_str(&str, "active"); + if (ts & CMD_T_COMPLETE) + target_append_str(&str, "complete"); + if (ts & CMD_T_SENT) + target_append_str(&str, "sent"); + if (ts & CMD_T_STOP) + target_append_str(&str, "stop"); + if (ts & CMD_T_FABRIC_STOP) + target_append_str(&str, "fabric_stop"); + + return str; +} + +static const char *target_tmf_name(enum tcm_tmreq_table tmf) +{ + switch (tmf) { + case TMR_ABORT_TASK: return "ABORT_TASK"; + case TMR_ABORT_TASK_SET: return "ABORT_TASK_SET"; + case TMR_CLEAR_ACA: return "CLEAR_ACA"; + case TMR_CLEAR_TASK_SET: return "CLEAR_TASK_SET"; + case TMR_LUN_RESET: return "LUN_RESET"; + case TMR_TARGET_WARM_RESET: return "TARGET_WARM_RESET"; + case TMR_TARGET_COLD_RESET: return "TARGET_COLD_RESET"; + case TMR_UNKNOWN: break; + } + return "(?)"; +} + +void target_show_cmd(const char *pfx, struct se_cmd *cmd) +{ + char *ts_str = target_ts_to_str(cmd->transport_state); + const u8 *cdb = cmd->t_task_cdb; + struct se_tmr_req *tmf = cmd->se_tmr_req; + + if (!(cmd->se_cmd_flags & SCF_SCSI_TMR_CDB)) + pr_debug("%scmd %#02x:%#02x with tag %#llx dir %s i_state %d t_state %s len %d refcnt %d transport_state %s\n", + pfx, cdb[0], cdb[1], cmd->tag, + data_dir_name(cmd->data_direction), + cmd->se_tfo->get_cmd_state(cmd), + cmd_state_name(cmd->t_state), cmd->data_length, + kref_read(&cmd->cmd_kref), ts_str); + else + pr_debug("%stmf %s with tag %#llx ref_task_tag %#llx i_state %d t_state %s refcnt %d transport_state %s\n", + pfx, target_tmf_name(tmf->function), cmd->tag, + tmf->ref_task_tag, cmd->se_tfo->get_cmd_state(cmd), + cmd_state_name(cmd->t_state), + kref_read(&cmd->cmd_kref), ts_str); + kfree(ts_str); +} +EXPORT_SYMBOL(target_show_cmd); + /* target_sess_cmd_list_set_waiting - Flag all commands in * sess_cmd_list to complete cmd_wait_comp. Set * sess_tearing_down so no more commands are queued. @@ -2797,13 +2892,13 @@ __transport_wait_for_tasks(struct se_cmd *cmd, bool fabric_stop, cmd->transport_state |= CMD_T_STOP; - pr_debug("wait_for_tasks: Stopping %p ITT: 0x%08llx i_state: %d," - " t_state: %d, CMD_T_STOP\n", cmd, cmd->tag, - cmd->se_tfo->get_cmd_state(cmd), cmd->t_state); + target_show_cmd("wait_for_tasks: Stopping ", cmd); spin_unlock_irqrestore(&cmd->t_state_lock, *flags); - wait_for_completion(&cmd->t_transport_stop_comp); + while (!wait_for_completion_timeout(&cmd->t_transport_stop_comp, + 180 * HZ)) + target_show_cmd("wait for tasks: ", cmd); spin_lock_irqsave(&cmd->t_state_lock, *flags); cmd->transport_state &= ~(CMD_T_ACTIVE | CMD_T_STOP); diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index d7dd1427fe0d..33d2e3e5773c 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -160,6 +160,7 @@ int target_get_sess_cmd(struct se_cmd *, bool); int target_put_sess_cmd(struct se_cmd *); void target_sess_cmd_list_set_waiting(struct se_session *); void target_wait_for_sess_cmds(struct se_session *); +void target_show_cmd(const char *pfx, struct se_cmd *cmd); int core_alua_check_nonop_delay(struct se_cmd *);