From patchwork Fri May 19 18:30:08 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: 9737897 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 95F16601C2 for ; Fri, 19 May 2017 18:30:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B2E32856E for ; Fri, 19 May 2017 18:30:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E86928573; Fri, 19 May 2017 18:30:48 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI 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 4DC092856E for ; Fri, 19 May 2017 18:30:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756118AbdESSan (ORCPT ); Fri, 19 May 2017 14:30:43 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:18061 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752472AbdESSaZ (ORCPT ); Fri, 19 May 2017 14:30:25 -0400 X-IronPort-AV: E=Sophos;i="5.38,365,1491235200"; d="scan'208";a="18907173" Received: from mail-bn3nam01lp0181.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([216.32.180.181]) by ob1.hgst.iphmx.com with ESMTP; 20 May 2017 02:30:23 +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=pktUjtFhckb3R+m8a/aU6yGjxzkpBnymy3VhtRSAtWE=; b=eKl06kmWpWHtrokKP1Bz70wnyfhv/oUqlhTnVTdNo6ANxOJvKwj4vpisvmgpXHwU+ccEIIQ2legCycWGKfg9IoNL+Gy7CfkbOzAagMcem+JINi86Kj1zfnhvs32qXNBvhzM94E2supUL6WeSbYQXlPHPSkfD+pcigUnTe2MSNgA= Received: from BN6PR04CA0019.namprd04.prod.outlook.com (10.172.194.29) by MWHPR04MB0513.namprd04.prod.outlook.com (10.173.49.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14; Fri, 19 May 2017 18:30:21 +0000 Received: from SN1NAM04FT031.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4c::200) by BN6PR04CA0019.outlook.office365.com (2603:10b6:404:cb::29) 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; Fri, 19 May 2017 18:30:20 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; 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 SN1NAM04FT031.mail.protection.outlook.com (10.152.88.153) 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; Fri, 19 May 2017 18:30:20 +0000 Received: from MILHUBIP03.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 F0.5A.29323.BB93F195; Fri, 19 May 2017 11:30:19 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Fri, 19 May 2017 11:30:18 -0700 X-AuditID: 0ac94369-548749800000728b-8e-591f39bb1f7f Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 3E.37.18148.AB93F195; Fri, 19 May 2017 11:30:18 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , James Bottomley CC: , Bart Van Assche , Christoph Hellwig , Hannes Reinecke Subject: [PATCH 10/18] scsi: Only add commands to the device command list if required by the LLD Date: Fri, 19 May 2017 11:30:08 -0700 Message-ID: <20170519183016.12646-11-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170519183016.12646-1-bart.vanassche@sandisk.com> References: <20170519183016.12646-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPLMWRmVeSWpSXmKPExsXCddJ5ke5uS/lIgyX/1SwWvNnLZrFy9VEm i439HBbd13ewWSw//o/JgdVj2qRTbB67bzaweXx8eovFY/2WqywenzfJBbBGcdmkpOZklqUW 6dslcGVM3PKYrWCLWsX8Q9PYGxjPKXQxcnJICJhI/Dt+ja2LkYtDSGApk8TJC10sEM4ORomn U9awwFTNm7WaGSKxmVFiX+sJJpAEm4CRxLf3M8GKRAQKJS5t62AEKWIWmMwoMbN5AyNIQlgg QWL2/26gIg4OFgFVifbDYPW8Ag4Sc7vWsEIskJc4u2UnM4jNCRR/eXwhO0i5kIC9xP2+epCR EgKTWCXaj05lh+gVlDg58wnYHGYBCYmDL16A9QoJqEucXDKfaQKj0CwkZbOQlC1gZFrFKJab mVOcm55aYGiqV5yYl5JZnK2XnJ+7iRES7Jk7GO8+8T7EKMDBqMTDm/BLLlKINbGsuDL3EKME B7OSCG+0iXykEG9KYmVValF+fFFpTmrxIUZpDhYlcd5zMlMjhATSE0tSs1NTC1KLYLJMHJxS DYz9Mnon66K3b9hdf/j82+48rSVborfoTlpwp78xKlJ6aeuO4/8sXsWqXVgkvcBhfwHHS1vV wFS9N0XLDr7gNvmWfzzQOvoAW+dH7/OXorIZNy58xpLSwB/68Gf8Tb6l7xxZLLk49lntuHTh bELf2q6Zz675+78MNF+o/W5v2PUKy0lKipofq8SUWIozEg21mIuKEwECHa/5cgIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrHJMWRmVeSWpSXmKPExsXCtZEjRXeXpXykwZtFmhYHf7YxWix4s5fN YuXqo0wWG/s5LLqv72CzWH78H5MDm8e0SafYPHbfbGDz+Pj0FovHtDXnmTzWb7nK4vF5k1wA WxSXTUpqTmZZapG+XQJXxsQtj9kKtqhVzD80jb2B8ZxCFyMnh4SAicS8WauZuxi5OIQENjJK zJ00jQUkwSZgJPHt/UwwW0SgUOL+6dNsIEXMApMZJT6u2w2WEBZIkJj9vxvI5uBgEVCVaD8M FuYVcJB43fyFHWKBvMTZLTuZQWxOoPjL4wvZQcqFBOwl7vfVT2DkXsDIsIpRLDczpzg3PbPA 0EivODEvJbM4Wy85P3cTIzhEOKN2MF6faH6IkYmDU6qBkXeOTHRP5/SZhyNemDNF5rD6t7NP Wl+yjO9+8b7AY4JGpxhcri34ZjDxinlui4XzLxnmC82m+lefH/vy67moV/zTsMbph/7c0DrI aXn0U9lJtbBpx/ktN719WuUq1vHtqWjXMlvzSDGhfVYBircql221e/1YQHTx4lNmAZ6BHRdY 5OaXTW3iVmIpzkg01GIuKk4EAFhAfujBAQAA 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)(39840400002)(39860400002)(39400400002)(39410400002)(39850400002)(39450400003)(2980300002)(438002)(199003)(189002)(9170700003)(53936002)(38730400002)(33646002)(5660300001)(106466001)(50466002)(48376002)(356003)(47776003)(50986999)(76176999)(2950100002)(6666003)(86362001)(1076002)(8676002)(8936002)(81166006)(50226002)(2906002)(5003940100001)(189998001)(36756003)(77096006)(305945005)(54906002)(4326008)(72206003)(478600001); DIR:OUT; SFP:1102; SCL:1; SRVR:MWHPR04MB0513; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM04FT031; 1:ZLZ9C4eqKNz/iZu2S8kQHwRXSbkG2vHWLVNt5pvtmKFJ11l9Rax5RSP6I62f9K09Om0SatvvD6688moW1msUDUTzWRKxkTTp2zmGNPMU1Inazh2POrPc6tsmoG+QnYcfi74WXf0D7KYL5F2LfExJDbB2zjaZsHCubh3BUyWCABGjCtt1rOh8SiPaOqUUBTyxGAzVH12QsLqy9aejMHGjM2BjOc5cG0MpXeF1SPUytT4jodlsEbobFVwSmZ94IpVyT2vg4yM3FxrertTgrrBC/ELjtj6pfi1KVfrY42fPouE6aEmXGE7jK5vyEIbjBzqzT3GCTcQdwbIU3XYGkE/0K0lK6O9J77Ly6Hu+VMUro/DaPzTL6dFo9mRGapbkHuhl8Rtkma4gKk8RKjzgBDH+voT/Py7TwtWn340dbIUVb8A/IYmiGAIGTaYw0a6DAEwZ4DMYcMhFqlSCTjsgU6WPDZ+Kh3KMZ5cfkoe0dULoEfhic84N7pHxZuOTvlmX/IrsQ1hTZXE0XSkMSObMce54e/3njvE+eetGQ7UNCW18ivg= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR04MB0513: X-MS-Office365-Filtering-Correlation-Id: bd071f65-ad5d-481d-29eb-08d49ee51b4f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:MWHPR04MB0513; X-Microsoft-Exchange-Diagnostics: 1; MWHPR04MB0513; 3:pk52T+Q1Cs+4IuV0IeLQ0SFZVeQ6/2R1WexK0K+p3qHv7D1upr+qbP1SZ6Hoqp+31fVuZw3EXRb0dHfUAnw9KlTkcr4CTO5uTb5aoACm37jkZRgHV8zzHg4qFEsIcfSP/8l/cVzn6Du9Bi4M3JlKkt5ZPdos6lKLNDqnuZdLEZj3PLWHIE3TMKGWNxQuk1CXeq68CnkH2qe9Po6pclOEN/GLGqsVhK794I6H9w0t4lLLQTTW54ofPSKO1x+iE20+bQOWNF0oD13LOP+DI2BwrSvAef+OXdSUqVcGzGnAMODGAE4omzGwhlsBLw1xEik2tw9bwM7b8wrUSSQis6tm48E7Mx655g2MAHC1pAUG1To62g9Q/iTtmw/UfqXQq6oVE1yixt1hCJ0rZECMHKBke6cFCNf0GHEYC+0AqHuyhxN6TRyq7CbSxaRliChiARgurmLMKcB28PHHzbWbqh6vaNymsIu3q1sAAgHoQIbMEioIiLECSYUt+YmLFoQt2Jud X-Microsoft-Exchange-Diagnostics: 1; MWHPR04MB0513; 25:ooh3FJvR7eGd46AzQc/E/p9D4VcR2lz7gLGEEdnIsAgPDTWDiH7SlIm1PaqndNvYJRAW9Vha5nl/RKXQ2SxMLvLYBQGpsTOK4xRJgZpeFymkBKxTj4G08u2Nk3iJxfub2yHqEwYFlQD23lp+Q0Hjp8pQssTEACTAIYJeQvp3c2XYaB3nFWfyXXVjSlW994mVoExTpK5c0aylIOBleJ0jsO5GsrAvEUGBDS1HPA1uDwAmqev/q0pkryxTFsNHxorOfDjHq45A6wMSj4KkJ27X535RrT9wzpKDwSCGbdp9h/Pkt8iGZFPSnIp1qdBjg68u6Yw5aO7BGu1r/+zrSouyf2FMOE02VG7VtB5JJT0TX0Cx/naHY1Gd47pwA+tAp8enJ0Decob8YGtJ9lOwc8KMOjzBekW9R033VrJd18b3VrPVobjmmtRpuYk6D+zSrun5i5wi4LH0IT3KWN/OZ7OD1zRliMjdQTweud0tR88eDfQ=; 31:oAzVUBKjY+15k1fXyW8v3S6wsHfESo2lkveW+mhC8eLYKJu9WvUOIsRxTFm2YjruDVcrVGUDo/77GObwaovBL2/aC/exKf+8YO+eJiiubH9BCELFoq+XQO3uJZwHUKjQAFHvivW921JCiZsTUIkp0tPRGpxCHvAOTt3Ndhk2sJzf0zu8xg6re64W/MniV5pzqZrAH/43cd2HJumNFOkLNLPDVGn2PGgYRUzaDiJTpF20meonVrXytzJIrwxyN5Xu WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; MWHPR04MB0513; 20:m03Wiwxgo+LMaiK45iv43QMSDtZE+R22mXcNRGRXsKgPNpcg++5cMJ94P85tLXdMuBw+IownRCXWRchErGC9VefFnO0y9+5iJkTkahsvDvMldZbQJVO1SEF4s7DVlresPZImyQzRReuyLsJ4itD38MOCjh09w9kpVQNjCZNzk63EwxS8SlJtAuhlxLwqcWFZ8tGNSRfd4DsTv7DdEuS8+UWmZzBUPJUnzM+QdzammUqNniP5vg7zuqMh9Kgg/p/eK1nquyjI28xa5OrSTIBWfQ6058qEUUiPPAYi/ae2QIgDMivUyXJyeL1rB+3Faa6Txt9UxSIq2PbaUwKMAWIq4UeZ1/BcnR2wqZvGVB5RW9RkIkoJ+roD4xF1OPYT0N5edx0Fds6xCQauHwu/kxQ4HRx7SvH8EUtF2ucV6vMW59YITUv3wrMjUSxPsBqk+qK4ksl9PRcX3WMLRlpDmOkmb8s9CtF+Yv/QWwgJpwNntV3Ed5c5V462HIkxBfocZ9pk X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13016025)(5005006)(13018025)(8121501046)(3002001)(93006095)(93004095)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(20161123555025)(6072148); SRVR:MWHPR04MB0513; BCL:0; PCL:0; RULEID:; SRVR:MWHPR04MB0513; X-Microsoft-Exchange-Diagnostics: 1; MWHPR04MB0513; 4:duG+GgKmDMQvD05VlOL0o3ifxkO/cKVdAzzOMQY5naiwKzUm/SYdU4Z7EkurbcyeglpeOZ/A4mP/ghjPQuGnz+h5u1NwyGQkzTnAUxZUKO3YCvi3CT3f+cJTIXh0SFumTIs0wJ91N6huwkJk0+nvF3Mgl+9ykHioWFJ4x3K8npjtVYJBh8S2TplYNZNln2Hsw6hEt7x+gpqkbcrJm/5jGm0/tknxdKj6GRKN3HZw2otdrZfOKLekowYs6FVAggWNNctYitJGAGWrEKqKKkykNIzWKr4YtF92BalbaJt+2SHqkjuE8vdPr/V9dlXhbXcgax8yTrnMbq8hvLzJqWYSPXp6zfQpNJiuVK6a1OmY+oQ4/XaW6xTXttAcS9HA7dil6n+ntv7fVNJmO7Vjzmhq+7S8dwA/Ief/xgb4i/H+WZa7USXa+G044rtVH5PNeIK5pV3NfHXAuepuTkjZJ4mp/Ywfv8mDxQbOXgdZiK8uOTR0jOR3bnOyq7H8prt8B7i3on4SlXlFNFGFhuelCRiQKnAFf9CgvMv65mbtc+ZibfaTf9twZniDsjROQgoyoSk6g6ofRLIuB5C7KMv5BoyuvQankRhsRZUJsf+/To4EG3bAP20prbGzNN1yo870cW3LSSDTiyeclsRP2VM30dEijK9sybSzjDT3t1NHPwDz2gu9seaYHr1KC5Y12vbZlkvUR9iKJvNr+gA1oj/0ft16gkFbbIzhIfMJK2Oe3a1s6ZTb7gB8WYIQD0zMALxyan3xnpbETJO6replOttvpBpJmDC5HJwVjMHqrskBEoiA3bVTnra984FhzirPmume0lHu+5WL3rkMtBfGGUaPaJNwh08b5lv14CtnUCBx+JVJZnHOui6Pd31GM+Zw+yN32UPOhbUz5YpBrnHbnA+K3Vt6wO+Au0Nfd1DcWn30XhONYP U= X-Forefront-PRVS: 031257FE13 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR04MB0513; 23:mD34u8HVkXB05BuvgigzepTeDx/s6LHX+qHJVOL0c?= =?us-ascii?Q?M1Rf7Z5+TnF177GDltmTzjmUQrFdNFqYQGMCi499Ap/LYLqqYci5iMjLz/Pv?= =?us-ascii?Q?BaWv4notoMfbz5ywcEfgJf6KC3Bs2kIRrSk22fVVw+A8F1Pf0nAVi3EzQj7w?= =?us-ascii?Q?CF44EQc8J8KQcPIGrOipDCIiJnxEere+luhKUCi+XkJFjS50wRjY7hLbDE/X?= =?us-ascii?Q?OvMCcCoAfA83J6+HcBG5rdlqM+GvkmeaYKKsmR7HGtFnA6EPWQGE57CLyUSI?= =?us-ascii?Q?U/6J47tBgkUdorgMKtEwgVtBaNy9TBD7v80wBF00DziIwCF+jMkwu7r9xP3W?= =?us-ascii?Q?G/YwduBMX9lrnE8PEt+DlhjsIhsTKNFSGO1oolCy9R1ub8mBO7WngNYISvlu?= =?us-ascii?Q?grGF8UJPrSnPFwSxqvzQ6DTwQyVsSCUUnSj2jwhNFuMjYvJjvXbgVFsmzNVS?= =?us-ascii?Q?HAazFbjNvGL5u2eqqr9CeKiZF4+Stshulc8jMZvy8NGMlg5yN1RaUP8H4v41?= =?us-ascii?Q?mNYt5j2Mg9SW7MFzyX+9MDfOTR2bKDeXTehuqUvZ1oGFufWzkJ59/MQwIoBr?= =?us-ascii?Q?YOP11ALm7Bi0mroQZCvjHwyVkN7QZESwg3Sg2IFan6g30VFG1oVhrnyo7HXC?= =?us-ascii?Q?bWY4CUcmpEiHtLtv9tfbzQRUxUCW7zkJ9Ke4zEpdzMmL5NS7nK7UPBmRtAML?= =?us-ascii?Q?fH6+cAJQ767IfebAbONWw/ah5RbdfyAJbvEVMf0lHtYMF82K8z7+uhB5Kpri?= =?us-ascii?Q?t5S5/ffE8jUntYh67p7jLfPKKYJ/HG/c79kU5kZfBPqiEZMle0o9gKOBGsPM?= =?us-ascii?Q?WZ5pBJgp2BK/inkfUJKHWT93M0Ka9GXEQEc6eXSf+yoiV+AXYAJFqyZ7UqNL?= =?us-ascii?Q?j+6y7RicY6Csoz5iGsYiPtrWaYbpXUyqlQQ2+54TK5FVt11HT9SUtrJ9kt6g?= =?us-ascii?Q?iIQPpYRP2aXzmYQJ/wGs6C3j9aJfdzNAwV7ZWZytSd5nRk+8LswH8fcsiMpI?= =?us-ascii?Q?a1e5liqjCO36t2+ywox8Wv44R8Mp6AVswhKPVcGQ4DQINZrvTuCq6NJ2s3uX?= =?us-ascii?Q?ToFUzQ=3D?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR04MB0513; 6:KrnnpRfRqbT/Vd+IukCuQXWGn4UuO7Kg0K2N/Enw9o6PJJiywI7oyTmXAkzOJdyyBsAh4Gs2fVIR2T3O4ufhFXtfx2KfsoxN8wFXs2Q2fX+/uyIsxL7ZEvlZp2ulZiYZStyYkZ2H1YZ1/kAWdcPoibo6ZkcYEJtK1mwQxPNOPyHB2KLqXvIgYHDcjo+ggNqtvm3nEdpd0ufQnAmmZTFhFYWA2frJ3WOO/SqfDWUYCiK7pYNM/VBjmFCtonmVYGw+BM7HD20Qe0cDXHxuWJ8UDb4f0bDKFC+L0/TvApUTd+jmXPU/f3p9IV6bQDhzhOrnWWtnUjLbHvsDP4wQsd61k+BCzNhK8EvL+ZcD3q5UEupB2lhSjFNURlqbK3Dz9nwyYgFfNW1LDoRoPSbmoIj7nEadxPPOwoEl+dZQJ8Zw0Ki4YG8g85leSGZTUwtD3pMVd6Lpp/plwc+elmqNVLxS2VvmKWhJlNwDcEKfYNX1Xie/I36H+M6mIWXQhTwUkQqOOykNcIQCwY+x4wpHdfPP/dSLshKYZPNT3H9CWfJ5Nu0=; 5:cvEPdKJ2WNpL396S031KMYWxqvkDvfB/r7MqR4IKZclQClUUmNMWDxiSN25m0Tpp8hdbM+W+Ojrhrsa+EJj8opyFGQz3m0G1PjzqEPziUoyyyGLT4WB7aKU8kfz2PU1FsT/pt2ThGxv06CcOFxIOcQ==; 24:g5/GYMsK9BgVDY7XEFJ+La32S452mgNV/Xgib5BOVeI7g6QAWwMyhKAI/ZRxzR2oE7c9EvI2moJLmNbzsymkb801BWucCXSdACrqrqC7PIs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR04MB0513; 7:9+isVZpVlADSBNd89Xg+deC8tujWMf9noFPW5JB7zoY9qBaKssMti2efVaBXT/0UbfkdQqDONzO2S09lTWQRIkQF/KcPLCBghSFWDbdvpiLzBmEm0BT9GsKL5hIEoXLQMDpFZZzJJ3iVbvGSlCp7vW9RvsH8BXh/tjHRDsgUEhaK9GzSdjKkR3hY2mZwFCvndwAOjH5IjwlMos7DTZJrXCq0rTX0DaH9NIZ/vOgIbGsrsLymy/YyjGKln2HEZcYfFMGVwbvvY8xU0xUm4+kde9vVfX3y5Ev2aBKuBiYr5wJBXhuAEMKbKzLdV52J2AAVyM3tmqQOD56C1Xj2xI53ZQ==; 20:HmVDaz0lAjyp7P+sb2b9jxecGL3idL1DJ2OkdT8z2p+/PZEMbRXON5MYBeHlhq1TmxAm6mWZ1ug8XO5B6fUGixZYJSwM9ZrQk71WVQgilvNlSvXGB9Ntg8n6w0GzqfHpQNxFDYztsZCKSsAtQCpXyasRLzoVC/yhrNydJuZ7Hwo= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2017 18:30:20.4267 (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: MWHPR04MB0513 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Just like for the scsi-mq code path, in the single queue SCSI code path only add commands to the per-device command list if required by the SCSI LLD. This patch will make it easier to merge the single-queue and multiqueue command initialization code. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/scsi/scsi.c | 9 +-------- drivers/scsi/scsi_lib.c | 52 +++++++++++++++++++++++++++++------------------- drivers/scsi/scsi_priv.h | 2 ++ 3 files changed, 35 insertions(+), 28 deletions(-) diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 7bfbcfa7af40..485684aafb9b 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -108,14 +108,7 @@ EXPORT_SYMBOL(scsi_sd_pm_domain); */ void scsi_put_command(struct scsi_cmnd *cmd) { - unsigned long flags; - - /* serious error if the command hasn't come from a device list */ - spin_lock_irqsave(&cmd->device->list_lock, flags); - BUG_ON(list_empty(&cmd->list)); - list_del_init(&cmd->list); - spin_unlock_irqrestore(&cmd->device->list_lock, flags); - + scsi_del_cmd_from_list(cmd); BUG_ON(delayed_work_pending(&cmd->abort_work)); } diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index efa5741cab02..a8d4f17ad5aa 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -583,19 +583,9 @@ static void scsi_mq_free_sgtables(struct scsi_cmnd *cmd) static void scsi_mq_uninit_cmd(struct scsi_cmnd *cmd) { - struct scsi_device *sdev = cmd->device; - struct Scsi_Host *shost = sdev->host; - unsigned long flags; - scsi_mq_free_sgtables(cmd); scsi_uninit_cmd(cmd); - - if (shost->use_cmd_list) { - BUG_ON(list_empty(&cmd->list)); - spin_lock_irqsave(&sdev->list_lock, flags); - list_del_init(&cmd->list); - spin_unlock_irqrestore(&sdev->list_lock, flags); - } + scsi_del_cmd_from_list(cmd); } /* @@ -1133,6 +1123,35 @@ int scsi_init_io(struct scsi_cmnd *cmd) } EXPORT_SYMBOL(scsi_init_io); +/* Add a command to the list used by the aacraid and dpt_i2o drivers */ +void scsi_add_cmd_to_list(struct scsi_cmnd *cmd) +{ + struct scsi_device *sdev = cmd->device; + struct Scsi_Host *shost = sdev->host; + unsigned long flags; + + if (shost->use_cmd_list) { + spin_lock_irqsave(&sdev->list_lock, flags); + list_add_tail(&cmd->list, &sdev->cmd_list); + spin_unlock_irqrestore(&sdev->list_lock, flags); + } +} + +/* Remove a command from the list used by the aacraid and dpt_i2o drivers */ +void scsi_del_cmd_from_list(struct scsi_cmnd *cmd) +{ + struct scsi_device *sdev = cmd->device; + struct Scsi_Host *shost = sdev->host; + unsigned long flags; + + if (shost->use_cmd_list) { + spin_lock_irqsave(&sdev->list_lock, flags); + BUG_ON(list_empty(&cmd->list)); + list_del_init(&cmd->list); + spin_unlock_irqrestore(&sdev->list_lock, flags); + } +} + /* Called from inside blk_get_request() */ static void scsi_initialize_rq(struct request *rq) { @@ -1146,7 +1165,6 @@ void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd) { void *buf = cmd->sense_buffer; void *prot = cmd->prot_sdb; - unsigned long flags; /* zero out the cmd, except for the embedded scsi_request */ memset((char *)cmd + sizeof(cmd->req), 0, @@ -1158,9 +1176,7 @@ void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd) INIT_DELAYED_WORK(&cmd->abort_work, scmd_eh_abort_handler); cmd->jiffies_at_alloc = jiffies; - spin_lock_irqsave(&dev->list_lock, flags); - list_add_tail(&cmd->list, &dev->cmd_list); - spin_unlock_irqrestore(&dev->list_lock, flags); + scsi_add_cmd_to_list(cmd); } static int scsi_setup_scsi_cmnd(struct scsi_device *sdev, struct request *req) @@ -1875,11 +1891,7 @@ static int scsi_mq_prep_fn(struct request *req) INIT_DELAYED_WORK(&cmd->abort_work, scmd_eh_abort_handler); cmd->jiffies_at_alloc = jiffies; - if (shost->use_cmd_list) { - spin_lock_irq(&sdev->list_lock); - list_add_tail(&cmd->list, &sdev->cmd_list); - spin_unlock_irq(&sdev->list_lock); - } + scsi_add_cmd_to_list(cmd); sg = (void *)cmd + sizeof(struct scsi_cmnd) + shost->hostt->cmd_size; cmd->sdb.table.sgl = sg; diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h index f86057842f9a..c11c1f9c912c 100644 --- a/drivers/scsi/scsi_priv.h +++ b/drivers/scsi/scsi_priv.h @@ -80,6 +80,8 @@ int scsi_eh_get_sense(struct list_head *work_q, int scsi_noretry_cmd(struct scsi_cmnd *scmd); /* scsi_lib.c */ +extern void scsi_add_cmd_to_list(struct scsi_cmnd *cmd); +extern void scsi_del_cmd_from_list(struct scsi_cmnd *cmd); extern int scsi_maybe_unblock_host(struct scsi_device *sdev); extern void scsi_device_unbusy(struct scsi_device *sdev); extern void scsi_queue_insert(struct scsi_cmnd *cmd, int reason);