From patchwork Thu Jun 1 23:27:06 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: 9761345 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 615FE602BC for ; Thu, 1 Jun 2017 23:27:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5383D28524 for ; Thu, 1 Jun 2017 23:27:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4876D28544; Thu, 1 Jun 2017 23:27:29 +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 885D628524 for ; Thu, 1 Jun 2017 23:27:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751189AbdFAX11 (ORCPT ); Thu, 1 Jun 2017 19:27:27 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:52559 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751148AbdFAX1W (ORCPT ); Thu, 1 Jun 2017 19:27:22 -0400 X-IronPort-AV: E=Sophos;i="5.39,281,1493654400"; d="scan'208";a="22105968" Received: from mail-by2nam01lp0182.outbound.protection.outlook.com (HELO NAM01-BY2-obe.outbound.protection.outlook.com) ([216.32.181.182]) by ob1.hgst.iphmx.com with ESMTP; 02 Jun 2017 07:27:21 +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=S9dOANvSzHzT1T0rnsTOR9t/ZPoSeP3qe22ILwv8A60=; b=YlffsAe0uBTtJjoRpakyoIcRgMJDWPvSWWeZZWc1QqlspsFPq4QzZLSPVkpeJdSwCWPIF7rUSq2v/ToLTKo9FRnY0U75ugJrQYIAcbz3wJaSuMb/0IgusOvlBmsTzg2l5Ppw4hrqjdgY2ZjqO+YTAS7AmKsMxCOIrBle/hgJVOw= Received: from CO2PR04CA0112.namprd04.prod.outlook.com (10.165.95.14) by BY2PR0401MB0918.namprd04.prod.outlook.com (10.160.64.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Thu, 1 Jun 2017 23:27:21 +0000 Received: from CO1NAM04FT045.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4d::205) by CO2PR04CA0112.outlook.office365.com (2603:10b6:104:7::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10 via Frontend Transport; Thu, 1 Jun 2017 23:27:20 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; HansenPartnership.com; dkim=none (message not signed) header.d=none; HansenPartnership.com; 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 CO1NAM04FT045.mail.protection.outlook.com (10.152.91.195) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1101.12 via Frontend Transport; Thu, 1 Jun 2017 23:27:17 +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 A3.A8.51736.3D2A0395; Thu, 1 Jun 2017 16:27:16 -0700 (PDT) Received: from milsmgip11.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; Thu, 1 Jun 2017 16:27:14 -0700 X-AuditID: 0ac94369-6dc8f9800000ca18-99-5930a2d3e200 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id BF.83.11415.3D2A0395; Thu, 1 Jun 2017 16:27:15 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , James Bottomley CC: , Christoph Hellwig , "Bart Van Assche" , Johannes Thumshirn Subject: [PATCH v2 07/12] Only add commands to the device command list if required by the LLD Date: Thu, 1 Jun 2017 16:27:06 -0700 Message-ID: <20170601232711.29062-8-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170601232711.29062-1-bart.vanassche@sandisk.com> References: <20170601232711.29062-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPLMWRmVeSWpSXmKPExsXCddJ5ke6VRQaRBl8uMFmsXH2UyWJjP4fF 464ZrBbd13ewWSw//o/JgdVj2qRTbB67bzaweXx8eovFY/Ppao/Pm+QCWKO4bFJSczLLUov0 7RK4Mn49OcNecEit4t/U2WwNjI8Uuhg5OSQETCTWfFzDAmILCSxlkjizlb+LkQvI3sooMX3q YUaYoumda5khEhsZJTo3PGYGSbAJGEl8ez8TrFtEoFDi0rYORpAiZoGZjBIbrxwDKxIWiJWY 2d4FVsQioCKxY9tUsDivgL3EqrYbbBAb5CXObtkJFucUcJDY13KGCeIke4mmw7PZQIZKCExi lZhx/y07RLOgxMmZT8CGMgtISBx88YIZokFd4uSS+UwTGIVmISmbhaRsASPTKkax3Myc4tz0 1AJDU73ixLyUzOJsveT83E2MkGDP3MF494n3IUYBDkYlHt4HsgaRQqyJZcWVuYcYJTiYlUR4 180HCvGmJFZWpRblxxeV5qQWH2KU5mBREuc9JzM1QkggPbEkNTs1tSC1CCbLxMEp1cC4f99j R32VOTH//mlM5EotnjBFLezJKSeD8pqsD7wTDiuKfnOzuLTjxQnXUFXlVfXH/m3+Eslhe7VP OGFagvt/Tgfxud9YKsrTrqz6HlB19ZfcyxdLQxaYmp5gZr/9W2fO33en/glFmTF8usokL/D1 rubbc5Jbt0Y8Xf/5YO0Pp68/HTuDjm6uUWIpzkg01GIuKk4EADzylvxyAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPJMWRmVeSWpSXmKPExsXCtZGTTffyIoNIgx372C0O/mxjtFi5+iiT xcZ+DovHXTNYLbqv72CzWH78H5MDm8e0SafYPHbfbGDz+Pj0FovHtDXnmTw2n672+LxJLoAt issmJTUnsyy1SN8ugSvj15Mz7AWH1Cr+TZ3N1sD4SKGLkZNDQsBEYnrnWuYuRi4OIYH1jBL7 /z5jBEmwCRhJfHs/kwXEFhEolLh/+jQbSBGzwGxGieUXtoMVCQvESsxs7wIrYhFQlXi7bxEr iM0rYC/xfdY1ZogN8hJnt+wEszkFHCT2tZxhArGFgGqaDs9mm8DIvYCRYRWjWG5mTnFuemaB oaFecWJeSmZxtl5yfu4mRkiQRO5gfDrR/BAjEwenVAPjUm7ZR1wshb2X2GZXJdal1fFI/bpX 2JpddyytL42VOVVP4fTEOD3b1Qs/C33P3X5DviV/47b6leELLghVMq98ZKh11CN4ZuHK6J13 5p4urdhaG3rhGrPwTH1FnyMdZ90v92s/Pm/VFXF+xxvnSVKaGlZF18M/3PJ1OS4z00xRPKRJ PHjFwwlKLMUZiYZazEXFiQBO80ZmwgEAAA== 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)(39860400002)(39850400002)(39400400002)(39410400002)(39450400003)(39840400002)(2980300002)(438002)(199003)(189002)(9170700003)(47776003)(6666003)(478600001)(36756003)(189998001)(305945005)(72206003)(86362001)(2906002)(2950100002)(54906002)(4326008)(53936002)(5003940100001)(33646002)(50226002)(48376002)(38730400002)(356003)(77096006)(1076002)(106466001)(50466002)(76176999)(50986999)(8936002)(81166006)(5660300001)(8676002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR0401MB0918; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM04FT045; 1:jji7R+MmarTTRPMU3W1KppsRVGChUyv6F8NpdKS20uvNalcU/JGpK1Wy7/tIpf096p4YNnulUCWH/Vyy32LxBQjKLEZrV7ALKyJygFGLKm7Xx4vfa359+ghg6UlWxwrFixb308eCK55MiWe5B9zGDU7pX6GQy+I9i2AJ+MZVUmvh7VdxfDZjZRpv2wpBUqU5Vl4H4h8BLfO1ZohULI5ZOUNq4LJYTei1ZVCkC4umRHEa4So5ipNEmLoYMlhQMnBNeP5t+94dvv6IOKcCarNfVg8BBq2f7Dm4Ovf5fiEzghJ2vvaXUVThWzSoVBUdYwKLYxhEcEKKNsRkcxpoI7oJFA+raAx3AHvJ+q7QrHlcwaVibtr+HobRV8mKKs9hfCgwLX4zBMt3rfVlrHHBzy0lkHZJiFP5YkdHzXVN9xiumBocCzBP0YrLJU0a49O4HINNn+GZfFJFlRWcyrvQfgSNRp/E0c/HbnJFSZGzNvuw0ZbGIP2UfG7OIQINvn9U7bZwH4+Z2tzDuSuqa4dcZoV787J1qog/EPfkxe5nYF5l7Pc= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY2PR0401MB0918: X-MS-Office365-Filtering-Correlation-Id: d79638ca-533e-4aa7-3601-08d4a945bfa2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:BY2PR0401MB0918; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0401MB0918; 3:91oHfIuAZy/UjNS7Y0dTtb6cI2Tzd5um8flPD/FrjyE3NawclVmcFWkhc0hZuBeje+dqr1zhv0AggIuItSQDB3emUwpoy1qwsehPkoi8GkdLQVMIYXjWYHfMh6hAEwhm9gmalrXA8VvVXV1pyvzQV2AfiB/MBMMS5n06a2dcbPqrXS/fgtZBWzbjlyA+OrMBPXj6MZOH0RJkuZm5WbPrw7AjegV2304CGVpLiY33p1R8PuQFo3CY9WisSKLsebTuNaJU3m6GReFbskOZ4PRqeOD4xvz9hw8alcSLwVqxz5ViJ0fdwhYVKecfdSMnL/soChGgo26+oP3J3ZpHRDc5fzdU+5zq9w46dwWQ2GNM7VRgKrdxIjR4104FlK/wJQ70XQdh9T4PFeAfHe60qkCy2QNH2DCwDO/hQOlRsmrR+qtaNldNLGPIcBkgVRUR6SsSRoXI7qohaEhNote9WK6u3GA3deE1OwOO9iGTzREsGG7B1EiaRm/ghtC5Ofdr/NyHULAKIsfbWQCL7s7hqMDXNg== X-Microsoft-Exchange-Diagnostics: 1; BY2PR0401MB0918; 25:hAJt84wMwe+z+uxqXUhp+g4MZHg3Y9jNMVN74dkVqP7AJNoQ9p+8wJ1sCYUs0qK/HIYPWREaDPS1UqZnvGleyWi+c2ZlQeZsEhTtGFmsGNj7yF8eYx0FbUGUWHbQ05sg/MJbs56X23rsQn58U7y95qITVtPjE7fWkKMUfk2jHVbEDbv2U87pZ1+JMSswpUmfIq78BLdADOz8TYIhndGN1p5vncQPr9x6MeIWHheBNCDU98/Ge7ZJW2x1F0l2EWRZGtshqfuXNMmT8bDLGGlFFbLGyz5Olyae0/P30c9cDISuTS5mNPInJwyTOP7OIcDE5pNaNIW6Y0DA4sWTo3FXuf5N3+MbgN/gY03S+g1/fq/ov0oSAQj/yiZE4qumdZ/e9C5ZiOx/4zxMjp8C/MGAxemTGQHfMRtuelAwDIEWSaWw571BOdxl/h969KJSKHe1FClgl2d8r02yX2cnrctYJyF6cntspYajS/U/5CyWXYM=; 31:QrBcVFfL+5RhjBIFU4CTGWqT2MZ5wHj3ZnsQFP0NcpKQO7xyKVfCge4ViznTJYN1zKfgJShcHrDaD1CL6J8aLdgetZUzLRe2FJporMik831XZAzbQ8M312pQ7B9VgseCDkUEx7NFGGVjtfnk+tRC6bG0KoRtgP8aRmmvR7JF6N0CwhI/DGA7XBzurZMlQ8TsxGbYCgHvrIyJb8gcjmu6fhyqj+sFllZMrJtlU8uPlH0R0B5T8OtaLdF9x0p7x3n5 WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BY2PR0401MB0918; 20:WZlh4CP4fsUyNxj9/X12DqsYHaT/GfIhs0TVeh8zlnpjIAeIQJwoyEaK/5qSBfdYrjvuC9yYpNea7RIjadW0bv5dcn/4Q7RNCN7KhGR0GhVflamMNLSf9qN/vIgwwagcrNaFHHFBC+HCq/D1fPcU854tlKqaVGbbMt2p0ce4ulC0Z9a7nci4XbBGVDcHZSdQ897DAC6plNFk2fPM1dRRlOHnoKP+Tcdk8LIgvy8H1TCyoE0tR9FaJ47LrwP0Gc8hPqzF4U6mh25k1dt5GzCqM81Kz2t93AXhOrz7DjjG+GNUJw8dMxSjjtzkwS23JtucTIdpVikH0pHmoBUiU0Bnuy/M6SwqklxGCnFCbJw/gYlTsz4Mg9bT0wVtqHXaM8FLi2zO9piGfRI3gKoVLcDYlKRESs3T/SlJw7Uetl6KzSOfIWD9VwZV8iTvwgxoSPzCp8xVVQQCWg8YcUAOFylJdNA3h6Q9cuaya5Ei9A19utuz03xaRSbV3JDd+dS41mSJ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(13018025)(13016025)(8121501046)(5005006)(93006095)(93004095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR0401MB0918; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR0401MB0918; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0401MB0918; 4:RQPx18dg32Y3cSlXX0KJW7W2aruTRqeozRzjnw+5?= =?us-ascii?Q?9ZHkCrF0ZEVXW6+SOEAUclYMB9eD4r2iiURbb3+nEkWc3ASazQMNUb34t49c?= =?us-ascii?Q?P6g8AWhIyv6B7XNNjTnYzr2xh9OSg0H52MvTWFc34q45GtlU5X2YOZ6gLkI4?= =?us-ascii?Q?H/trwNajcGrodpJ3Y1fQoDVpPeTriQg0ARhmn9iYDmxZeSGieBm4KGoU7Tb0?= =?us-ascii?Q?q/FpwwkhTUKW6C3Eny2Gsfi5vimU5LeeobzfHlQQvqjXWzqwMUKO3hu4q1s6?= =?us-ascii?Q?dCtunT2WL325ZePNha6tCgJtkkzDIXnjmYV3L1oBkiC3WWXY4Y72Lsv5bGvN?= =?us-ascii?Q?yd3d4FQojd1SbRV4jUZ8lKdJuTaw9oPFj/uVg+omN5uv58lDgkK69SpelFY6?= =?us-ascii?Q?XgquZXLEI2zvCIsf7p4VOa5rkCzA5FnUh0DtE0n8Wa+p3/QJC3eQUp0hmDBM?= =?us-ascii?Q?Pf842HLnKIsqQATaQdc4K0jwrXv9aQ/faDrPjxPZyAfWJtaStFKkhLAqQeOZ?= =?us-ascii?Q?LB+bjR8N7Ndl5E6DPPFCTnUbWW0n2q1GrZBQd8q0uyZOoWMJrdI4Tn8q9t7x?= =?us-ascii?Q?X5xJPyhUxGlPt9YlnfSP/oV+OtKdRfQ9MfCm9GWFFGPfbVGjbfsfKco87Sgp?= =?us-ascii?Q?GGQJJc1bBl+/yvFDsGHmy19RW+hviUbxy8i9A6GyhdHgHPdqsk2jt/gpqgNS?= =?us-ascii?Q?G2gF8nDcemzkmdmPnoXC8rO7wUiWOEF8V0d3VERyHIaA40xTM5HwnAdwk7vu?= =?us-ascii?Q?3tV+8vN0rlsOm6vTgJEaaI1PLzmSAwRS5DBn7MDGnLwFpcWBadWDlI1oXtn1?= =?us-ascii?Q?5+foOq9eeL3hoRoIBFaSglqtnsTu330DFb5h0ZYwa6FyfzBXpD6GRaVSPl/5?= =?us-ascii?Q?mEeUapImbPU5hYQMi968ikni1PcJZk2kQ29P0Cwm2UGoXR3WzlbNPV/Pdo1I?= =?us-ascii?Q?b4ErfkUucl/hnhar1mfr/ltCh7RxN760eUu8bI3a8ZmgfCK8DjV+lplXeFGm?= =?us-ascii?Q?WVoJLHFRST+c36EBbOado6xY/Z4M5no4lCpBVEXmQs/Yucq6E4OK1lrANY7x?= =?us-ascii?Q?ikMaNg95AWTd3drArxM3Endu+K0KxkA46D96BctkERk9eRJWDrIA1appUhQJ?= =?us-ascii?Q?ls4P+nmtJoeWqYpLUcrLu3k+d1M0k70KMf9F639Dm5xzUph/cIjh58p1HPEi?= =?us-ascii?Q?1Fh1qK9N3E2//PAU3plFP2VXFwT10mgaXwr+VaTsVYIde6eFF6oqq1vO6z26?= =?us-ascii?Q?6CStmeQOfn7j3hbS/p8=3D?= X-Forefront-PRVS: 0325F6C77B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0401MB0918; 23:lc62vbMzipAmiOJAsvhrRnhyAZ9xe1GiZuIKBN7?= =?us-ascii?Q?CkEhSKAn3c6FOIbUVrZoDv2LDGkutFqBf56ObrapTdsSBiHrVoyd7DA44ZNd?= =?us-ascii?Q?pUnLk6LhZ644ENUk2UIgfdZczbccN24Wz7a/SjVBQ0hnQ5Y/+TedgAxBohdU?= =?us-ascii?Q?ESKplhdhXLgJe/V7JHJeVJRMpbYeYz6OVYZxbVtAN71lB4Ov42A87NnpgogH?= =?us-ascii?Q?qph+dQ5qhNokFKE7ndxuw7VZU/JCLhUrEZ4kpHnVD9fje9BiBJKF+BeeeFr0?= =?us-ascii?Q?3oTQMID3kTVdz6Bu82xXTa1nBmf2ci3XTA27QhjVwewXmLyRcymN8d/XWEdq?= =?us-ascii?Q?bb+b3KKYqQsIybMBy6IYiGzLL1ojiFy+T+heqNaC7AOxRa96pMe066CCsaIw?= =?us-ascii?Q?Sx+yehtamwxQmWmjIpS0G6bwthK6bI3x9uFQdbCNnHn5UpDbnPlewaUqg3zb?= =?us-ascii?Q?eOymSnrXNDYKf4c9COo8N2T+obg6Vay42tBNtKHXtsjjOc5glvCL1GH/+mjs?= =?us-ascii?Q?htq9DmgD3K3JWmst3NpgCQmwRck/kww/GUKRgfrMgk3+KqWfviIIXxpgAZUX?= =?us-ascii?Q?qOpGE9Zjdpd5DQBEaVkbskB1dkomO1f0OzYbA07qOe5a3Ng0hfucbfepGp7Z?= =?us-ascii?Q?LYsqvQPnH0ehG0WOhkqSJ2cCABd95WnFtB012P6IM2HTP1fcZVyn75y7QsEA?= =?us-ascii?Q?DYFbujduUs/I9VLZVXEf6cQOnxnyOyrVHGXs8+2sZx0W3IR+S9eKqR6UNtvQ?= =?us-ascii?Q?d1eHlunZsZBfdGvMIYz2fspJS6xfoGEigwthg9U5RlCFs+KOBgC5ulygcMuP?= =?us-ascii?Q?kvM466J0wzbheLL7sXuSZb1OM8Q+CDR0mbEZr/HLCNNnZ5hJRttFEwaLmWpV?= =?us-ascii?Q?gaKirbHnMI+x2bvQKCg1r8w9/ENevMn+d+FEjE7Rmza1c8PbuOKM9dycjzla?= =?us-ascii?Q?5j+uT6ffXOuT2PugyaGfVEguwWVQSpKf2PZRPdX+MGRUx5Dk0Ng1G22tG4np?= =?us-ascii?Q?+zATruvYhrRJhulepR+omlI+xiJRpRVK19US0GnqPN6GoOGVXpOoZ2GLrYHb?= =?us-ascii?Q?exTpA+g8=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0401MB0918; 6:Zgo9RcaIFAxhnB/tDhdnO+kPPZx3FJs4jvKTVyUOB0R/2cLh1pbRIFwl/mnWWf5SPwonrjwMB/k+2HUhOBpd+pNB9rGlOwFhj4flpWl9/vOVLV/XTBf+k0PuFwdLiqftuD257U3A+Y1DyTnFsAs0EK2hOnKMUbrlULg1ZwPfufDg7g1tunLivYLVAzYjXLHkiF4uVYx1C60I+shy4QNFd905X0kLWC67VgWaQY9peLMrBjtIu0MSIceHy+33BdelNjz7Gdu/hTyEk6dX7A4Op2Ss4+tH3yuHidqIFyqK10M0GNXEDEU6IVfVhuc6hEI8kGXKBY9lC5V71FRzSu43N05t50DRRmHS6qeGZDVX5IklIYi8P6kYsc8U+nAROzvdtO/2sHH/QrUWs6Mococq6vXsL1+nHlkQZ5Q+M7pwmVMFYqg/nH1qykntE0XejLOneLKbCKZOOOAGuSbdypYT4dD0BY+PqTDralRX6ZHZPxeOkyV5F9J5iFXmOZ8tnTtWuwCrjjJwG+AYn4Sf3N6mKz12lDMenrSqMg3uqqnqScM= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0401MB0918; 5:CoPzz0CIGu/5fQVzXgxm7YPHe/3cABszQg/uWP/GWt2R/iKwDoB5vvDR9thrvQn5Mme0Jjs9MHFj35C5UUYbpUginwbNFVMZDgkegUTNWnGdTsVWMxI9j+rtPiEpKq4ijljhxnkhT2HE5za1H7pnqho+/DDVvWAL8lYPSJU9NTGrfRf02LjromqncUm0Q9ECmgGxkENW2MRj2/KZBE40RLqwsUqVJZuiBWbErPG/8eSWoF/tnKzdpfHamNhhXwN8RspXocR3WnY1VUV72jRiQQp+89iXviJqWFsvHOnN8GpgsvEIXtw//CXJy6JYwuabqkBmLJgo8wdHgTY77H7C1DuEL6H/OPTGyrlDrrW+uRuxe6LSaSDGxkHZdPxAijO4wzKKtZS7vgnhTWKTSkEGvv3XEVLTakKTipTK42o31kpElk60zpiuIM9XxCCysMzAq5sIizcr6Zv5iYdOqkC6rW5uKGHk1HUhDPVpQOO3WLY95LYZmaW9565q/O8KnzXh; 24:lBuNn0LHxIGan8SJx+EYSTkslyUEVxR2UwfVNngcB9n7B7oVNfV28WnF1VJRU2dT9LnFW0RfnPkAJUED6e5o3zALpjsx8+qb7ezGhFgKidk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR0401MB0918; 7:4S+p9lTrUNCUFZp4reIIGrUCIrtxOdU2kNKdlln1+rZLr6OCiV3+PnS9+7SlhCV7bi9+mejeZ9hMbVM2Nq5CM4zZPtHKnqAlMW9uNvVJj1LjLhzrj90NfyV6vrA1P+Z8hZl51YL61a9kPQAWE+1v6Mnz97cS2OigKJFKhkNUY9X6nJ0JrWE4ZTHROeHYK3MODsvsArgBxKPv0BbmKVYpJjjPML4eq8NGFrgWopFG+7u4QUGrNsDQ3EhEG46RcZYX6pp9s79q70eyNYV3nERl3hjaPw2LBesckBL2OLbgzwkqS3fJm9W8+ZMSXWosh+z7vttJkDNCozupkTFFL9CH6w==; 20:IVGFMHXmJoNvsCLW6VfsvP6+P4GLfKDMHL++rJ7SmO0j8S06k120Fo987JpaUbGPjurXCYVCt45pbopZeUfhcHx5eagE8vKDcl8pWY6EgfBXrO2AhJum8O0j297HVzBrPnf0ZN0j3L1e6OIHStaxgM4PcR5qB49A70Yn9YENC3o= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2017 23:27:17.9613 (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: BY2PR0401MB0918 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 Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Cc: Johannes Thumshirn --- 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 8665eccd2fc8..2c43b500e9f4 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,12 +1123,40 @@ 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); + } +} + void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd) { void *buf = cmd->sense_buffer; void *prot = cmd->prot_sdb; unsigned int unchecked_isa_dma = cmd->flags & SCMD_UNCHECKED_ISA_DMA; - unsigned long flags; /* zero out the cmd, except for the embedded scsi_request */ memset((char *)cmd + sizeof(cmd->req), 0, @@ -1151,9 +1169,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) @@ -1870,11 +1886,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);