From patchwork Fri Jun 2 21:21:58 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: 9763489 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 2381A60360 for ; Fri, 2 Jun 2017 21:22:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16FE328590 for ; Fri, 2 Jun 2017 21:22:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0BDC6285D5; Fri, 2 Jun 2017 21:22:42 +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 43CC628590 for ; Fri, 2 Jun 2017 21:22:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751180AbdFBVWk (ORCPT ); Fri, 2 Jun 2017 17:22:40 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:9455 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751262AbdFBVWY (ORCPT ); Fri, 2 Jun 2017 17:22:24 -0400 X-IronPort-AV: E=Sophos;i="5.39,286,1493654400"; d="scan'208";a="23661937" Received: from mail-cys01nam02lp0054.outbound.protection.outlook.com (HELO NAM02-CY1-obe.outbound.protection.outlook.com) ([207.46.163.54]) by ob1.hgst.iphmx.com with ESMTP; 03 Jun 2017 05:22:19 +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=G20B9o7cQRdrFpNVfJ5Ap+K3bLYtJtFfOvnP7uU5vDQvnFNrj3NABYMiAs9U+H9ZfRnisXOqEoU645VyWhbT1ls0RCcjuunwk5DPio0nSds6o5y+eFwgVvavOCm8SV2bST4KFFJQleejWpuvaEOba8v2iPIfYA6/8gaGceUELqE= Received: from CY4PR04CA0027.namprd04.prod.outlook.com (10.172.133.13) by CY1PR0401MB1468.namprd04.prod.outlook.com (10.161.212.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Fri, 2 Jun 2017 21:22:17 +0000 Received: from BN3NAM04FT037.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4e::202) by CY4PR04CA0027.outlook.office365.com (2603:10b6:903:c6::13) 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; Fri, 2 Jun 2017 21:22:17 +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 BN3NAM04FT037.mail.protection.outlook.com (10.152.92.196) 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; Fri, 2 Jun 2017 21:22:15 +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 73.D5.51736.407D1395; Fri, 2 Jun 2017 14:22:13 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Fri, 2 Jun 2017 14:22:06 -0700 X-AuditID: 0ac94369-6dc8f9800000ca18-63-5931d704bb3b Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id AF.A4.18148.EF6D1395; Fri, 2 Jun 2017 14:22:06 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , James Bottomley CC: , Christoph Hellwig , "Bart Van Assche" , Johannes Thumshirn Subject: [PATCH v3 07/12] Only add commands to the device command list if required by the LLD Date: Fri, 2 Jun 2017 14:21:58 -0700 Message-ID: <20170602212203.30401-8-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170602212203.30401-1-bart.vanassche@sandisk.com> References: <20170602212203.30401-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPLMWRmVeSWpSXmKPExsXCddJ5kS7rdcNIg48vGS1Wrj7KZLGxn8Pi cdcMVovu6zvYLJYf/8fkwOoxbdIpNo/dNxvYPD4+vcXisfl0tcfnTXIBrFFcNimpOZllqUX6 dglcGb+enGEvOKRW8W/qbLYGxkcKXYycHBICJhIrH7eydjFycQgJLGWS+PL3CDOEs51RYkPr GVaYqrnNi6GqNjNK9J7/wg6SYBMwkvj2fiYLiC0iUChxaVsHI0gRs8BMRomNV44xgySEBWIl 2hc9ZASxWQRUJN5NuMAGYvMK2EtsXzMNaoO8xNktO8HqOQUcJL51LAGyOYC22UtM/asFMlNC YBKrxIUnu5ggegUlTs58AraYWUBC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tering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39850400002)(39860400002)(39450400003)(39410400002)(39840400002)(39400400002)(2980300002)(438002)(189002)(199003)(9170700003)(1076002)(47776003)(189998001)(106466001)(54906002)(5003940100001)(77096006)(2906002)(356003)(50986999)(8936002)(76176999)(36756003)(305945005)(50226002)(38730400002)(50466002)(48376002)(4326008)(81166006)(53936002)(6666003)(2950100002)(8676002)(33646002)(72206003)(5660300001)(478600001)(86362001); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0401MB1468; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3NAM04FT037; 1:YzqQQ82vJm7b9sag/RUSQlFZXK4Z3mtLsHJZQF/YT+JuvhfCeUTrGGDTPRSD0Fj0QnVc0USivI7sz8kdBD62zFVcX0sMbSkT3+SNLsEjPGzK/0FsQ2ZW7tpjjhwJM88v8Hl8JP6G34yociTMsH0qBV/WlRGZAGCa+vshHNqHEi6ELHxkioNPqPd4Z2jl+QT84mlzmCC/uEXCjkl50HiU0X5EBhHzEsIWCbwJd7C0wgfYfFQiubkBqqQpYKSr2EkbKWjN5v5dMd31ypdBUjTqE0g48utqPQxAKHGyYuGljMEj7glBiWJ5YTXPgvfln3IySJdzDxYlHuYDpbmdR2jqvcJ1us5L+YJdzDTVLrPl7C4TonJge0IYOGGDPyu3CGZK8uDGtSaYN+LvVxY6l7rz0vW3GvcEVXFfGVTxUPoYXibthSgqn7aRPec7TycXPFLAZT9U7kgpemP8bCUdyX89ZZzeU+F3vdzwdWa3cIIPqu1q0Xd6hkCRSch87DH8ToeRq53BkDhDWAPPkmAp807gjC8LZ/pAFcJ0arb1ulWmZDUX6RT9eLBzKipGmcCSgQpU X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY1PR0401MB1468: X-MS-Office365-Filtering-Correlation-Id: e4c1354c-7870-4af8-4620-08d4a9fd7212 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:CY1PR0401MB1468; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0401MB1468; 3:9jXQbZLqpdqOhRxniD+brCFhEzMuJEKAhZ3MajnUsjKBPMHpCQyf8FCEkdDqRji9Qaa2aTWk7ghHddBlVuon5UAwjiCrbTSRzAyKPIC4lN453Jf6sD+PPp1APWCGdL9RYdjvpT3uGs7m1eWMZqMboHH+4nn+A0FRwJCIPpxRLX1YgD0cFbYUCOSkA/jEst2W6voS5AnCVbGVyEALBHGXshedvC/tf2k/xk0xF9SgcH2PaC9dipdUweNYl+MbZJQLxMSQXWTrNqQU36UoJ4hoViLB2yc5EDqUgjskh2b4AOabeTAdRHA1bWKPQPv5ngaeOHbdFu34Pzbj/tjamsVkPaPGZ1ZDC3juVLNpc0N5EKQaVmFEy7p+pbcbA2OHxbhCZkDmTGCrkpXIHXPltPrYdgvB953TbzLjet59wCkkPkBNMHz1GoB7NId3IDTaNCbAokVN1/Dr19n9oiNXG4MovGFut9k7K4vQsCKv6F793Bmnw9f42tApfasOxenxOlnR X-Microsoft-Exchange-Diagnostics: 1; CY1PR0401MB1468; 25:jW4No32bRIMgum+R7OyB9mvlHh3po1AmFcnGiv/zaory5lQ7CIr6PGs5KWHJEijIoTS28bbb4h5bRhwYQz+av+7oU6tTxD3zwQJNd3ZPNe8UlcRNIwZv/NP9AXpuWNCRu5QxazMxlmJTzxBLYY29YJE+mheauNMgxjMLm1OIJ2uHW0iJy3iODgtJIOmKyFdRHqXJruJ1fqPsbTYj7NQSHi/OXizdEslmqKpUDTsAcX4Yzz6+VIDwHzJB9RXqWyBlC6nfgAbpT+3TzyEiGZsZNB+dEtw5DnAG/F6Zzgea1wgtWfAhYkxeFgKa8rGkWBywq2ME2/S2SSMzn/+9JdoHm/j4+NA7OsevAAvJl/EnJ+22stQ3N4sIqNGdUI5FXF4OiYDyPkTnXH0MV98o7AFN+xPVWZ0CdatvAt62SLCW48IoLE8BIsYgF/M7oq8dV2dXwDmx7ttX9GA3k44AeUyGTeHjgUTS3zpdAW+o5xDczb4=; 31:xpbHgJh5K5SSBYnH39bU2R9zQdQ2D/t3sLyh+YOwZf7s5uoa/vgc+3OtSS1lsgJpr66cIzXTAoHDcP+VDmI0R7nSf4Z1WuiKukpVsIQq/nivPu9Q8qRoV5jGgMDF+Ey1vC9uXC0G3DoVqmgUkh13KEqSraMDqUNRC9RQkFIHnTEEWXhS4X4p8NKaRG8K0upq5GMuWL5omKJnsAmwRA97fUBjzx8aSQA4c0+eIvZ8STacEDvWihk9Ow68YpQh7K6d WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; CY1PR0401MB1468; 20:SAemz53US8z2v++bNSIyLhsUxkDYl6NvZuhsdGhR4iBUqjhiOTGvmgdQml/dBOPT+1/ITb4sjF8xG1FlJfF0KicrZNuFsdbIJkjM9k80xsYUaSniOk1f8WIUUhmrO02bYEJdx/vwsDzY9gdI+qISZF8/JA/lJPIs34GPq+f1Wl0tINE6sy9uaYMMUljFWIula2zKCuSeD+8Gr8QavT+D6em1ZUS/xogrZ/A31cxDmTwSRd1ps9GR7M16HeJWF6kps9TeLVs7KBAHem2GkXPc3EeGzIdk2vFIs/0IU6saQUCkhsryR0mUUir53Gdpv+RY45R9XBKHDkRvjccrsYJyOkuvATixTDbumZlqhJZDFXOzb0LMNMyVyPYyDzatd5HYBVcu5UpGHnZBKMp/OqcCXFZMuH7T+muRYcWDBWXiK6dZlom2ciEIqGkx81PKRp238za1/F663xZbyBY9+iUSWiQWdwIDCuTvjKUXyUa+SkVHhYPMbWkAYccRf+Ik8AMy 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)(5005006)(8121501046)(13018025)(13016025)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93004095)(6055026)(6041248)(20161123562025)(20161123564025)(20161123560025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR0401MB1468; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR0401MB1468; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0401MB1468; 4:9NRyiyfR8isfHO4NXzdMdq8ahDCmEoFuQ0b7iYp/?= =?us-ascii?Q?gXXdf8Xx3l860t3TJ1yptn2fAuXbskYLT4vvGWS65WCNRM8QW87LpFHkvjVt?= =?us-ascii?Q?Xz/lfG7HEoIg3quBklbSYvQ7EPLy3WYPl5HYdonSJ/PfukvXH7PJjOuYzqpi?= =?us-ascii?Q?6e6DBXNv1eCS0TKI+wJXgNryOiaokgVzM94AUlbCm2Hm3GIuJC15gltMXOLX?= =?us-ascii?Q?jelraFEDOqWSVi0lW5sxqtSY+HFWs7X0zcHwVl7iHn9NtHN8WQPZxdLsz7Lg?= =?us-ascii?Q?2JEQtevqnJFm8NcQLQfeBXRLOiw6DOOx5ZzyZzdUjJMBnKGB+QGZoqRLzajs?= =?us-ascii?Q?LlsFNvcXLA7pRMOF3upldStIzhsLphRfHddFV/BVvOYe6KxT8ENhPfHHw0hu?= =?us-ascii?Q?5ritZyAhDXXsKs+nxIWv0Uw63K4oLWcuhJXyClnIrRKVPBq/E4uTAZBbD6W9?= =?us-ascii?Q?Xc0R1h0zakyqLX3n0X1CS1oVASvVt/4/BQt+IdQAbzVIWE6mX+ucD/PFNKlO?= =?us-ascii?Q?8lr2lQgbDHWBPaN//UG6HPLpI1Zs176TO71EI11tnuPb9iPDEtWe6gOovFeZ?= =?us-ascii?Q?JHSlLVjlEwJimnVGogvboX8JDTef+iwLthUvORmSPAL7HrhF28ZtGf6SgPRZ?= =?us-ascii?Q?1dzmaMzI3fwqSMLtx4j9lJZCmOLZQdnzGoSaU2HVSYFuZu9dZVsXAYDEsSee?= =?us-ascii?Q?3auNK7c7i07eyNh7FbPRxcPsgU8hD/8kQzcEB9if7o95tW0lMceBApCXrXsX?= =?us-ascii?Q?ozLPruPBZrCgFm6aPbuKfno4hTw8PJ4nC/2qfkWMqu8kQztsJQbsF+MuATT2?= =?us-ascii?Q?n2mDORoWvwPPQ2TiBSKpCBcEqsfRxxJWQm37HK6wY9tGCMv/mHNCKX7TDwar?= =?us-ascii?Q?Wy26mYIXjVqkGwqIUvh4rU8mAd1D9edk7E8r//xApGE+NVM50LLVpELN1Edv?= =?us-ascii?Q?KklShcRC5gNJbna8Z0QuPOiciBw1/v3chUKUspxweA5wSqoxk9X1ud7xnzd+?= =?us-ascii?Q?rEEIn6CgV8DrtbVTL7qU2CYONSpVRpcDm7EqMgoRPrUGIa1sW4xZjQpu8myj?= =?us-ascii?Q?BUBME9wg/wlxQEXmLCad68Xh8T7qX8WDsVWjy2tAKXiV3oCj1Uhpcu7k4al6?= =?us-ascii?Q?RiqnzO1XcTywKdemleKlH5x9tjQ2sBvaXcQgn0FSoGAZL1JqBQX+QVdqzhbZ?= =?us-ascii?Q?etJFshsIS1dz+3gE27aQxOdL2rO1WIn/Jj7rarwcjWGg4HWAhBtKHDdoSwP2?= =?us-ascii?Q?TzANQ+sg/lYlLdkV93c=3D?= X-Forefront-PRVS: 03264AEA72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0401MB1468; 23:W4mxpogovVFcydufpiheF3THXB85BcOUtvnLP6L?= =?us-ascii?Q?mYfjnNa2qaWYgNbJClaixaTWWi8G/gMToY0KDCnaVFmajc5Sx4s4Ahh2eEVk?= =?us-ascii?Q?uh7lZlMolo6/GN2glIGio8edj/zBL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Tgk6VNqSKGNCQx1b/q7rc6ftOUF9DoX1pz4WCUVKHlDnKkhYb3FVPJa8zQ2MbzTYt+emPkw1m9AiShNAyYtCjdicV6ViMhykcoFOjUtFTIqybv9wBN3P7KRNfgiTfeoxBpPdQK/okluBL8n712ley; 24:sDFc8Uc8JkVrkldAhHZIeYanssV9Is1YzQhrsv7R9vhd0JxeQKcJT6lOPibAIT3+nfiNZBQTHm72muQE+13WZC5ib31kycpqyOGPmRkyPic= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0401MB1468; 7:n+ZQZl3VE4FhsuxhuGI44uM5Y1cvdlWz/QhmiZ4sre4R9LIGCzP5XvafkXJJV4wGwz7QwI+SXGE5MR9Qw1LrZs32rZdjVIXZ1M9ye7ZaPk8qg9bxI2OzMl/I+iDDOiUm55/Anx71mvSaRKZWuo1OM3MxQuApFJQ3EqRA6A4zUfiUcKNpqhO6Oo837/k52jelUVG8t6qa5iitFfViqw0IUT9MOag5dyZEAp+ZYprtlSsL5Za98O0H0LaynhbFL8Yy3hiT0FHUKjJm7GQzPKV5hyCDjT2xUBCOKwxYFexxkyoB+VmEc6DgQfXZtBrXyfhGQaXJ+EFXitgungS2/P0QzQ==; 20:/1j0rYXJ4floV1AIgbdy9vAfpZl89pCealqxxwhhfnNEqs+WWFuN8/+GtmvXzjPr06qzar1bd7vFxsSGzLVhiXi00MSBzV2eGX3xMuTgqHlbGuR0bYPCLdb3IpZ8RgGm4cx1QlF7lXIEDBYcHYSSxvGPT6+iOhQ+1LJgq+jtj9o= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2017 21:22:15.6702 (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: CY1PR0401MB1468 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);