From patchwork Fri Jun 2 21:21:53 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: 9763473 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 A736A60360 for ; Fri, 2 Jun 2017 21:22:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A094285D9 for ; Fri, 2 Jun 2017 21:22:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8EC2B285DB; Fri, 2 Jun 2017 21:22:22 +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 9EAE5285D9 for ; Fri, 2 Jun 2017 21:22:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751189AbdFBVWV (ORCPT ); Fri, 2 Jun 2017 17:22:21 -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 S1751153AbdFBVWQ (ORCPT ); Fri, 2 Jun 2017 17:22:16 -0400 X-IronPort-AV: E=Sophos;i="5.39,286,1493654400"; d="scan'208";a="125046174" Received: from mail-co1nam03lp0023.outbound.protection.outlook.com (HELO NAM03-CO1-obe.outbound.protection.outlook.com) ([216.32.181.23]) by ob1.hgst.iphmx.com with ESMTP; 03 Jun 2017 05:22:13 +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=RBFb4+7jU/ZiHuWdbNdbMc3QXmghceGsRJPOIdMRJbw=; b=I5fXOGuxQwLMxHiuMSMZnGJXdDQJiAQfRnGhrf7M5QR2aZLRzVFux/HclVpkVInCYhMAjojhXVk53BPXtJy0rXprQTowuFKQJ6CDVP1nATWkw2bmTnCbMUynLTxYhqCYSrdKKZUuN97ylmZiF9etusmue3XC3gW6UyUu+is60OA= Received: from CO2PR04CA0105.namprd04.prod.outlook.com (10.165.94.159) by DM5PR04MB0412.namprd04.prod.outlook.com (10.173.169.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Fri, 2 Jun 2017 21:22:12 +0000 Received: from SN1NAM04FT058.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4c::201) by CO2PR04CA0105.outlook.office365.com (2603:10b6:104:6::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9 via Frontend Transport; Fri, 2 Jun 2017 21:22:12 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; lst.de; dkim=none (message not signed) header.d=none;lst.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 SN1NAM04FT058.mail.protection.outlook.com (10.152.89.64) 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:10 +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 F1.D5.51736.FF6D1395; Fri, 2 Jun 2017 14:22:10 -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:05 -0700 X-AuditID: 0ac94369-36bff7000000ca18-5b-5931d6fe4962 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 1D.A4.18148.DF6D1395; Fri, 2 Jun 2017 14:22:05 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , James Bottomley CC: , Christoph Hellwig , "Bart Van Assche" , Sreekanth Reddy Subject: [PATCH v3 02/12] Split scsi_internal_device_block() Date: Fri, 2 Jun 2017 14:21:53 -0700 Message-ID: <20170602212203.30401-3-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+NgFrrLLMWRmVeSWpSXmKPExsXCddJ5kS7TdcNIg67VchYrVx9lstjYz2HR fX0Hm8Xy4/+YLGZ+fcruwOox6/5ZNo9pk06xeey+2cDm8fHpLRaPz5vkAlijuGxSUnMyy1KL 9O0SuDK6/r9iKphsVPH/52/mBsaDml2MnBwSAiYS53c+Zeli5OIQEljKJPHr+AJ2CGc7o8SM v79YYKpmbbvNDmILCWxmlJj5TRnEZhMwkvj2fiZYjYhAocSlbR2MIM3MAosYJU7uWMrUxcjB ISxgI/HtjglIDYuAisSnrddYQMK8AvYSbx4UQ4yXlzi7ZScziM0p4CDxrWMJM0iJEFDJ1L9a IBMlBGaxSvzdsA6shldAUOLkzCdga5kFJCQOvnjBDHGausTJJfOZJjAKzUJSNgtJ2QJGplWM YrmZOcW56akFhqZ6xYl5KZnF2XrJ+bmbGCGBnrmD8e4T70OMAhyMSjy8GWWGkUKsiWXFlbmH GCU4mJVEeHfPAgrxpiRWVqUW5ccXleakFh9ilOZgURLnPSczNUJIID2xJDU7NbUgtQgmy8TB KdXAqFgoE8lzwfpK91F95zlvayYt60n6vUbhypV7uw83RhfyHri7422WD8ON319lAsq2d71R PV75arf+J76AfX4JVdtWrI1gUVzjV3dK79BzBi6N3q9bbp44OE9/Z2J73uIMl/x1x4ur7ocv L8qa9USwmLEzYS2HusiVzLzr+6Y/kzN1FYiYkW+ap8RSnJFoqMVcVJwIAHLEJRBwAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrHJMWRmVeSWpSXmKPExsXCtZEjRffvNcNIg2lX9S0O/mxjtFi5+iiT xcZ+Dovu6zvYLJYf/8dkMfPrU3YHNo9Z98+yeUybdIrNY/fNBjaPj09vsXhMW3OeyePzJrkA tigum5TUnMyy1CJ9uwSujK7/r5gKJhtV/P/5m7mB8aBmFyMnh4SAicSsbbfZuxi5OIQENjJK nJ54gw0kwSZgJPHt/UwWEFtEoFDi/unTbCBFzAKLGCUafvcAORwcwgI2Et/umIDUsAioSuw8 uosdxOYVsJdYtmk9E8QCeYmzW3Yyg9icAg4S3zqWMIO0CgHVTP2rNYGRewEjwypGsdzMnOLc 9MwCQyO94sS8lMzibL3k/NxNjOAQ4YzawXh9ovkhRiYOTqkGRlXGc8866himeR1dvkhtPv9c Xub3tvsdksJmslZujVD5J3FoxrcbMqbMNQ4TzPSvSZpfFp5b6LtY74qj+aeFE8y2JHecOnBr 1wy2e301m67NXSVYUD1Nav6mia9yRKrfXb932uRo+jKj6TX/6gu4THcU6cza+92zOIzxtdjX gy1Hm05Hce1ziFRiKc5INNRiLipOBAAfP44uwQEAAA== 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)(39850400002)(39400400002)(39410400002)(39450400003)(39840400002)(39860400002)(2980300002)(438002)(189002)(199003)(9170700003)(4326008)(77096006)(72206003)(47776003)(189998001)(478600001)(50986999)(356003)(50226002)(8676002)(81166006)(2950100002)(6666003)(33646002)(2906002)(8936002)(36756003)(106466001)(1076002)(76176999)(38730400002)(86362001)(305945005)(54906002)(53936002)(5660300001)(48376002)(5003940100001)(50466002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR04MB0412; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM04FT058; 1:oSeKgiRYrBmeqVVYkYKWpM68TJr5b6/IXzv6YgVpN5NmZp5COB0DxRwRMdljoL640NhOdjJylyusZZTjbC4brfM+lz8VPsfMq1cB+NUcMvBC2Ccgq3TZ9Q3QsCy8hn/icYswDoTXf1MaszJgCNyXw4pVFD76FDHi99tbtOCQdCQRUPtbjMXnZiz70J6kWd+iD0KJvFjnqsU2B+mTqy1bJCrqSWWOKfucXBZ4wEu7g2abmshZbbduKzru9J4tJcCA/n1xtVgEN6qg/tUv79cm5DsBNIu68UeX0aCJCWPHJqfoqw7yaVUvI6zFmXAtBNtOuQMgmVRIDbabmSTglc1yIALQV3HPtO4tlCWLUUyOPXGsGq/Q5RzIe4wjffQ/tpV2/KfKc91DkSqAjeAg90hiOIQT8zQ/y1VV6yQm0YFMRzBBFU7PbY96gJvOP/cfiow8SBGSckGdeiqSm47NuOjIKta/7XlsYLkGMX+Js46IQoPLCZTtpmobMPx4LVKRHS7CrsbvIXD5FvltsTR8Ppc67me0JmM/zvN6oEd38GifCcdI07DwP6BWY+PmA8LH4ia+ X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR04MB0412: X-MS-Office365-Filtering-Correlation-Id: d04b4b70-623c-43df-82e8-08d4a9fd6ea2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:DM5PR04MB0412; X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0412; 3:xqnIBc3tsx3hvQQGGlDdafhA5/EfvBoDB5OGTXh+sF/hFmikiPNfOGNCHhMptQ5BaJZ2tFNR0jtwtj2ja264F26F7PpcOxiqkewcSnbdNf843hULRbuj+9bdGZCrBa+LcSqtgTheGlEvZoyuBE3LQYTI7p1qdgJToWuyII2iv2w4P64nV0r2MYhMyl3wvfF4sDpGzJgG58KSwCPLkg3IxizJyUPyk2z5uDGmBO/5HDLd/kTMoNCVlNAgQOqZRauDRn486OYzO8jNIMQaCeAgqgj+gZXWzsYCBBu7+tEKffFoIy3HIRcl44GxIj21oC56pQub7C9l/PDh15BwyS5TteUz9LyScNTJ0fOjgl041cGwyH2V+rDiIrZc7PML2M7fOUu6Ne6pzu0zDvqiR/qzCemiPGgx0+73qAg9dfmS9EH3ckxGPezLwyNypZA4LJ8NozjQjlFzIfybLtlwZOnm78nWV253fscwBoNMweRurcvMukOpe6hdghozk8Z5iZ3h X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0412; 25:HjmFHfRnw40dgNMUr0/e01hEq681m1Jo0/TO0FvvTGpDyT8XljkY/+LwT1UAmvfd9iF9kYQIikEQbm3uzlZuPMXNrT1tikosa/wI8y4jyiswPmSJOc6JSHmE87rTJuRSwi6DXU3NrlQ+Xr3D8aGkjzWPa9xBf3K7U+NmaAyM84L9umVYiWLEboMljNVhrwLVjlqfJQZRiPSJfskUa+/LIhc4QPeZ/QDdPw/kza4GIaySw1LnaTIfpXqh5XnaJO4UggOxZdiYeP0K1C7vvCEuYeP1KXJ3ZPMpk4b8VJnNKX2MGjK7kC/T4fsN37PnUw0v0t7ZqYW/VfdAuuh40Vv38S+su3qw1rmp4yYMmUwOYTsaRr465RJ7pjLqeLD5hoSNd0U5C3H+ePH9q3q3BSHlhK4LKyKA1LKSjgtYmhhtSLZVNNgMN5pb18+t2xexNpRlfVuNNS2Q3LsABj9TkzhZI/1hmLaTKonFuz1VeQdcms0=; 31:qownGRXEys6mjdZccV/uzbLntVm4jr2uDTErCHmdCGBtGav6daOWqFpdmw/MUe1i9u8vTHElFH6cfJ7ksuaD+0ug2xht+MDK5o2tna2/YLJ2G7Quy82i39/pR1BMOdEQwsU42/Cl/APOBDktVl12dyI2AGhRDcKpN7j1eAZP6+S5SbkTYaDFOypvhDuak+b5DEx3Z65iq0d4k2nQLoivY3XvaR6j9AQyVcUIi0NmYkFAdbXcR1RitJ91/R0kjxhq WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0412; 20:FkW4BWXNr/52EqCmoX9S3iiFzQ+YdQHqE+5yJNgeV8kHTWPhDIXNEp8p92jsT78bDA2Ki1CQvdnTlw0fR61XmI+fCRyIizTwHzTH13hv3FmmQPzWOM08dq3kToSrtfAPjVyOCBG61WwjHg2ABJpOTFqtp4oYH3jfmk//KKJRHA0zolRE8Z0Vt0qWGX4PgGchZAGKXyPsEhO7M5Lzm6UIW1sRgPSyQckHusxAZkCtxwemnRI4euLfwYoZGJ4PbI0+BluH/saIsAiLn1nZlIWKrJOs1jBTLhCTzSPVyktmkOef3bnebRsaNd+WihKauTwlmOUch+8pw09eGyPak7AYQk11K+fA1XPt5Hpu3Odm1NC2898s1t0w8s/uFbNbK+gvaIVXCCez6E5VzwtgLBYw3AeYLZagGFTBUbSWBuxMTS7XzcQmbraMXfl5vZ81Yx1/v4mxZpXxQqT3yfUSsPmMusrZo1Ssrmi/w49xsWtRJ24ah77qv2F090Ket8+YfSEs 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)(3002001)(10201501046)(93006095)(93004095)(100000703101)(100105400095)(6055026)(6041248)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR04MB0412; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR04MB0412; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR04MB0412; 4:sfOxB1rDmmTL5kk49L++DbonSleYUDTX5ZmEQeGToI?= =?us-ascii?Q?cXojh1WfQt4NOdOQaiWe+DXUVehJstxdhebpDgT8nRo6yrdVLqYKV9gb2Tw4?= =?us-ascii?Q?BSBgC6E1KRjVQIMAN2KhrSuqRMJ/njRS73DL5nDZEAFMyaUxR05FitkMVprV?= =?us-ascii?Q?+x69O8Ihoyutha24EpxnP/+RdoXt2owMRG4+SsbcETyQFL7glNxjno52OZ0q?= =?us-ascii?Q?yX32aq7rpvc8dyjCnaOpN440ODR7O+zEkQ88BR0MFN124b5FVL8QiDPkJYWK?= =?us-ascii?Q?NgWAa/hh6LbYYBgUvYIeTLOo/sLpuDhwZsSdYxTXPs0w4KuJgMMJmmQLgU43?= =?us-ascii?Q?pGs5C19oDLA+j5DqUZSRmo9J/RS6sm1aWtjreJ7qwyXfANPyqgmLYmCny+MU?= =?us-ascii?Q?CA8Ff6n2gSFKcTFdgR4DNCws/UUbfZNbZjSgbZN9CMDWF6YH/Nze060dpiEJ?= =?us-ascii?Q?Xa3Sr9wuI77ZtOyVlq3adSQElL9OrhpaQQs4BIEEGGTWGPwZ8Kss2vQH6fGP?= =?us-ascii?Q?OU0dswOx8uR0hIuseigNG4Gj1mgEp6MyrBel9beGIQVpijH8m4+6xBJ2C7ur?= =?us-ascii?Q?wlklvV3DQRi4B5T4/R01cCiQB1uLOie9/A8MZeAxpPc0LQnJiQdDSZ+jPLsC?= =?us-ascii?Q?aW5NaJRbR+N5mI2gDgUbVyE3+nIZIG8lRiaZneo/Qj557uQnBUDupxCfZDun?= =?us-ascii?Q?l8FpMTsTvkjc8XRkI2gOr/VgchPFId3rnlEakFUAKyn6WgzwvVdU+ioaYrvw?= =?us-ascii?Q?6YkrixwocaYYvbug/2+jQcE1UpocQSL2uhsyJSfGWd80panhoDhIrjnU7ekU?= =?us-ascii?Q?NMGbAorIEfngp/aKvA1QjjMOpCBskqZDexsZ5NHFWBoWZVmzb4u44NMy81KJ?= =?us-ascii?Q?DlOhrSvWOTvga2k2vzjIhLZsu1S/7V33vckA+jiBJO1rJomFHJXjdWoK42gE?= =?us-ascii?Q?abXZKYbn/YtPqfjB0rbsH83pHb2OuCpBNY6KV832+0GwYkdHLT9Lm6RJiO9A?= =?us-ascii?Q?96I0aX2GV2pFuXCcgP5GCsvddcF+4SYy8j5ZJOWVj6SD2Pq19UsZPzwE+ruO?= =?us-ascii?Q?hwBO6rCrJM+5l3/n0EuKW5GndzwSOJcf9Z9YH/Y27qSK/SGgz028mrfGHzbL?= =?us-ascii?Q?HeBDNTvd9oQTDA2qPsJvNpnnWMvaZw519W1AoHv7zpMC2wKt5eISy1GW7I+o?= =?us-ascii?Q?3nhryZmAtFD0x4/I1Tuy+Rx12SvmMzDxUumv9guN9eQxcqGxyWB7Uvgu8jBy?= =?us-ascii?Q?J1J0v5s+6aLtAReao=3D?= X-Forefront-PRVS: 03264AEA72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR04MB0412; 23:ivn3WeqIZEh6/QbFvAoMOkF1zybUid0Q30ma5B54Z?= =?us-ascii?Q?xT3yJYsJxsd4oVXN+8vpvolDrd23lTVmCIy1wUbFzJpY4TmSvjVFJWIuC97c?= =?us-ascii?Q?pSvDh86eFdj5jyjbzP8I0MwTlULIYzkrnlQV4ZFArR8qF/KgyxdvUImAZweA?= =?us-ascii?Q?XoCHJ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8nxrr0U0xCw+fMMagzIQJka27A0DpO0u52uqBcmEcWuryKEnYBMbgJcjMVR9ga63LtP4oqOYn9YufAVz5mzHEsF5VFSYnSvwngEr; 24:6VjTtz/DUNVX4tUoedXDBr3Hz2yTJLBm/SURcVby9NINoPYBYm/Qm0fCbpWXL6eB12+GlojojGQmebrS055hRon/qb6F8mdWY1KzCZDTgns= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0412; 7:Atixx7fI4Np9evFu+VXiVLCuOyJYgPalQGnL2n+/q4CW4PJ6WK83ibkb+MmieyMKbhEywHEs3qG+wHq1XxdUK0N4iHd6mLekJIHOCoYzfW6gEjKN1uqrHm8POwcffIHOFGkCYjpeW09FWRFgdraeuxyrCFsFoeZnPl9tRysiZKWPYw2SDq9QRzbefy3Xi3iquPAYgXfoGx43fX9vOCwdLvedU1ALVjwbaWRLAwX/KZTrLCSx3ujgZhgK2RHEbSKK1HjOHk0P0ML5OJ6PPgP+PBDzafcdpTlvXYcnh1E7IVIK1++5u7oqoT0RZ7bY5pRTmDCK3Jjcc6kBv2f2+UycMQ==; 20:t/iyWu5Ez1/2fQyROZ03je6y1+w9lwIUOeuCn+0bZx5FXfJL0fkjfUlFqtiiazHHRAJ2t08WMJvw56gt5j5FUegwCIAXra17wfJB03qmir5dTGVkWFBjqlt9HiR5YGKhygnwowTxpejhvW0hDd+X4Lezuc6gM7WPSQoAvRvG74s= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2017 21:22:10.5765 (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: DM5PR04MB0412 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 Instead of passing a "wait" argument to scsi_internal_device_block(), split this function into a function that waits and a function that doesn't wait. This will make it easier to serialize SCSI device state changes through a mutex. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Cc: Sreekanth Reddy --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 +- drivers/scsi/scsi_lib.c | 73 +++++++++++++++++++++++------------- include/scsi/scsi_device.h | 2 +- 3 files changed, 50 insertions(+), 29 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index a5d872664257..c63bc5ccce37 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -2859,7 +2859,7 @@ _scsih_internal_device_block(struct scsi_device *sdev, sas_device_priv_data->sas_target->handle); sas_device_priv_data->block = 1; - r = scsi_internal_device_block(sdev, false); + r = scsi_internal_device_block_nowait(sdev); if (r == -EINVAL) sdev_printk(KERN_WARNING, sdev, "device_block failed with return(%d) for handle(0x%04x)\n", @@ -2895,7 +2895,7 @@ _scsih_internal_device_unblock(struct scsi_device *sdev, "performing a block followed by an unblock\n", r, sas_device_priv_data->sas_target->handle); sas_device_priv_data->block = 1; - r = scsi_internal_device_block(sdev, false); + r = scsi_internal_device_block_nowait(sdev); if (r) sdev_printk(KERN_WARNING, sdev, "retried device_block " "failed with return(%d) for handle(0x%04x)\n", diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index cc9f792cd12b..c9ce36d16df0 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -2943,28 +2943,20 @@ scsi_target_resume(struct scsi_target *starget) EXPORT_SYMBOL(scsi_target_resume); /** - * scsi_internal_device_block - internal function to put a device temporarily into the SDEV_BLOCK state - * @sdev: device to block - * @wait: Whether or not to wait until ongoing .queuecommand() / - * .queue_rq() calls have finished. + * scsi_internal_device_block_nowait - try to transition to the SDEV_BLOCK state + * @sdev: device to block * - * Block request made by scsi lld's to temporarily stop all - * scsi commands on the specified device. May sleep. + * Pause SCSI command processing on the specified device. Does not sleep. * - * Returns zero if successful or error if not + * Returns zero if successful or a negative error code upon failure. * - * Notes: - * This routine transitions the device to the SDEV_BLOCK state - * (which must be a legal transition). When the device is in this - * state, all commands are deferred until the scsi lld reenables - * the device with scsi_device_unblock or device_block_tmo fires. - * - * To do: avoid that scsi_send_eh_cmnd() calls queuecommand() after - * scsi_internal_device_block() has blocked a SCSI device and also - * remove the rport mutex lock and unlock calls from srp_queuecommand(). + * Notes: + * This routine transitions the device to the SDEV_BLOCK state (which must be + * a legal transition). When the device is in this state, command processing + * is paused until the device leaves the SDEV_BLOCK state. See also + * scsi_internal_device_unblock_nowait(). */ -int -scsi_internal_device_block(struct scsi_device *sdev, bool wait) +int scsi_internal_device_block_nowait(struct scsi_device *sdev) { struct request_queue *q = sdev->request_queue; unsigned long flags; @@ -2984,21 +2976,50 @@ scsi_internal_device_block(struct scsi_device *sdev, bool wait) * request queue. */ if (q->mq_ops) { - if (wait) - blk_mq_quiesce_queue(q); - else - blk_mq_stop_hw_queues(q); + blk_mq_stop_hw_queues(q); } else { spin_lock_irqsave(q->queue_lock, flags); blk_stop_queue(q); spin_unlock_irqrestore(q->queue_lock, flags); - if (wait) - scsi_wait_for_queuecommand(sdev); } return 0; } -EXPORT_SYMBOL_GPL(scsi_internal_device_block); +EXPORT_SYMBOL_GPL(scsi_internal_device_block_nowait); + +/** + * scsi_internal_device_block - try to transition to the SDEV_BLOCK state + * @sdev: device to block + * + * Pause SCSI command processing on the specified device and wait until all + * ongoing scsi_request_fn() / scsi_queue_rq() calls have finished. May sleep. + * + * Returns zero if successful or a negative error code upon failure. + * + * Note: + * This routine transitions the device to the SDEV_BLOCK state (which must be + * a legal transition). When the device is in this state, command processing + * is paused until the device leaves the SDEV_BLOCK state. See also + * scsi_internal_device_unblock(). + * + * To do: avoid that scsi_send_eh_cmnd() calls queuecommand() after + * scsi_internal_device_block() has blocked a SCSI device and also + * remove the rport mutex lock and unlock calls from srp_queuecommand(). + */ +static int scsi_internal_device_block(struct scsi_device *sdev) +{ + struct request_queue *q = sdev->request_queue; + int err; + + err = scsi_internal_device_block_nowait(sdev); + if (err == 0) { + if (q->mq_ops) + blk_mq_quiesce_queue(q); + else + scsi_wait_for_queuecommand(sdev); + } + return err; +} /** * scsi_internal_device_unblock - resume a device after a block request @@ -3055,7 +3076,7 @@ EXPORT_SYMBOL_GPL(scsi_internal_device_unblock); static void device_block(struct scsi_device *sdev, void *data) { - scsi_internal_device_block(sdev, true); + scsi_internal_device_block(sdev); } static int diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 05641aebd181..6ce6888f3c69 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -472,7 +472,7 @@ static inline int scsi_device_created(struct scsi_device *sdev) sdev->sdev_state == SDEV_CREATED_BLOCK; } -int scsi_internal_device_block(struct scsi_device *sdev, bool wait); +int scsi_internal_device_block_nowait(struct scsi_device *sdev); int scsi_internal_device_unblock(struct scsi_device *sdev, enum scsi_device_state new_state);