From patchwork Fri Jun 2 21:22:00 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: 9763485 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 8B23660360 for ; Fri, 2 Jun 2017 21:22:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E00428590 for ; Fri, 2 Jun 2017 21:22:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72B32285D5; Fri, 2 Jun 2017 21:22:36 +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 E4B6128590 for ; Fri, 2 Jun 2017 21:22:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751164AbdFBVWe (ORCPT ); Fri, 2 Jun 2017 17:22:34 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:58224 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751061AbdFBVWU (ORCPT ); Fri, 2 Jun 2017 17:22:20 -0400 X-IronPort-AV: E=Sophos;i="5.39,286,1493654400"; d="scan'208";a="125046226" Received: from mail-cys01nam02lp0056.outbound.protection.outlook.com (HELO NAM02-CY1-obe.outbound.protection.outlook.com) ([207.46.163.56]) by ob1.hgst.iphmx.com with ESMTP; 03 Jun 2017 05:22:18 +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=4qurIYslTtdMouab5BmcGxbUCIXnT7oji8oyNudVjPY=; b=lw5co/gSGDfFnsy7ztQXABRAqaHS+5c2RNgXAmr+Q/cHOWvY/LiWlNNJFSTkeHBawdc+aYFLDojTNeuPvL2V9VZGESkc1HcpsXJTOLZqlyLLRAUBBnejmHLnBTRyhmFJF+R/+Cndb0T5Kbk9knF+3wInC61CXftw1p8qYwN6kzU= Received: from MWHPR04CA0100.namprd04.prod.outlook.com (10.174.173.41) by BN3PR0401MB1458.namprd04.prod.outlook.com (10.161.210.24) 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:15 +0000 Received: from SN1NAM04FT013.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4c::205) by MWHPR04CA0100.outlook.office365.com (2603:10b6:301:3a::41) 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:14 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) 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.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by SN1NAM04FT013.mail.protection.outlook.com (10.152.88.111) 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:13 +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 88.7A.38445.207D1395; Fri, 2 Jun 2017 14:22:11 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.9.6) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Fri, 2 Jun 2017 14:22:06 -0700 X-AuditID: 0ac94371-422569800000962d-9a-5931d702a756 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id A0.B4.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" , Hannes Reinecke , Johannes Thumshirn Subject: [PATCH v3 09/12] Make scsi_mq_prep_fn() call scsi_init_command() Date: Fri, 2 Jun 2017 14:22:00 -0700 Message-ID: <20170602212203.30401-10-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+NgFnrBLMWRmVeSWpSXmKPExsXCddJ5kS7zdcNIg6YrzBYL3uxls1i5+iiT xcZ+DovHXTNYLbqv72CzWH78H5MDm8e0SafYPHbfbGDz+Pj0FovH+i1XWTw2n672+LxJLoAt issmJTUnsyy1SN8ugStj7exnbAW/RSuefp3G1MA4X6iLkZNDQsBE4uG29YxdjFwcQgJLmSR6 +l6xQzhbGSW+Pt7LBlM19/12JojEZkaJ7o33mUESbAJGEt/ez2QBsUUECiUubesAG8UssIdR omVfCyNIQljAU6J18mOgbg4OFgEVie3L/UDCvAIOEg+v/4BaIC9xdstOsJmcQPFvHUuYQcqF BOwlpv7VAhkpIbCIVWLGkyPMEL2CEidnP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: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39450400003)(39860400002)(39410400002)(39400400002)(39850400002)(39840400002)(2980300002)(438002)(199003)(189002)(9170700003)(77096006)(54906002)(106466001)(53936002)(38730400002)(33646002)(4326008)(50466002)(48376002)(86362001)(5003940100001)(36756003)(8676002)(478600001)(8936002)(50986999)(189998001)(1076002)(72206003)(81166006)(356003)(5660300001)(76176999)(50226002)(2950100002)(6666003)(2906002)(305945005)(47776003); DIR:OUT; SFP:1102; SCL:1; SRVR:BN3PR0401MB1458; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM04FT013; 1:fYn5wEKqA17K22VXhdfKx+oIMZw2baKNqLThx0nTx69B5BdchPRQ8lWb6qdUplysbY6Y62fuxHN+yZegcWhwC7fl9pd1ECCun2VI6DgG2xX6t66Pqn9yMtDBOpD+bQHmNvjuB/1DGnw9GYwnS1QwtSJUsvTTRMH1trOSCktuybXHFgKxblhRREYa/XUpywWCavcclxgYO5gdfLGRSwg8JEkQVlqb2T1K6To2Lr4pGJU9RFv6A2f+HxbzD9to7y2pQeYmxIHva4OY/UfGPfmA78oAgQST+fCGjHNPZbW/AWgZ1V13lCe6GwKnt0C2ig2r4rUJZ98v7Zmry5UzF98tozDGtEsLEb5ePPRyHMmA+NqrCkK0VXiyanqTwQqGZUk6/9EYgVutP6BtfPCjyazFoKCrj6FJ+uQI9I3oGicA/HH073rFYMViwXNwTliZXr6fSFVo/PljTUxCBHAbINQvaNK9ktz3sCGcDq1/DSxcE1X1h1qxPKPveEJg42YFNX0RROvo0QjfCojPESICDWuUSLMP59cCCHsuabcSrZSTYd7lbaXuUlYR/xWWMvZ33HHz X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PR0401MB1458: X-MS-Office365-Filtering-Correlation-Id: 9da53ec2-612c-4506-2386-08d4a9fd7056 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:BN3PR0401MB1458; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0401MB1458; 3:HghPk7EboLTB+5jGMXx9FB3eBuAGfr2s3lw6bCVJAY4wFStYLuGzD0ihkNCy7puBpexWr7z38HlO0j65RroGjj6oBfKXtCntRRVoEVjV0CZ/EMUsAlrZHFp8jeTnq7deACs+h6GVulFy2Se+yO+UyU9zXRASIdTlHDHGzE/d0XwbwSLJCYVttYLELOL+SLAHSiTiUl65PqQsCNC7XgztnhJqZNLXgannHYtJA03JdSnRc7M7XAN3UY1/6pUElYIailVfeT6k7RxO4cSdBE3BuRuwS8ZYmeN62qjEXSgds8oZ9e1oLzmsorwERyQwQYGGpbYvUCeTPrncgreybyeG8buxERDVemhK2HBdAb6GGHdaxrx5MlTsEMGZu0kvFxlVhxBv16UBqw+XZg6eZuwmhsSNcfFendMNNGcX1B5zcX7Z9DIYR+gVws3OPxYNA4Mv+RtdM7B3KnTpLnWTtecPtV/16pGuIcYGdTmi2i1hCt569/DbgVZuWQja+E6ulsy1 X-Microsoft-Exchange-Diagnostics: 1; BN3PR0401MB1458; 25:zrDLXoWGGYycn+mG45dN1KurUaPuTw0xBku+gLwktXKNFZfwlRUu/rCxYoY+sEFLEyfyJCaL+QEIFzjdEikHMHQ4rmAdzfqf4l/Fmiviq2NIi1ML0U+R9iiBQB07TtN+dHbKYFoETCC06r5bG6DNA3FXx05qEe+da5Imj752kOLt+UDr7+dFHGm/+oFb0PyFTUZQ4rsxwGbZNM1NZ4ufKCmErnKuX6JhqlWLXSCEugj5tarTOx8LWhs3MWlRwJLzNNSkEyk9gNDqxvsLPudF1qOTYj2Cgl1HbacIYayxJejqXvoHaxfN5L81Q0Tj/7aU1uprNuVWWAN7L1+I5fmeszlt/DvfturKehw/DNfoYGqS00hcCOBoANsPsbBcuSpXZ1RllEhQTDqGs4WkjOJBxGZ++u8vfBotyMv5R2tZ3zx3t4NtRnJyqKHWe2RAe2W+P57WF/BcusbLqVmKDC7nX0xo+jrgc/GoIgwbw4DuB1o=; 31:UHRBeU4a9epkmnA3y1ais/X+H/RSvZm62VZfwXHMv2WVf1ykfYCKXjmHC1Q56Uqn3F92NdDePaU6bCLweCUBPntElAcOSN4RBRc1g/e25cfvlwPlBoqaarPHM9/uB16GEEltIk5WkFughBNcxTRR/BjAxdXN04SZp/IeflQTrLq626O7CAslqPRHBpaxEJ0RwJlNGKOVro8Mxu+HvWCn0hohkJvXeHhXc5dhB6JS73is040uD/U5fgC6tYzGAJ1pP8kKRPP2RNxQATDVk72eyQ== WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BN3PR0401MB1458; 20:XCSUeaoIoWuAbEMBOnXvGJzfoH47mfSL7khK7vEIdLpnPASc6x+e80d6jxFPSiKK2LjEIqjCNss9H2uBfs1lPeL3RSXzMfCHhOA0R04L6PAn3ltBjNWWUWgETQcehnrj7+rq/1eWK88RxXx4Na0RB06M0f215JGSGNzaYL+lPq7LeXAWSO0PQvgt927yBTZvSRbbRxiu4xTOpsb2wKCJ5SbegEZFCu7+opj8MLEnOtJRIIbdkeElTUQUvf3nRGgLq5nve3SsMwZBr6wMIGnSzsNo9FogkJETw4lxuoSxdEXQ/e3ZmidH13VYLZtSjJN96mUUKPIMMBCuPDRRJutUmpLf6M0Yam3ouD76ToDwd7zFSAIhffejcdG2g67s10oe4EecDm8q7czKDIodHTvzDODLP4BYkHSp6e0c6ByegkWD18NrZ1uUzJmPfiieg0ekTCWjKuESwmkCSMhqShs7TPURjJ4fyYPhAX2agUYhQguLGYM58xbaNT9ET6KepZrQ 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)(13016025)(5005006)(8121501046)(13018025)(93006095)(93004095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123558100)(20161123564025)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN3PR0401MB1458; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN3PR0401MB1458; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0401MB1458; 4:/QqYJ+KcSI5I0pT2uo5AbEF0iFFZPHfl+QStcYwt?= =?us-ascii?Q?EhdprkvvoLvqyLRKgHuO8D39+pOceTp8nvalKITR4qpt8xdhny4VQrRh5f6G?= =?us-ascii?Q?PKkKx6FQJZ53Wc3AcL6YfrysgDN23toV9MK3yi9DlZjCnl2XJuASurWIkUiW?= =?us-ascii?Q?32MUKJ1Wxw15J2dpLNe2exlNHcabW+BA7+wNE0A2cA7v+iFw+/VopMekX/9B?= =?us-ascii?Q?WOb624XQBe75xlez+gyevbp3fhxuP0brRBM+xifzGDQso67yCg4xUhK56h/W?= =?us-ascii?Q?7ysqjcvp1N5LfNTXulr4o7P9hHs0yTViAEz5yNFWHZrVjxw6R0BFwRMxexdq?= =?us-ascii?Q?9gS0qO2ztX3kOc7PuOKMTH6y+f0klvlYK1ARjuBi1BcBM6jvSo7ipW9rxGSz?= =?us-ascii?Q?McAPxwJJ5uzKsCPPPAx+I0nBcN0ZyninLp72JH/0ZvMkzz+goWkkzox6zE/e?= =?us-ascii?Q?Hlm0KbAQt0rzxsyeQIvPLMiOFuxFIwx6yzwS/nHXXWN1ewntY6HH3L4JkZUF?= =?us-ascii?Q?TVas/oXZ+TuB16pKMlekQq2om4mI5fsSGs8WRCrwetCLwCFG9XeknQNmGBY9?= =?us-ascii?Q?67GydqrSFG9zLrT+9qmjvT4SSXHhnuTV558k8hw0qSV7iF6T3snu0SGeLzu2?= =?us-ascii?Q?lQNlOWr5gfLaMlG/gCaJw0MDbCJ/0U9+w0WhAKzaavvxFLJ7CpRH8UAf+Oos?= =?us-ascii?Q?eKRIYRVkqpHIegTiwThqxlIKhDG0ehDUET5VeFJr0ZPBqBxBxxacKb4b1wyz?= =?us-ascii?Q?XpOg/qyg9da+YCWoGLtUBzJgXNk3Pl/33bm+8oDOKhOZloggIXgy76XEjGq2?= =?us-ascii?Q?esIeY3l2lEMXBzN+Rh0eeQW9rKtd5D+ImwD6Bu1QHwA86UT0lX+NuOLgPrwC?= =?us-ascii?Q?t7cYnPRp5JGnLtascebLmOmsUV+04yaJtAOdFfM3aIl6ta3iiqXzuQgxzbI3?= =?us-ascii?Q?TBUTqKdustofnJzqWziJP0BCJaIvxIEVdx3+4DT3iDtDcz7GMbqBWDnlz5tm?= =?us-ascii?Q?IMgGYBXlfJXlYHPpkcXGpyoRZDkIBW1OhaFbQRMtlzDi/O1tOjLmUYndDeOZ?= =?us-ascii?Q?Ob3M9k6yfj4A9XpvrCtMvHWVoZDOZF416Eirv4xevA16x3+DBkVLx7NyJoMZ?= =?us-ascii?Q?4m2RAPVHiJN+21aTTOT0PW1bELRdPBejE78TIfLNueaAM8rjr6jDysQuszot?= =?us-ascii?Q?BX7hfGAbY1kyehAnic4D1GInLY9iYLbq/grUY5dGVEI4jfHHMGLRwXc9FmXn?= =?us-ascii?Q?34+tsekmYAnkFd6pXlk=3D?= X-Forefront-PRVS: 03264AEA72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0401MB1458; 23:sTY75FRaW6eOCQNdTpL4XPSn0RmTK0ykkm9giQA?= =?us-ascii?Q?zWHv7OcvUbFWWmPGuAmcVfnvm9iQkvF5uUjBl5mILZCkvFkgoK647Z5F29V7?= =?us-ascii?Q?RfPp5Ird2+UoofsiHeRdiXH19QbLWVVZj96F4cFm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J5jCzuJrG8Ysbrw6LJUFFYFrPABnuA1J27UnbBjgn+++USZLqWqvFfjj?= =?us-ascii?Q?R6KmFOdU=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0401MB1458; 6:0aZ0m9a9QgwCPcK1SK8pYv2gggMO8ZIZJYnS+tAYlKJGdiHaiz6S6q98UzByjCftVaOjkkIfRruldDkQqabe+hyEbDzCkRbEJFGANxatwG4+Nm/p1vGL64kLaLc/lYe6LcJZhgcNt9lvfXO+ey5CgpJjADYPhGVXU0Lt5ewj15z6L2s2W1PT1Y2JFMWDDPZZT6IyKjV7IQGsAcf13griMTJnYlywgvzRwiQBZVPwopcflqmjs9DKXhf2gFfuml/qa3RNNxvVakXpFUKqf0KS9hbfJD5bVci5gNvr4pLFJN1U+YlkMBavRSRHdsZ4apnazVkzahydm43Ga+PIEkZ8df0+XP5hWDjM5Vgn0UFovFQdU6AqXaENi6odXZr3Q+GZJi+RoERmqdMm2gOXR0gewo8kt+taI6WwK/39ohdSN77pVxQ18PjYmBcKYNNpEaozfWH23aFozz5ztUJ76rVTwGg55wpFDgTGIFNEFWuJXutT3dqymftneHcz7o9rVpbbX069WDvL9zwDFN7SPM/soqV2dBo1m5Q+s459PELch7A= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0401MB1458; 5:I+hS4nC+woaBLRxSvDjIbwGtSJt9mVqdCZTIGiRX7CWT9f1jXGJ2a8KZtiScZVh8muEDVPlYPj1VlYKZgqzdEF6FFkHui+WjNzA61j/7PcN6mjpx0n78ZodHCyp6ohxVdMOtYz4redB0CAU8c8l++FKcHS47Mu001Ys4nquGR2FrwqZEmN3p/BiP6OvGZ1ZX5zyVCsjOdgkq9fgW0zAnVRPlacIfTz/jn423qnkMcY3E+473tXXamRkhs4eE9VgmH6ElKN8yEVPj9wz+0RSTByH6MO3uPcd2mBak7Pd1lBqCZhjQC8c9sWa1RzH6FsbpE7Tof7Y/SDsaiwld8rpLNikZO+OQOWDAC84TexkE7URKYsUPMMamu+68WlhpkQ+Cp6gImCElqgnrK0mNmGA0W+M41nJlPmcjPhy9O2dAGGcCFiPu4ca2wTPdpEX8sfRzuN+Rf1o4WVve+gtruEilqaidgceQ16GbUKL2LaslVnpLfIUP789cp3V3ecJCRo/a; 24:zkGiH75zoAUF4YJQD4rzvi9AGwRVKtImEWyEhNmtE6L29JJJHzNdGtxh9kGYvr684flC5EwiOg0jN+Cjz8zWVZtm/j6r712PnjlkHa2LkpU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0401MB1458; 7:T/6Hyknz2MVuCC1TF68G1QldXk1bCIJf36p8rpvjhAuYKVyCVa2JI7RZ3wMIlpKaNYDr5gHi1EkO81MIrzRAF4bFT7FtabGmTH+1D/h6UsOsZuyxpcrgdqadK6EMlVGopjrxOSK9/oV741ADLNxKRp5KoSerOw2oN3PIvnT7iqE7i+0wYwIrG5h58DNAqXH28VHm+yDdAw5SljWv752bsDpAmNjiek/xG1qGiIhRMaBjcYmN3MEl+0YEdxPnvY/AMcfBD0itol9tcLsS3SNeaDfKzM9gi+hTY/K2YegtqLbxJwXOAifLy9FNAexiMkzWH21nxwv22/k0H0UlBAwU+A==; 20:DnVJjEmEXWRJts5GYyglMXZOcT9gGb4sSzHoEXgSi4/R1EI8bzs8K7xeG4FLPg43lUBvLcBnooPDKLywRzcBbtBbpV//1GjgTwtBtujTwOFqgEvkvFKJEA97uvkkxOkBoFJIla2OTSxZw8j4Gd60dkFehK0fvgHHvFHN4sX0Vjk= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2017 21:22:13.3220 (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.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0401MB1458 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 This patch reduces code duplication. There are two functional changes in this patch: - It causes scsi_mq_prep_fn() to clear driver-private command data, just like the already upstream commit 1bad6c4a57ef ("scsi: zero per-cmd private driver data for each MQ I/O"). - The initialization of .prot_sdb is moved from scsi_mq_prep_fn() into scsi_init_request(). Signed-off-by: Bart Van Assche Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Johannes Thumshirn Reviewed-by: Christoph Hellwig --- drivers/scsi/scsi_lib.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 6b4fb48033fb..ef4e33319407 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1870,36 +1870,21 @@ static int scsi_mq_prep_fn(struct request *req) struct scsi_cmnd *cmd = blk_mq_rq_to_pdu(req); struct scsi_device *sdev = req->q->queuedata; struct Scsi_Host *shost = sdev->host; - unsigned char *sense_buf = cmd->sense_buffer; - unsigned int unchecked_isa_dma = cmd->flags & SCMD_UNCHECKED_ISA_DMA; struct scatterlist *sg; - /* zero out the cmd, except for the embedded scsi_request */ - memset((char *)cmd + sizeof(cmd->req), 0, - sizeof(*cmd) - sizeof(cmd->req)); + scsi_init_command(sdev, cmd); req->special = cmd; cmd->request = req; - cmd->device = sdev; - cmd->sense_buffer = sense_buf; - cmd->flags = unchecked_isa_dma; cmd->tag = req->tag; - cmd->prot_op = SCSI_PROT_NORMAL; - INIT_LIST_HEAD(&cmd->list); - INIT_DELAYED_WORK(&cmd->abort_work, scmd_eh_abort_handler); - cmd->jiffies_at_alloc = jiffies; - - scsi_add_cmd_to_list(cmd); - sg = (void *)cmd + sizeof(struct scsi_cmnd) + shost->hostt->cmd_size; cmd->sdb.table.sgl = sg; if (scsi_host_get_prot(shost)) { - cmd->prot_sdb = (void *)sg + scsi_mq_sgl_size(shost); memset(cmd->prot_sdb, 0, sizeof(struct scsi_data_buffer)); cmd->prot_sdb->table.sgl = @@ -2025,6 +2010,7 @@ static int scsi_init_request(struct blk_mq_tag_set *set, struct request *rq, struct Scsi_Host *shost = set->driver_data; const bool unchecked_isa_dma = shost->unchecked_isa_dma; struct scsi_cmnd *cmd = blk_mq_rq_to_pdu(rq); + struct scatterlist *sg; if (unchecked_isa_dma) cmd->flags |= SCMD_UNCHECKED_ISA_DMA; @@ -2033,6 +2019,13 @@ static int scsi_init_request(struct blk_mq_tag_set *set, struct request *rq, if (!cmd->sense_buffer) return -ENOMEM; cmd->req.sense = cmd->sense_buffer; + + if (scsi_host_get_prot(shost)) { + sg = (void *)cmd + sizeof(struct scsi_cmnd) + + shost->hostt->cmd_size; + cmd->prot_sdb = (void *)sg + scsi_mq_sgl_size(shost); + } + return 0; }