From patchwork Thu Sep 29 02:53:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612194 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D17D9C32771 for ; Thu, 29 Sep 2022 02:56:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234284AbiI2C4j (ORCPT ); Wed, 28 Sep 2022 22:56:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233665AbiI2C4c (ORCPT ); Wed, 28 Sep 2022 22:56:32 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD1A46339 for ; Wed, 28 Sep 2022 19:56:31 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28T1TN0f011051; Thu, 29 Sep 2022 02:54:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=ZA1DWgd0PzD3Epr978f06v/7fC8LzDKvh51xDRQpsnE=; b=iONOHmHx3vd6Awmesr3SPIm4vqBQhnwuQ72YHbCODK+5edljcUFeLOgI8vCMBrzX4ESL Hu/0C50plXZ4RgzFoP5WR1bHl3ybikiVIbN3A5ierh2mD6CI9SJGO5eezhwaoVs12DXk n5zCZl1mIF7WNe1W0nmQqqE9z/K1rjlH3G+TNeMz7D33BhxiCwQQHPG3Je6k/SGfgWJE 6MWgCKEbONqnmF+TgwUTEIknX8nc8hZHMEceuC0Uga3+/ufzCn7XhTrGO6f04FnOOOh7 lJ7+KlfJhfJKkcCI/H2JpMpy6HAXvrQzYDYxBYlMQtqN+txXDd0o+k5rRIwZjs33fuvA xA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jst0ku9m4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:17 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28T1Ylew039394; Thu, 29 Sep 2022 02:54:16 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2170.outbound.protection.outlook.com [104.47.56.170]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtpq9jc24-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ngdyN97nqtmQ+VvjRTEaIUWNZMGmvBBma3K4UsibNJ/vSoMUkir+1wc0R+qYkZox1fh/mmIAgvhIm4TVfxvAXUpj5YkdE2i4fBMF+CxK9bYONX2Ow7scgUiytNjYqOFNWBEm84VHG/d2D4b9uczPhmJshx7Lsy8VFwlkgXO/fIAdu789HJZESXm9LakmFaGz9jmOIC93nGa3ivwFWRxpw47faauKAL3cuH2mwV/UKUqloPFuyRMCZ+ZH4szNEFeK1ORBTWIe/y3vTsDHDMlHbSqyCyroCVZyBn34dzRfhwHS0XH9GU1c2QueRsryrrkUCxg1cOa/aHNgNqfKi1UYsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZA1DWgd0PzD3Epr978f06v/7fC8LzDKvh51xDRQpsnE=; b=KMNNfkcrCMRF3KOEwv8rm6n2hKb8RZ8IXAAxXClBPyIWYtN0F8cKg4JCCctAQmJ0crs9yG59F67/1xCqjXCajVSuv2GR2vb22XPoSoCT/F9FXKvIx06dDhiWT0sCy9R7rWmAEBIB66x3bO6loDQa1V+BFiLTl0CSzTrPq9WxeYpxKhgEixwWD8rLg8N1IyGDqnRCwquBHTey9DmXxQhXHuoFdlwIQX/wumKGj60LLWE+yjNniSrj6snRUrMx6t/J3OCQWzzo57N+lqQpq71wi7xevmj9Pnu7Q6SLXZkRZg8D7xUYNrIhOOzeyWAfsKhfETBb6QRdPvQnROAxJbUXvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZA1DWgd0PzD3Epr978f06v/7fC8LzDKvh51xDRQpsnE=; b=eF5eRK+klpFg1TKRjaBpFjf725VMrt0sSSa3sIVA9r/NL/tvx3/EN0m9u97jbaFaKynHpNEVe7zCovM44IHeCSplAla0nJ+uhloQ3JMpmbCVyNdTaiGQa2sfs08bDdxFBLsIEek4IyulTrKzxyIH8XdXJUx4tqAtJEG7LOTUtT8= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SN4PR10MB5653.namprd10.prod.outlook.com (2603:10b6:806:20c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.19; Thu, 29 Sep 2022 02:54:14 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:14 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 01/35] scsi: Add helper to prep sense during error handling Date: Wed, 28 Sep 2022 21:53:33 -0500 Message-Id: <20220929025407.119804-2-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR07CA0050.namprd07.prod.outlook.com (2603:10b6:610:5b::24) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SN4PR10MB5653:EE_ X-MS-Office365-Filtering-Correlation-Id: b43bbed7-fa4b-4672-0db4-08daa1c5e438 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: faaw3snCRdVmIa1bxgpAaODiC9YVxgbJpCUEVKYyUzkokxuzlT6x4JUZYWjEHlKVOEVBsKF5ccY8wKTTGut46g2JtFqbY6t3wxbh6J/j4Uf6n+EX0JiSRm/oAFQOMoqLIGYg6oz64dUABH1fAhF9dJRJOivMsXPP3MYEO0M1CWX+o0RxYGsL4rbp8KfpYO1MYD8bgtp3sty8x0Z22XExUXrHnf6QAqRfvN/nkxhH0LUOuA5XZRXMrs3AYWVN/T/Sq3tzO72Huqm0n3JJ70jagdk4B/4IBRNILuy2zbmSOX4EpU8ypw+f4dLocAgiHaSPOe6XbhM56SBaB7NK2mM5nqq+80QSdz7wMbuDRo0Wy89upa3/2YyX1/ByeeboqRUecFKqzYlB4ThkIQftU/Bty5/a9XLivdNw+BJJEddwMw9IB8ir/Wsem19XfwHl5RPd/ykdjIuMNpEXMLMQgZ4UUvc0tZBRqZnUUzINMors/smt7NZHbBGZfrq32+y2eACBgguua5LEoAr6gQQjCz9uQPVwVFT2UUVyZDAYPUo8BoRAG1bKLKnFliYPQ0klU+zqgg+cqdvfzEf8jo8qec/JUWs49bcbar6QXotibUrXtFutZa7ehSiudrf2pglUbasVDzOgvIHf6QnzTcpyO60iELJDKO9aow7NeN3L0lWMhX/qfzlDABYQSkFoTZoWvzuf5/NVF3VriObqg1x6WhBQsw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199015)(66476007)(26005)(6512007)(1076003)(186003)(2616005)(36756003)(478600001)(6506007)(38100700002)(316002)(83380400001)(2906002)(6486002)(6666004)(107886003)(8936002)(5660300002)(66556008)(4326008)(8676002)(66946007)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DiXB0pbDmHUTjqWkimWsRksFHTBGsK1hg3Ae8y/Ef984NXnJ6SMMt6S9pJ3s5PP9rqhq0A06qTIgsAFcTFNO2MNELB3+ZnFF1Xaa8knuK/l8oPXvI3T1XvjpkL68ODe/KT1zsapAb1Rq1j9kyxRFTbZb1jJ1FTTqOXzPwtZjKhz47+1J/ewXj/c33zvFxz1McI3AcOIdPaiVDBV/skMCOPRqi5PAwsen5T9ZBNJyqVZTUM9ZvxdYlPa/+qee/oVDeMvEvlE4Stalhyqa8aAtEtIR/J4WSWIcbI9Ii8SB0VBlfRvrLy/Z2EFSfQfhK8/VY2W3/AqYLZgT0/Fmn+HuqguQGGOJkWXbHVmdHMBHgKuqhjqi25HYVFca916bLGw4Pcqim9hcLC7cZnSWSmMrj+3InG+vVUrI4i0fwF9KyJFAOm08zXTXqQceRzcNd5QbXCqBsRkKSQEoFVEnLaRW31w7s1xuOr/hJEeuFEiKh6tUmfCkHN8L8o2IAukd1Bo1Rs/2gfRXF99QqKlMpIET1MT10/HWXVZlq2ezNuadc+YgPPH6h9b2wWOhRtw3+9MQM4OrxFJG1Q59QiYgD50YVO4yko7wFPGyzDmYYxIGM7QH9aZzzLxfJBIhWKLzoRcal9cS5z0U+yLP/LT81pYuk0KGFQRKIjqJ9jO2IudsyyEFhXTIMR8bMQM2xkBH2xka+CWHXPkQV8+LJpW0Wdy3MBJV20xDtyzCUK53mszCZUGpm2mxg29o0gbvxBKx+7SgSMx3uE9l195S8Tv47ErSEKw5xOhzKhl5lz9bCXB1YjchORP1B6/HsMnGnpTYWcdHmVsPvGBvQZZM4ueF9HNV/I0+DVUqzkYtdJTfsqHL95d8w9o93R4feQ/uBwhUasq5wnpaZGfBeg/Pqy8n+8Q8BQzrCElqjZuQQ5VcVUVA9fx4nYmd8i/08/KRWckWDftwYTNFDVKALoY3hfMBKtOJKlq2Sxtmc9A+ILVsPyNFqCxnWA0MU8e5I7FBCw+isv63khlq779SGhJp/gL1tZvg6Gpw9cwrP7qUXFu0ur6L2n3fH127erc56xdHDzBl5xjqhduDmGVBlrIN4lYzfiAoOSTnp5Huv8INn/hUp0dTjCoydgxqqdMvJONziDpQZuUQFZ5RYtMGcrn9ARCS6VRZJ7QyucKl11ZPcUeyYU3+ozsSpj0+o25JpwulTVZLCedPoF2nHp+B5iNqSsOG7tqJh3VSV2KG0HYU8B+Yxa27GEo/U9Uix0nOKBLwiHAYy1bAe1oxN6vbDZL2+X+e52+44UZ4EeaNpVOPZfo87wTkzB7sVAZt3pUQxESryFtGRgrYijwmqWj24KdS59jjfdHOUefNp2RHu5u2sL+TMKvuk2g2b1ePvAHNovdKkVjfAipn4vMsDF1mus76U4vC4Dqw9dybiGnxwL7OIyhSlfW0wOSARaKVJUpf4n4AG/AOYXBpX0RXsmkF17mWqiZw2etZIpa+d8+QL27b7P4EccK7hY2oUTJvZDUdrr7g77L6TwuDRTJ+7l1jvyzJnhV5I2EWZJ44nQrwy8EFvkGBBQzZNwfT7nA4kinbcUR/29hOWBPFled5V2S1lmCpnew0NEXo5g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b43bbed7-fa4b-4672-0db4-08daa1c5e438 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:13.7416 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MBDIwlYCBcGDTcTiD2PA18b1SebaGVHkJ/Rr4J1voPKKfpi1RPpFg514I+yCChuIxJizna3cdeOdyoCv/q90cVr7uCdtmq++LZ9Yizn9TEs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5653 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 mlxscore=0 suspectscore=0 malwarescore=0 adultscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-GUID: cDkabLgqKMYxzjWLkIlpBmI9uhB78H-q X-Proofpoint-ORIG-GUID: cDkabLgqKMYxzjWLkIlpBmI9uhB78H-q Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This breaks out the sense prep so it can be used in helper that will be added in this patchset for passthrough commands. Signed-off-by: Mike Christie --- drivers/scsi/scsi_error.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index b5fa2aad05f9..3f630798d1eb 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -519,6 +519,23 @@ static inline void set_scsi_ml_byte(struct scsi_cmnd *cmd, u8 status) cmd->result = (cmd->result & 0xffff00ff) | (status << 8); } +static enum scsi_disposition +scsi_start_sense_processing(struct scsi_cmnd *scmd, + struct scsi_sense_hdr *sshdr) +{ + struct scsi_device *sdev = scmd->device; + + if (!scsi_command_normalize_sense(scmd, sshdr)) + return FAILED; /* no valid sense data */ + + scsi_report_sense(sdev, sshdr); + + if (scsi_sense_is_deferred(sshdr)) + return NEEDS_RETRY; + + return SUCCESS; +} + /** * scsi_check_sense - Examine scsi cmd sense * @scmd: Cmd to have sense checked. @@ -534,14 +551,11 @@ enum scsi_disposition scsi_check_sense(struct scsi_cmnd *scmd) { struct scsi_device *sdev = scmd->device; struct scsi_sense_hdr sshdr; + enum scsi_disposition ret; - if (! scsi_command_normalize_sense(scmd, &sshdr)) - return FAILED; /* no valid sense data */ - - scsi_report_sense(sdev, &sshdr); - - if (scsi_sense_is_deferred(&sshdr)) - return NEEDS_RETRY; + ret = scsi_start_sense_processing(scmd, &sshdr); + if (ret != SUCCESS) + return ret; if (sdev->handler && sdev->handler->check_sense) { enum scsi_disposition rc; From patchwork Thu Sep 29 02:53:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612203 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 233CEC04A95 for ; Thu, 29 Sep 2022 02:54:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234558AbiI2Cy2 (ORCPT ); Wed, 28 Sep 2022 22:54:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233713AbiI2Cy1 (ORCPT ); Wed, 28 Sep 2022 22:54:27 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D03F2118B00 for ; Wed, 28 Sep 2022 19:54:25 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28T1TMZZ004231; Thu, 29 Sep 2022 02:54:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=CltwJnPUzUDVdxNlag5iFXTalA1YB4pG0jhnlmEoa5A=; b=SPq/T3sHl7XGTIDIXf7jTkTSxq0GGyVKGv2rSMtSnACAhiqol4QgT8XstruehwlMScFA 06gw3nCebvImdDnBuesaaI2newRPUSjXac5/bzrHadzxTelSUfqZxqqviIVMM2yUOr9L gG1050liHlGDtpwfyBO9vTLHxsj7kLAx9HUrwU0B78tGhMZtHPgOK1CcDt5vWtepRXF+ fIfnOMyecc9rH1vqaxDRkKlsHCXQUmsCBlcZJOhhuK/R0F20BBeANwLkkqXpgBUMnimW MdfzYToeo2D0X646b7nVbTGa48fl5Lq4jnYI8YqnU8zHrtjuWOE0afS6PCCSIpzrggZH yA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jssubkhhq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:17 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28T1Ylex039394; Thu, 29 Sep 2022 02:54:16 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2170.outbound.protection.outlook.com [104.47.56.170]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtpq9jc24-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NssHfuLk3H7xFKIpgC3OseKdzkNgefmw+JLYZzIAbxlgnOPjpN6xSeCg2G7z9b0/xSGAuSVDpExo6SUhi9HMXMtLAfYMnz18IYybh3MXiTRwBOk4O3FsYyvGAFp1v1cBRS0DxMApY5i4M2lDhF/ZfiXgH5tjaXCy+EVUMpwSL0LcK19RbhDE/BKbZj4Cn3AvB1RuLq5CLZMQLyUb5/jb/T8UuHClHQwW7gMn80Y08HEfelpNfjrEwFiXZs3//CSmLynAaCztavLT6msXW+KHfdcfdOHEpZ3USdKow9K79dPICPT9vDE55oUyl+ipUyFLQ2JKP8TMcXcA8CoxZ8sK6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CltwJnPUzUDVdxNlag5iFXTalA1YB4pG0jhnlmEoa5A=; b=kjiZBa4B8LplLavofql79D2hTJ+MPxVmSPUYgaGQXB0Ih7pesDDFkL3VEzz53hDIdce+4MKZWY0IFQIgOrIvgB82KsIGIEAG4jRFQZAhWDPmFv6j4X8AGk6DRy/wecXEJCG47pHsmHg9XYNNr+uEtC1XAOR00R/ErLWnl2G+oppW621OD/BD6XezxegHJo1YFGc+bA1SUgrtKaGkjywpzf5dpdv3VkcPRIz11YGl+WHaUI3BTQl9Sz4BpynW5GwtbwsWo0oVJhHmOFpZ1HgBhHVnxzvV/C2ZnVXAMQH5CXBJ+d6y6EGLE2dLWUV7OTZGfRV/Q7hoHLBumBA2BY1mNg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CltwJnPUzUDVdxNlag5iFXTalA1YB4pG0jhnlmEoa5A=; b=NHAXj+SMxqGVq/pgt1lkOcFmgocPXzqZ0ExZ5TvcGB8W0iD7m5yYcGp0M/SDC9N12Kd8h8tTUJlWrbe9IRAvnRJeFx8fTm75zDZxNwocllmXFJUKC2HuE2l+r+yAlTvJrDRSsZystNBcsvCDaBVwbCAgrs/oEpP2TSKwHyXq/d4= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SN4PR10MB5653.namprd10.prod.outlook.com (2603:10b6:806:20c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.19; Thu, 29 Sep 2022 02:54:15 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:15 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 02/35] scsi: Allow passthrough to override what errors to retry Date: Wed, 28 Sep 2022 21:53:34 -0500 Message-Id: <20220929025407.119804-3-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0027.namprd20.prod.outlook.com (2603:10b6:610:58::37) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SN4PR10MB5653:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ab4e562-c39a-4c7f-85a1-08daa1c5e539 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UmCGHCLqL/Y18w3x0HSwpvcv3e0NOIJk8mi1XmsaTYfb80f/FDp8RvV9rDpLzZPg5FAezpthUaqmaFm+AqByvpOMXdWGRm8rRL3bl2GtHib6IBAWPsERHHhDdoBCf/64aOFWo0Ip8dJMKYpTDgS7eMJbav9ZEgROnWLtAVqsAz7ycqzI0ueMfoiNV00wRScE/O4yR+mXeCQ3TGl/1MvaSc2OulVm1ZgXg9kj+WR5aFENPQVHW137yrkjsBOnx1hEfRoB41CBPZHBgOU/EItR3+TFMt92Ul+1FjRwrWfxV4VTwc+L9xFhi8+VP6WWx8wdkz3RIRRu0GpTJcIQIhUlqSXGHsU7WRpBnxNeZCwvhJCs2oIBwvbOtM4wmTfrMsC/Se4QakgZ5Xak8qUfHCA7qsSsN75A5HmWD1m7je5aBJ+uerGTUqPFkDGTUJFalJfy9bFuId2tHNXtB3Cm8F2xs421TfguNNlfhnaYxGdr4hlVPCxc7OqyqtaCsNVj2s6NYUCYZ++cWOHKIMnvNKqNCybjMVtCtSEg8fPu6sQlogvFK4RADLZ7aUtCMkrqcul/rhygKdLhX8mx+T0v2da41lmGsdT0YDrGT1AiqRUlYpHaaOEARNaaks7YjImZ14Fj51FfupcHHUR8XuQlP7Fja4Crrrm42wIuzVfTES4yZZYUv39S6uk6EVmfkUBPq39Qf7+G2EUCKdxY45NPH390fA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199015)(66476007)(26005)(6512007)(1076003)(186003)(2616005)(36756003)(478600001)(6506007)(38100700002)(316002)(83380400001)(2906002)(6486002)(6666004)(107886003)(8936002)(5660300002)(66556008)(4326008)(8676002)(66946007)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: m2PlRYLC5HJuIgSQii3uW/p+KCvAglSPvU/gbhob7C5IwLk4wOALt0LFc+x120gVWdmrHWwpjBCxyxVLiOpYFBcb4P3A0T4J49vFQ4baehIJ4gyaXPyAaLBitMWzd9HCeAf/xwAvV5pDD41AgT7lDuvZr28pfuwkeuYqWg0Zs9TuyR9kgCysbKpWP9CUjA2phIxiMMTKWuywSDhrj4P3/gqs2y1rx4Cpxg0BmvFcxigTiQNMWuWzu0j0PUOOx9CF9N7WF6BNOavjNFQwtXkem2VHCOw3u1EzgUVPq5zKAVSYCIvCEwGwodTxwYFMG45zRpdaEziJJXaJtQX+TOc8Cyu3SgQVKTy8tnjkDtjqS289vBCkfEpwxJXIHVliacPLXXnalEa3vF0hMkpaM3DLHZFOebBf0vvKbpW/Xm7sQIDJmXgFT/cyQH5iKMwiXucOw7pL3b0xbKeIfXOFTt3KZPJ9KmPgpx7Pc7OhKM16C7v2ErYaQiLQXpJ0x2bxee2rnpXGsDTM7cWBFagawyCH0h4bBrY9u0OqTApnsF0eTQq0MzKbxmIWsSR7MfmVkJI5/207KZssl3sGm262uhBMn3Y+mTLi6neLnVCbgor5mg/+iYEzvyMzUBQNjFTGHjoZUlZl+RH6tEm4sawazP8Yjqy53kbgTdSwq5OoJYIJBkacS9NkC/EFB15hVKh+IcuplKrHl+mj6PLAF6JzzZdM/HEIoFAcXv/2rcLMvNQANZwdI1de1fmbSLTX4696+mxYLgcj4pZ+ssfPq4OjzZtZN73Bc6Se64LGKs5FtNQQrt37PXIVpXpUfLOLWmP4ZvI2CJDMSWyX7J16L6YG4aiMmph/MjS0Ish2E7IAMNiE0egnESVoJRfYiwOgx1+zrk2Sl7B4PCFsgEWv5OCEdVNXwGpNrunGpHOobeFc6a7USlG+p3L0YVLkjoNPySpivBw1lmz70XO2Uf2U+r7uQnsIxEvcHme6Qu+mzwPbRYhYp3ArLPvLN6sgielTpTjwrNKw2p1LVvVag+iHbi3Vl9tJblS63y0mTTxFjriQQLa3z49LQ+o2VSgkjuMSBpCwbOlvTvsrRhKXvyTQ9hcxyul/0r3e9vcoxkbDnn1wkBY8Wg9OKGMkQcaOpYJJBq6IuoCAqb0MEtwn6GiXHHx+5Y4YxcIVBGlusM1cXCICm7FCpCA2QBVYN9phhQKFZl0ur9QdUYD+u6W8yhxFtttNYJDTS3RWoRL9t9BOP0Ja71R5hjFPmJrUeoU84+HAFuLDuzjDk8NRzsfLxd/adzeQo3WH+ytulD7rD/Led6ppFpcUWKsOHS7bC9Bbw0St35oy34idrRsRwSnby+TrLln9PIrYqqNMCnqzDR/Fyisvs55QGOFkJmqc0zt2wG3hTddMVghpD+lRSE90HLB5MCektt0a4Qp4llh5fOK4qvlOLrEX0133WTiP0ST0buvR1WDd17nS8nv0bDMYn6PKPQ1tgZUuC6x30T9hQr/1/SqwRzB0hVG1jDv8fEnQijoFkJxvxlqEOd7g6FEgImF0jIpiUINcDiCLrPHJ1oBJEO54Bt3uEgFA7xOs0nkiGI/emUxv7ad1ugNu0D8/LgYmY+n2yAMXzA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ab4e562-c39a-4c7f-85a1-08daa1c5e539 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:15.3821 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: YqGIa5elZ2aQELfKCXJBgRRlbqfRDF0s/2QFqHNmS0JpcTqbk1HDyxD/OaRbAehbwYQSChyUP7LXfVJkVCxS6Df0ZV12fjL2bWEOA9+CLnM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5653 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 mlxscore=0 suspectscore=0 malwarescore=0 adultscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-GUID: NVgbRLeBEWPC0vieixIiSKZ0qv26xf3I X-Proofpoint-ORIG-GUID: NVgbRLeBEWPC0vieixIiSKZ0qv26xf3I Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org For passthrough, we don't retry any error we get a check condition for. This results in a lot of callers driving their own retries for those types of errors and retrying all errors, and there has been a request to retry specific host byte errors. This adds the core code to allow passthrough users to specify what errors they want scsi-ml to retry for them. We can then convert users to drop their sense parsing and retry handling. Signed-off-by: Mike Christie --- drivers/scsi/scsi_error.c | 63 +++++++++++++++++++++++++++++++++++++++ drivers/scsi/scsi_lib.c | 1 + include/scsi/scsi_cmnd.h | 26 +++++++++++++++- 3 files changed, 89 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 3f630798d1eb..4bf7b65bc63d 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1831,6 +1831,63 @@ bool scsi_noretry_cmd(struct scsi_cmnd *scmd) return false; } +static enum scsi_disposition scsi_check_passthrough(struct scsi_cmnd *scmd) +{ + struct scsi_failure *failure; + struct scsi_sense_hdr sshdr; + enum scsi_disposition ret; + int i = 0; + + if (!scmd->result || !scmd->failures) + return SCSI_RETURN_NOT_HANDLED; + + while (1) { + failure = &scmd->failures[i++]; + if (!failure->result) + break; + + if (failure->result == SCMD_FAILURE_ANY) + goto maybe_retry; + + if (host_byte(scmd->result) & host_byte(failure->result)) { + goto maybe_retry; + } else if (get_status_byte(scmd) & + __get_status_byte(failure->result)) { + if (get_status_byte(scmd) != SAM_STAT_CHECK_CONDITION || + failure->sense == SCMD_FAILURE_SENSE_ANY) + goto maybe_retry; + + ret = scsi_start_sense_processing(scmd, &sshdr); + if (ret == NEEDS_RETRY) + goto maybe_retry; + else if (ret != SUCCESS) + return ret; + + if (failure->sense != sshdr.sense_key) + continue; + + if (failure->asc == SCMD_FAILURE_ASC_ANY) + goto maybe_retry; + + if (failure->asc != sshdr.asc) + continue; + + if (failure->ascq == SCMD_FAILURE_ASCQ_ANY || + failure->ascq == sshdr.ascq) + goto maybe_retry; + } + } + + return SCSI_RETURN_NOT_HANDLED; + +maybe_retry: + if (failure->allowed == SCMD_FAILURE_NO_LIMIT || + ++failure->retries <= failure->allowed) + return NEEDS_RETRY; + + return SUCCESS; +} + /** * scsi_decide_disposition - Disposition a cmd on return from LLD. * @scmd: SCSI cmd to examine. @@ -1859,6 +1916,12 @@ enum scsi_disposition scsi_decide_disposition(struct scsi_cmnd *scmd) return SUCCESS; } + if (blk_rq_is_passthrough(scsi_cmd_to_rq(scmd))) { + rtn = scsi_check_passthrough(scmd); + if (rtn != SCSI_RETURN_NOT_HANDLED) + return rtn; + } + /* * first check the host byte, to see if there is anything in there * that would indicate what we need to do. diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 497efc0da259..56aefe38d69b 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1608,6 +1608,7 @@ static blk_status_t scsi_prepare_cmd(struct request *req) /* Usually overridden by the ULP */ cmd->allowed = 0; + cmd->failures = NULL; memset(cmd->cmnd, 0, sizeof(cmd->cmnd)); return scsi_cmd_to_driver(cmd)->init_command(cmd); } diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index bac55decf900..9fb85932d5b9 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -65,6 +65,23 @@ enum scsi_cmnd_submitter { SUBMITTED_BY_SCSI_RESET_IOCTL = 2, } __packed; +#define SCMD_FAILURE_NONE 0 +#define SCMD_FAILURE_ANY -1 +#define SCMD_FAILURE_SENSE_ANY 0xff +#define SCMD_FAILURE_ASC_ANY 0xff +#define SCMD_FAILURE_ASCQ_ANY 0xff +#define SCMD_FAILURE_NO_LIMIT -1 + +struct scsi_failure { + int result; + u8 sense; + u8 asc; + u8 ascq; + + s8 allowed; + s8 retries; +}; + struct scsi_cmnd { struct scsi_device *device; struct list_head eh_entry; /* entry for the host eh_abort_list/eh_cmd_q */ @@ -85,6 +102,8 @@ struct scsi_cmnd { int retries; int allowed; + /* optional array of failures that passthrough users want retried */ + struct scsi_failure *failures; unsigned char prot_op; unsigned char prot_type; @@ -330,9 +349,14 @@ static inline void set_status_byte(struct scsi_cmnd *cmd, char status) cmd->result = (cmd->result & 0xffffff00) | status; } +static inline u8 __get_status_byte(int result) +{ + return result & 0xff; +} + static inline u8 get_status_byte(struct scsi_cmnd *cmd) { - return cmd->result & 0xff; + return __get_status_byte(cmd->result); } static inline void set_host_byte(struct scsi_cmnd *cmd, char status) From patchwork Thu Sep 29 02:53:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612202 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72F13C32771 for ; Thu, 29 Sep 2022 02:54:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234791AbiI2Cyi (ORCPT ); Wed, 28 Sep 2022 22:54:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234607AbiI2Cy3 (ORCPT ); Wed, 28 Sep 2022 22:54:29 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3DE1118B00 for ; Wed, 28 Sep 2022 19:54:28 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28T1Pupu014141; Thu, 29 Sep 2022 02:54:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=cdqrXtxj9nYkmduY9LXGQeho5wEZ2NZGqMO5px0D0sI=; b=r+eN579Cd+Of5LUh0/UZA74VWsttRB/Ffsih0/djY9G4DseZ1CVopV/bry27AJr27TFX qA6/ULYnEXylZ1MXHfie0oUZEIgpymalGrpRN5Sr8Z64RXf4/DIMKAjQZv1bCsb7Ppf4 US6hccBPDgJtI9Og23GUnKTrM4S2nX/1p+0vIrwDP4rAYx0mDSZj4duGS1LmYnzY4i6m BV7ZUrgY2vwmniSJn9u682cfDRY1LDZXiyTRgW5qF8FCGaykIAtxhxlHqeVsjXEwJ5WO XYeqTgsPkdu+2DX4jHCdGo9NlsUZBxAZPnS8d28/xfGBCIsKhe+FgRcQ72cRU3rTATjn Qw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jstet3ue9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:20 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28T24r3U039268; Thu, 29 Sep 2022 02:54:19 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtpq9jc2u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RMCfxhjcdoJwh2VSTn5IxiALl8bQaJw3Jg5dhMN6AfziFIARpZtCfgonbSlu+c7F2yIqHNtcOLcpUNduDge3dHyuVIEQM69JpyO8Jd1l+BmpDkP64zkLQexSn9wmEt8IxC7ERQ5VIFfbwLIqfjOkQe7IaX/x8SpYlij5slo3weEbp5E1JYGS+k9Fxy1dxQRvvzpWw/mKy8yOsACrCCmhTkLTr1CsY4f0DAVb9455G0mPSPh78wlJVDA7u37dEyrceXNQ0irB8guJfyNWshjMfLj7myjAZyy1NbDC4cR1bwBDJDWtxvH/Hk5N1JVPwS44ddmAH2ohewG3AmocmgbbYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cdqrXtxj9nYkmduY9LXGQeho5wEZ2NZGqMO5px0D0sI=; b=X/2ahGv20fRyhgPmaTdoK48wtZm2KDS6CtXT0sWpo58tgNeRh/8DNGowFWKIggKQop7IC9HEEHXIJlVirbPhTgmZbPlS5AQH5gzwcWkdqnop6XlM/L/P0gTElkynKUxQIZEqTlelKi5tbCLi/uDLxn380rKTmsYJWBVKOO6D+XDI1nL5QERKh7XOxqdfki5mS0VHgOxHhm+mRLBGPzEnMfKvihsqGFPO50dZXASM0wwiNt+TLbTZYw6BdLB4bD/+/9Jk70uJIbEiNa5o/Uxg1UQ48pLkfYsvwe2hN2+6tP32O2uo/VqCzdKXacdic6ce81NbZ/XXENvU+q+RWOH+bw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cdqrXtxj9nYkmduY9LXGQeho5wEZ2NZGqMO5px0D0sI=; b=p9w/A4XUNHIBfhVtytLFujtj81qf3y26NoVqMcRUkD0npACN0PzlUviLboaLxnbRYnlkwZQC8Oes4250yXXfxT67EUpdyiAcJiQMO5hq+A6JUrfv3rGzQHURCS29d7URbobsVRwf38Oz9otSddOO09e55TZK7tOHenBjzNdvwiE= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SN4PR10MB5653.namprd10.prod.outlook.com (2603:10b6:806:20c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.19; Thu, 29 Sep 2022 02:54:16 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:16 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 03/35] scsi: Add struct for args to execution functions Date: Wed, 28 Sep 2022 21:53:35 -0500 Message-Id: <20220929025407.119804-4-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0007.namprd20.prod.outlook.com (2603:10b6:610:58::17) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SN4PR10MB5653:EE_ X-MS-Office365-Filtering-Correlation-Id: 1783c966-40f1-4a0e-b1e4-08daa1c5e60d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CYcUKwfGkyJLNPezGMR6ftSxik1uf8IWRyRxL4AOluzEZa8fLFxr+XiwUPeYLmyS8u/HxACqejmK/PnCi7vFrfl+PPD1TneXhqKOVL5CF5pOzOhlOi1We+hsXuTQ2Fhj3q49nKtUQGUKlQdh1HXgOnUvv7A6065cRs8pEWDZ35ZDgClEED0wm5rXk5QF+A2fVdARRRJqrT1ZJ/cqxjtWIMKxVtbII9BcnkwvgH3qhVzWw3tFZXF5ZvChiBf8WFvPWSk6IHqvnBwSpbJ5R4FnOz+gnVdw2Dow2d2eY76WRm/uGh3H2Q3+KgTwMXE72qlax0Niqlcr3Imkg3nOA1fXQKTR77ZR2H4lVEQ9tQeNpP7sVafTtNEGVgo+FFNuhoKhmG/ko+kNjrWCqOds3NTbN+VBaLFMbIBFEYqGWeYUgMd+9NvuNdYDkS80fhUKi+ROqMprHhKr7HJ+7AcwBa/f2R03NTtTMZIM065OAyjUN2qmMvKtxekQJ6J2tQSHdOq88/G8jYalKQ/yd1YSvWltqzXlMIsBWK4Jr1EoZiEJQRxW6EuHzzLfcqXzbISf4GlPSmjN5Ja4YhykL89xHIISo1RhfBI7dA6OEVw4JDhq/HeaMsdmjLiGXL+OZiNGzGHAJzF/OEKt0xhMm/wfHCOoaTlbnAK9sGkt2PLndMrwdpRRXvAWsGbeTiASaWsBhYpTK2jT3Wc8q4qcTXru/misIA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199015)(66476007)(26005)(6512007)(1076003)(186003)(2616005)(36756003)(478600001)(6506007)(38100700002)(316002)(83380400001)(2906002)(6486002)(6666004)(107886003)(8936002)(5660300002)(66556008)(4326008)(8676002)(66946007)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: A8xbHTzIDQCu2GL0SLNk5XbeBgzXGiKFRNe2IjzRYytuKHqmE/smvz+wihitX03Ik8A/Z/pqAZlnZ5dIedvRIybu7y1/xjjpqCLjDoy0+5jzYuLjb9g7kHB74d/CVNC6bGxBqByEK/GvsSe0oPMGunxpNbgIV/fFA8Ew94Ojleq1Pa5+ebKXC6g+uXkmU8CQR9+U1+UexX+8moz4ySZjW4cXhOj9ZndDwEJOaHgCGwjbRqACHJ4ekWkzKVt91M1abPXMijVOhYnha2Z+8tCYRligViko4XgV9FusSSOFEnFXZUkL8gHby/C+lvxFViESyZ1oidBfeF62F3/g2OBfjqt1ZPMHTz1VG3BMjOAbzQi3Bd1HUuBbPePYNbfQJ1F23QT2Rzg+mphr4mT+CNKIBhRXS5X+4TSVViYgqNhn33vsli0HC2KBiZHs4xmpSyLNVW4IQxYTn5ARSDenh1RqXNu48W5OjtBT/W6llLRLA4J0+X0ipq9jKu5tPTea825C2A3kftzdamQ1+c3KEt3yu0HOWW01TIgI9BxN/xnSq4QzL13LggAG8AAW2zG8/ZcaaYuK1h6fk0ydVcbfuc+cHqUW/oxIwdFbwJwuFXShVhbIqEQPrHED3u7JRuM9YIBFq0KEk8neK0bagOS+BPWjq6uDewPxI/DZSa0BLu/ISwidnYFWq90f3E+AoGj8fTWHlNXNUy2cQCaj3iNeBa2cYSs4DH7GKa55oqasUg90sKhkOU5Vypzoeuzk6t/Rl1c9Nu4Pd55FaRldknjr+iNEHU48zvTlBlibUrHb5EA5im3e5XbtVjwpuSTVQcVPnUkBCZGsnVudDcRjWUMobyfpYBff5OOJqAcpXJbtiHMG0HexmGkCUsXS7EDaw8ev9vEDe+CWB1peUu4lxpbtxeAwzxBMzgcLFSAeRkyNiSpS09dQKpumqkH9lhXfuNFL9Bhd/qpFhFPLQOapTfHgMSPNFj3yrdMHL5BLQh/YIz98j5esqs9W5MQhiWCTKtjUE2BIsqXlfii/7vu8Frj8it/wHqI1FOB++nUobJjRfmIsHuDRMGhppggfGo7Mf42Se77zx0lyjRhMwGLmIJFEozNR1oVAZNT63YR/HGorXLlz+M7vvvXujUnttrY3mu9OIhB4m11N8xASnKMv/p62msasQoOVHAr+NrB2D1HFrJVqtz+Grl9c6zNQQZQIfbu6MOKfXKyciLUc8VCMSDBuC+nJMjZfmhzcqTQuJg89kZ65SMkxFzRNpMa8U3JD9q+RFbpBhcvflKDe3CA8O+5Nb4iElalGAMOLK9WbU33PjyGR4rWNjyjfPVCaFhI6FVfF9MIAn7GAGCn/0GHnj0fYAh9klAMYI5d7G67fdO0IyzqPnGQDnOgqbvbINvkditS6PWB2tF6JchfSuOZyqRO7QpQi4LGLOcIDjGQcNQ4RqwWLvnQbWcB37183WqGYvQVVGBGY0lvMMFP4i0Wem5QzX9C8wfjpcyCmLb718LgbVbKPZ7OwiedYjkXQMS1TJ2fsqDIfa0MZhcuYOI3ieE54VkCdOnJIODHldjERHPVPYPlx1wIebAEmOSa7yBTX39G9kN6xIBQNhjBnawWrMCDbHvY/kQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1783c966-40f1-4a0e-b1e4-08daa1c5e60d X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:16.7882 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2cq6W/CUQ4CC9MuJQwGzNeQGOBarsER2uhUSw2Vd7Tu4LdjeHPYOHGO0Yxafr3YG9O1GmGYcys5k9kazphC1tsPdNb0N7ybjZc0Ia5t9GCo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5653 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 mlxscore=0 suspectscore=0 malwarescore=0 adultscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-GUID: ty-lO274_efi5GGE7XqFUiIHAq2wtrM5 X-Proofpoint-ORIG-GUID: ty-lO274_efi5GGE7XqFUiIHAq2wtrM5 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This begins to move the SCSI execution functions to use a struct for passing in args. This patch adds the new struct, converts the low level helpers and then adds a new helper the next patches will convert the rest of the code to. Signed-off-by: Mike Christie --- drivers/scsi/scsi_lib.c | 69 +++++++++++++++----------------------- include/scsi/scsi_device.h | 69 ++++++++++++++++++++++++++++++-------- 2 files changed, 82 insertions(+), 56 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 56aefe38d69b..18cdcefc7f47 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -185,55 +185,39 @@ void scsi_queue_insert(struct scsi_cmnd *cmd, int reason) __scsi_queue_insert(cmd, reason, true); } - /** - * __scsi_execute - insert request and wait for the result - * @sdev: scsi device - * @cmd: scsi command - * @data_direction: data direction - * @buffer: data buffer - * @bufflen: len of buffer - * @sense: optional sense buffer - * @sshdr: optional decoded sense header - * @timeout: request timeout in HZ - * @retries: number of times to retry request - * @flags: flags for ->cmd_flags - * @rq_flags: flags for ->rq_flags - * @resid: optional residual length + * __scsi_exec_req - insert request and wait for the result + * @scsi_exec_args: See struct definition for description of each field * * Returns the scsi_cmnd result field if a command was executed, or a negative * Linux error code if we didn't get that far. */ -int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, - int data_direction, void *buffer, unsigned bufflen, - unsigned char *sense, struct scsi_sense_hdr *sshdr, - int timeout, int retries, blk_opf_t flags, - req_flags_t rq_flags, int *resid) +int __scsi_exec_req(struct scsi_exec_args *args) { struct request *req; struct scsi_cmnd *scmd; int ret; - req = scsi_alloc_request(sdev->request_queue, - data_direction == DMA_TO_DEVICE ? - REQ_OP_DRV_OUT : REQ_OP_DRV_IN, - rq_flags & RQF_PM ? BLK_MQ_REQ_PM : 0); + req = scsi_alloc_request(args->sdev->request_queue, + args->data_dir == DMA_TO_DEVICE ? + REQ_OP_DRV_OUT : REQ_OP_DRV_IN, + args->req_flags & RQF_PM ? BLK_MQ_REQ_PM : 0); if (IS_ERR(req)) return PTR_ERR(req); - if (bufflen) { - ret = blk_rq_map_kern(sdev->request_queue, req, - buffer, bufflen, GFP_NOIO); + if (args->buf) { + ret = blk_rq_map_kern(args->sdev->request_queue, req, args->buf, + args->buf_len, GFP_NOIO); if (ret) goto out; } scmd = blk_mq_rq_to_pdu(req); - scmd->cmd_len = COMMAND_SIZE(cmd[0]); - memcpy(scmd->cmnd, cmd, scmd->cmd_len); - scmd->allowed = retries; - req->timeout = timeout; - req->cmd_flags |= flags; - req->rq_flags |= rq_flags | RQF_QUIET; + scmd->cmd_len = COMMAND_SIZE(args->cmd[0]); + memcpy(scmd->cmnd, args->cmd, scmd->cmd_len); + scmd->allowed = args->retries; + req->timeout = args->timeout; + req->cmd_flags |= args->op_flags; + req->rq_flags |= args->req_flags | RQF_QUIET; /* * head injection *required* here otherwise quiesce won't work @@ -246,23 +230,24 @@ int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, * is invalid. Prevent the garbage from being misinterpreted * and prevent security leaks by zeroing out the excess data. */ - if (unlikely(scmd->resid_len > 0 && scmd->resid_len <= bufflen)) - memset(buffer + bufflen - scmd->resid_len, 0, scmd->resid_len); - - if (resid) - *resid = scmd->resid_len; - if (sense && scmd->sense_len) - memcpy(sense, scmd->sense_buffer, SCSI_SENSE_BUFFERSIZE); - if (sshdr) + if (unlikely(scmd->resid_len > 0 && scmd->resid_len <= args->buf_len)) + memset(args->buf + args->buf_len - scmd->resid_len, 0, + scmd->resid_len); + + if (args->resid) + *args->resid = scmd->resid_len; + if (args->sense && scmd->sense_len) + memcpy(args->sense, scmd->sense_buffer, SCSI_SENSE_BUFFERSIZE); + if (args->sshdr) scsi_normalize_sense(scmd->sense_buffer, scmd->sense_len, - sshdr); + args->sshdr); ret = scmd->result; out: blk_mq_free_request(req); return ret; } -EXPORT_SYMBOL(__scsi_execute); +EXPORT_SYMBOL(__scsi_exec_req); /* * Wake up the error handler if necessary. Avoid as follows that the error diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 2493bd65351a..44e5986b8ab0 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -454,28 +454,69 @@ extern const char *scsi_device_state_name(enum scsi_device_state); extern int scsi_is_sdev_device(const struct device *); extern int scsi_is_target_device(const struct device *); extern void scsi_sanitize_inquiry_string(unsigned char *s, int len); -extern int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, - int data_direction, void *buffer, unsigned bufflen, - unsigned char *sense, struct scsi_sense_hdr *sshdr, - int timeout, int retries, blk_opf_t flags, - req_flags_t rq_flags, int *resid); + +struct scsi_exec_args { + struct scsi_device *sdev; /* scsi device */ + const unsigned char *cmd; /* scsi command */ + int data_dir; /* DMA direction */ + void *buf; /* data buffer */ + unsigned int buf_len; /* len of buffer */ + unsigned char *sense; /* optional sense buffer */ + unsigned int sense_len; /* optional sense buffer len */ + struct scsi_sense_hdr *sshdr; /* optional decoded sense header */ + int timeout; /* request timeout in HZ */ + int retries; /* number of times to retry request */ + blk_opf_t op_flags; /* flags for ->cmd_flags */ + req_flags_t req_flags; /* flags for ->rq_flags */ + int *resid; /* optional residual length */ +}; + +extern int __scsi_exec_req(struct scsi_exec_args *args); +/* Make sure any sense buffer is the correct size. */ +#define scsi_exec_req(_args) \ +({ \ + BUILD_BUG_ON(_args.sense && \ + _args.sense_len != SCSI_SENSE_BUFFERSIZE); \ + __scsi_exec_req(&_args); \ +}) + /* Make sure any sense buffer is the correct size. */ -#define scsi_execute(sdev, cmd, data_direction, buffer, bufflen, sense, \ - sshdr, timeout, retries, flags, rq_flags, resid) \ +#define scsi_execute(_sdev, _cmd, _data_dir, _buffer, _bufflen, _sense, \ + _sshdr, _timeout, _retries, _flags, _rq_flags, \ + _resid) \ ({ \ - BUILD_BUG_ON((sense) != NULL && \ - sizeof(sense) != SCSI_SENSE_BUFFERSIZE); \ - __scsi_execute(sdev, cmd, data_direction, buffer, bufflen, \ - sense, sshdr, timeout, retries, flags, rq_flags, \ - resid); \ + BUILD_BUG_ON((_sense) != NULL && \ + sizeof(_sense) != SCSI_SENSE_BUFFERSIZE); \ + __scsi_exec_req(&((struct scsi_exec_args) { \ + .sdev = _sdev, \ + .cmd = _cmd, \ + .data_dir = _data_dir, \ + .buf = _buffer, \ + .buf_len = _bufflen, \ + .sense = _sense, \ + .sshdr = _sshdr, \ + .timeout = _timeout, \ + .retries = _retries, \ + .op_flags = _flags, \ + .req_flags = _rq_flags, \ + .resid = _resid, })); \ }) + static inline int scsi_execute_req(struct scsi_device *sdev, const unsigned char *cmd, int data_direction, void *buffer, unsigned bufflen, struct scsi_sense_hdr *sshdr, int timeout, int retries, int *resid) { - return scsi_execute(sdev, cmd, data_direction, buffer, - bufflen, NULL, sshdr, timeout, retries, 0, 0, resid); + return __scsi_exec_req(&(struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = data_direction, + .buf = buffer, + .buf_len = bufflen, + .sshdr = sshdr, + .timeout = timeout, + .retries = retries, + .resid = resid }); } extern void sdev_disable_disk_events(struct scsi_device *sdev); extern void sdev_enable_disk_events(struct scsi_device *sdev); From patchwork Thu Sep 29 02:53:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 610834 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 664EDC54EE9 for ; Thu, 29 Sep 2022 02:54:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234804AbiI2Cym (ORCPT ); Wed, 28 Sep 2022 22:54:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234801AbiI2Cyg (ORCPT ); Wed, 28 Sep 2022 22:54:36 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5484A5F58 for ; Wed, 28 Sep 2022 19:54:35 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNiQTS003456; Thu, 29 Sep 2022 02:54:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=3DhM9dTGQqYXWyJVPvxTY9dcyDBALZa4fcaFtTpuoos=; b=ZtvEjGa8LclVBHZIx9xtUhqfrYW6MQntgrNdiJ943VS1JzppMfjpg2ksi8UbUYf4XfiC sVup2c26F5RoNEvebhagt3chFWKIadXKWi1hfcmGz1NGAEzD/7dQAZ+NY4kauGWj/jjS j7GD5/65NJYqNvTBwn7m2+wyYnbssjLim8iRcxp8rIjguW2J8iNACH2usfqLaPbxc6vA tSORbUiPhhiYOneWh0u4/M/DnokNwu4CevUEUaa7FejDkLFt5zL8WLsYc96eeoH7PV/y vG2McsctszMU2Oj8W3hpm7zjZLTxTdYoH7D1+3IqEb0A1n7O+c/gA6RzpR8DiqK8yxYp vg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jssrwkjc5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:26 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28SM1cea039455; Thu, 29 Sep 2022 02:54:25 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtprvtcqb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LJUrwnjf6WI3MuBQ8MewZnp4MQNhVcd5Zvc5d/l3lcJdg84m3rjJSgsSfX8YBR/qUAakl2tLG8Px3UeIlS1A32SlRiVQFUF8914UeLDRNVESWi2LjvK1IgXh/s9xG+aO5foG/WeIwcRxU9+UUf5iA+ker/w50SUb5MgcuCCYWxRNVvpocjSapRLxxQzg/u8jLfOY5HOFBh7sL3qhf+fVUl3tGl4ay9HJBYleQFNJsLC94v9LdEj090e9SxECoddR7NBEar+Y2a8HUNiDTuEwuNT2r1ayD5aqAKM/7riyQTRPkygWW379bxHJFubP2ZkVJ/fuuoil3pJGYufapjUKgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3DhM9dTGQqYXWyJVPvxTY9dcyDBALZa4fcaFtTpuoos=; b=QwLdYEAMr1EGqtCVZEMsTSC+Q7CO7PpFH7XGD1NK6QU5kGEmhha+DiXSfZSt/UlhF2lahXKs7e219Zvax1tbGpISivTm7L+CczCBTBuR14qn7+cAcVBSK9J0fakHQ2ZzeU/G6kXeQiJFuh0assH3dLlh+I9jte8qsY0sfDQqFQmfZar6kf54qEnd2IIHuwCCr6tZCzxKQmFd20BT4RvGAOZoixzPY6ci6Sgjct/8TEQwwqbtau7j32z66QN+NOxqL5+adXC8i6Mp0Rxf4txF63kH2IyG1JVIAcZDlH2n6eQ90L+pMJHpt5HHjNyoOPL9PyPcp+kmbCDNhYvhP2DfvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3DhM9dTGQqYXWyJVPvxTY9dcyDBALZa4fcaFtTpuoos=; b=xjo69cGU5NN6O2QZxAt34KarZLgxDuTym8WCNUNBi2ZiTze1gKf3cdc3VggS+laD7pNaSm7Aj4m2d9dGW1DiCRMaUZdbO/V1YPnFTVdL1mx5KTCj8UFTHNdNx9vfk/mJiCcJ7snGAlgzIphG7uDuvzE+2OIy1gAe4XGJbQSEdEg= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SN4PR10MB5653.namprd10.prod.outlook.com (2603:10b6:806:20c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.19; Thu, 29 Sep 2022 02:54:18 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:18 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 04/35] scsi: Add scsi_failure field to scsi_exec_args Date: Wed, 28 Sep 2022 21:53:36 -0500 Message-Id: <20220929025407.119804-5-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0011.namprd20.prod.outlook.com (2603:10b6:610:58::21) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SN4PR10MB5653:EE_ X-MS-Office365-Filtering-Correlation-Id: b8a3c58c-397c-47d2-02de-08daa1c5e708 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BeZq4rdcdMyy3Beec4Way9oe5gHQ4A3e5O0aDiH1cbeQaKdUsmeRFH4JzhR/Gp4E4+gIDX5Vyet1P7UOO3bTNK2BXJidQHCILfX6D+6RIhn1vamaY/xm8A9ji6JE/cfj/amV2xDmkv0St/XU4npLlvTBxTikyYljUJU5Lrg874AnxEWbZz4ewCETKBVd89weh3uksV6bXHNyTUuoJUGPLhstGmDg9MjagoaNuM1zYWzKBhwrW2Ps/dt2lEeCEm0vgNA+yPDUo+5XIn4Cbk2w3gAWB4vBmsJxy7xgrFDjZKQ/Q7xxpa8S0acmyOv9J7sqZlEoUzb7PPpnlgRVEiPKtCPqTGtHTBqs+th2gI/BZ0VUAbMRRCgZMiTfJ7PrWaffM1Xb9xcNCeCDcxokTlOJppxUy3Iygk4GmnsVPh57c2EzMys93Pe+eUldIONd0emYn3FkVqiicEPHR8vOfx6ZmUCuvC5/nfDeekZRe22JfIItOfxqfU3zTtwyuWgIhoKVTmyqrSS8bOlkg4viEGcDwtq1RmvoVCux322tHK3do5Fp8c9c4o0/A6ceO1IkinghjYqmrKXJPmnfe3l4flNmoPHd+jV0Pz6ozQXWbdovFVgQPTvz7DuFOmTme74Tpv8XcIUAmFO8qKYHS+JigITGFWmj8KgC2xBVhQLUxGISXKiFXX6fYiUE0Q3KKESnlJVP4yZuLp6STkZ+qXSKH3GcWg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199015)(66476007)(26005)(6512007)(1076003)(186003)(2616005)(36756003)(478600001)(6506007)(38100700002)(316002)(83380400001)(2906002)(6486002)(6666004)(107886003)(8936002)(5660300002)(66556008)(4326008)(8676002)(66946007)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TXS7QDrTcqJ83U0vVgHKvXb/qDbstdMym54PCQyEZYqI3KSyelxxk2qmr6fDFsiuozjhnG/4xYVOlZaHDSymBOQbx1a6VpNwmzrpv5KdOBBliUnhlt5XxWBUyHXZ/TY/85c17f/60RuIsrdijLwo7oTeHl8dX8E4Qp/bVg3DCLkIKlCXYyXedwcVGu4H1kNVaGM6kDMrQOC7Hy/wC93QEtj6WFc4FCazsOiwCWRUMCh6gRFj4D8if3XjFolauqREiQ6y8y3shHqFITdlrYWRaNIFWey/L/PSHjsD7VACmZ3Si48D4gPe9CXvMYHrvVAVw/ISUaQ9tpkZ6dTkCh/q2xmy18cZQ3GRNk3/KQNdhFVA/OPbRRWxgiwG0jkVBL6xLN36IHUIsaq8PqBZQOC2ZcmmJNPxfWGQZWoOQpVRieikLLaieGKU0UwfaPa8VOYUvyNBFvP49ciNycFVqVeigS0YqaA6PMd+WD/WzHpu+bgCMN4sl1qNIWlUgrYZTQ/PUwWYkZxEzhrpr0V6Uex/oqV/gkbVMIqIjJy3SrpokzMXj4UAXz50ugqqZ9VqbwzgcwLwjGC+ZlyRmxCk9TlKq+Mja3Y53w7mw0CRtM1Ibo5dBAd0/yGakcelMheKfyjSZvW+JGv0sGzjS2BvnMzWaNqk0WuIjAUpHkWNN3jGrupOuRUMMVvAPy3XxS0o9wZVSkXkYvuc3+6CTI++vbycSUwqWIvFwxsbUPv9DmySg+ogo4PPIUXTWaDEHBkAogJpaGRbrN6t/66/6crSXPQwARGLzmOQieZBRkZpOWpDUgCMV9AsGdNydcHslscdBskbYGMxCXNIjrwWh7EeNnC2whCnYG5azU3XCSp2gGMtakdQAf234Wspp7fO9/AneKc52N17tEbiqDJr2EewfDF5ArUoEUT2OvjraaO+b3xYSWgxYn2owvmLirXDtwIv/GSImRemcGIFgUjHio6qRfYh4DiBE7P5n2snwjOJoK+NKDfWe2QThOkzo0efjNldfWl5Bk7nZCC2/zVPh1egCjAFYDOdtQJjMlXEEnKBK0McecNGKz41YHAocGOAhOC7JZZlFnycW4YAql9J2I6OPHgm+DiUrrzmj+FtmqjtsviM91bomWvTTmjBqDjelHdkqTofo+W46/qbYjqypVuElAlHzgfnryH/v4J9LW8TyNmfvxq7w7yqltUSK425aynDubk5B0zakhq8lPeZ9egh9eW9qAYzw3UfKBkxgkBlmWHNH876VvNRuD1SkkRB3n5/Bn0rTf7QfXA6Grnth2afY03TWpYyLauu9bkUfC2rB5+Lb3UVbKzfwSYWyEnst70BwWE0y0lBKOMOWlrMofBkTv/TAaprSRhSmXLrBKQiPeRqO0wdKeGLQMevMXjJFf7Gbb0kHhflFWrgubuNGErFlmd+uzlPO36wQQlMQ1Xwgz6brDyoGgcSwrE5vkSd6Pd1006VHK1NPTYP+nQ6c2BCvmPD1AlTqbCNqlzguSUn/7qQbxxZCwfm5M/J2sRkQTern4YQx13gqQt8GibdYY4ySphHwHtNPBlve3t8vr2jf/alf5UpSZggln2/528oGPuG/mAia0B2anuTSKmaYuW3ZSj5Iw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8a3c58c-397c-47d2-02de-08daa1c5e708 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:18.4131 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: L6YueR2vGlZMqwEBm42OlaHQxUwBElERQnzXLZK0Ux3OlPyKG4tNwPMOsiels/38b9HhrojFWMLkRYfvzvptGdesw2pnAYuy5+chmEQlbmk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5653 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: HrLz64eZLqyJ9oejoUT-yOf847wWotC2 X-Proofpoint-GUID: HrLz64eZLqyJ9oejoUT-yOf847wWotC2 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Allow SCSI execution callers to pass in a list of failures they want retried. Signed-off-by: Mike Christie --- drivers/scsi/scsi_lib.c | 1 + include/scsi/scsi_device.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 18cdcefc7f47..e1c19fea24e0 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -215,6 +215,7 @@ int __scsi_exec_req(struct scsi_exec_args *args) scmd->cmd_len = COMMAND_SIZE(args->cmd[0]); memcpy(scmd->cmnd, args->cmd, scmd->cmd_len); scmd->allowed = args->retries; + scmd->failures = args->failures; req->timeout = args->timeout; req->cmd_flags |= args->op_flags; req->rq_flags |= args->req_flags | RQF_QUIET; diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 44e5986b8ab0..d623d3e62f92 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -14,6 +14,7 @@ struct bsg_device; struct device; struct request_queue; struct scsi_cmnd; +struct scsi_failure; struct scsi_lun; struct scsi_sense_hdr; @@ -469,6 +470,7 @@ struct scsi_exec_args { blk_opf_t op_flags; /* flags for ->cmd_flags */ req_flags_t req_flags; /* flags for ->rq_flags */ int *resid; /* optional residual length */ + struct scsi_failure *failures; /* optional failures to retry */ }; extern int __scsi_exec_req(struct scsi_exec_args *args); From patchwork Thu Sep 29 02:53:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 610827 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6C32C32771 for ; Thu, 29 Sep 2022 02:56:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234820AbiI2C4p (ORCPT ); Wed, 28 Sep 2022 22:56:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234411AbiI2C4k (ORCPT ); Wed, 28 Sep 2022 22:56:40 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DE87DE0E6 for ; Wed, 28 Sep 2022 19:56:39 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28T1PmS0006378; Thu, 29 Sep 2022 02:54:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=nVadMB7A7ixKHwRjUGDO79r3xZ36lQpOksJp+ejaGp0=; b=bLJDOH+goeXOUIbpLsDDG6BDAuz9hqzrVHFz53AJ1NCwkcZlkRDbm98uQEK4gZu/AFEg IbMlQWjgO86Atym+YYgsbloqARLCGaueN3nzOxyNsUtAwja6oDIkerSTxUB3lZQeo/zW dmLRJRKJJrcyTVjXzQOspGriKGnXS516fdp/P+vNOSo7gfpYekszOim3HHe9+5uNdM/K jCLBc0ActQzmSoD1kXbYNEHFJtTGW5FdD5hFD0KKSl/c8DfeSpfzGr/gQe1ro+uY5XJA kcV7EQ9LN+S7eQk/VdSJ8VZTDxyB4O1JtM4IZy3dxO8J3kJw9A9I1dkekRAOGBKRe1bW lA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jst0ku9m7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:26 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28SM1ceb039455; Thu, 29 Sep 2022 02:54:25 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtprvtcqb-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=en3vVqdlt0UiAYWFGIs1AyX4IdmJoVTvxBxoq05UyBIygsjKG0p49UBfU6TKRZ0uXLun9G2+SvnoJXPQL009IQ0V5UEaZ+wtRgnOhAgOjCg36zWYroGcBmOP9BQ1RmrJECeUmMSSqAnKF1GQwZllDZGksAs10988LDNPQQbF2EQ8KCb7DgVUtgQzL/WGtIRWhbQQPF7P0STCkzFX4a2FGhLCmpSoxa9qE+7sdcezPkglbjcsxinXpQ6eApUvvQuHN9D/D7e5sMHqTeCgbAgcqWwRksPgg92NyFQBBgL4Ya+gz8VFE6O/f3J1GBjRQ+FTzKZHklvSBJ0LW0pZ6i1OZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nVadMB7A7ixKHwRjUGDO79r3xZ36lQpOksJp+ejaGp0=; b=VuAzjt6teE11tMic6GrsW7fTmecsKb0n2IQF5VApaAdAMhTzm9FOlQ9QU2uvq1GAL6QzzuG29fTsgrmBpIAGPg0LTVPutilRQzqEuC55X9t7g61v/LY51gqzVvgWcQyYluzB0DmcApD/RtLZ61SAb/uJRM8Y+yREXCq9UoUWui3pkaX9k+S2UqebFcZgK3k25vNATOoRg21blUpDLaRJP8AU1XcSpHxOqW/M70LU+/zKRgIIGEe8KjsVL3NOc6wYZMFkCF0O0+HVynzv5P5HjgpCGb+gZqIbfkbz+PFBZ0JQ0wlrhgynlJBFXzxyxfx4EXT6CZuF98gAMVaYZzr8ew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nVadMB7A7ixKHwRjUGDO79r3xZ36lQpOksJp+ejaGp0=; b=BNhrq06Q4tauXmZ6BeUs50lTpaI5bqdQyRPL3Q00llL+t8edpGig0Qk0TOlOB3nRuIr76XAUwUdOGJSA2A5UDW1mLl8DPTVvNj0BkuyBTwUs35QW4TuwznIr9WzCLltdxuOllUHhrdiT1Sf5ubz0xw27d74t3InQU3vdEvfkeRQ= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SN4PR10MB5653.namprd10.prod.outlook.com (2603:10b6:806:20c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.19; Thu, 29 Sep 2022 02:54:20 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:20 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 05/35] scsi: libata: Convert to scsi_exec_req Date: Wed, 28 Sep 2022 21:53:37 -0500 Message-Id: <20220929025407.119804-6-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0020.namprd20.prod.outlook.com (2603:10b6:610:58::30) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SN4PR10MB5653:EE_ X-MS-Office365-Filtering-Correlation-Id: 98eed89a-4dd2-4727-b633-08daa1c5e804 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pK4GL7ylZM9bMDuJpjRPuqsR+nm17N5Ba4MFxm9sUimZpsOUmh+WRigX8TOA/LfWK1QR2H9POEPz1WjrNu3+TLKrJisoXRKt5PFc4aVFLr7D9ec/aVx9sEg4cV0plcP698D55SjoYJIpDelytGNlnaQVI3HMD6XXU344pnmGXbEDMl/mIwVG/cJzguKlSPvngXbnQYxAEXBWf0regUzYxIOG1ejxg+D4U50zbzpqD6xYDNztX8HJD+IhJ4KZCRTl02ZiYL2am4uq7nL2BRAWbxthcsVEku2o2MUJKo2RPTAp6Je6MPA35I2X/xKwatKmsRxoG/RquzhWEZMI2RpNkBrHwAD57dyKtyg4ZEKQwUL1m9OkPjXY4ywTLGZ6RzpReCXQE12W/1NQS9VnGIdhOj8LyLiquZ2wAZNaMsBS1mREHoRsrVuGRurljrsSPz2PG+hF20LQq45eWCaxqRzWY96DpZfXU8eCDXrwUPHoe7FfTrxTu4sRYY7VjrE46MI7KtNS/dTismRqbwSRIRCHFaDeeuoo8mJLK60c7SacOrLtuUacHutWG4hNne60B4vclUWTDGeSHr++Y4LYIP2JEmzda/GIunCk/wi0hhWMvJj2Nfi7dyhE8n65lokTzWiDRz0JRx+ZJYVk/vWfmpMLtaAHB57RVMxoMrkiLJWQ7ZBVJoKuXfJ5FGl2dMeSn7/MaV/8h1+KKm5am+XE7Q+Fqw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199015)(66476007)(26005)(6512007)(1076003)(186003)(2616005)(36756003)(478600001)(6506007)(38100700002)(316002)(83380400001)(2906002)(6486002)(6666004)(107886003)(8936002)(5660300002)(66556008)(4326008)(8676002)(66946007)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: snmE4XbKT56wTp4Kpji6qQLzi/lwFPk5IxEZOO80rEoDfeesamaFvK1ZKfbeeknN6K5uIlbrBYKf03U7j2AyqmZ+tlx8nP/31q8SKe8BLpnRsu1k0+utijONgILLAbEuYo64Ik/4z2bbhzBbIIoDck96cNZcGpWkVIsY9snjTxbQe97ZXTUktQraiMogvMUX1y4TNTOUErqjonJyII76ya/ft0jiRiw2BWAvgqxx+BjSRq7hsil2DeIP3Mxq11zRAfH5HxY6uIo3i+QpqW7UMqvupPlq82CYHPbPpVy73061w/3lYJZqU1E3/FcQf+MbRszcUnbyU7/Rq639bzBcpehJU+okmXlHDmMWn98LP17tvgT14xTFafTINZag0qQMKaR9ALWONS73gMqFaO1BvhIP2FVF4CWVtSK9D8GJ2EJPG/3Ez0j3ZhogCc75PAwbNNxaWQmZAH79iP8zKBDxiB31vhMpTKWAc39F9ukOzOADtOvrO803Phekxs03Jf4/iNDWy7deGsF44us3WLk7ElA01GzFZ0Nq3BuCC2UmxzB8A3+yBzi5eZ9YY6Nq9ygrJDmexs9LhQkO1PyEDrU8n+CXBy+cYpeCyoQxir759xB8dtYUsPNkt7YxSkw4/ZnRIY7a0kw6XtwDvlFZRGlMRlIV3uxEteKO2E9+6B4SCKFFMqlGsz6hxKqa+uupP0GOBlh4Iow6oOZVYtIubA/O24mgUrBrGvWlYqeJfONZ34JijvoYBE7FFguMFqssqQVpR+bh9Y7JG287lzzNBZlvATfES2kprdBxXpKy2rzQGKpc2mEzcFPoKCPSkBxSJNaxAJbYs3d6QOUEjsV5RhUzggNOQs+bH5kLk3vwjk5XRXzarsTfkvwVM+K4muawVE7a03tbZ8urJB0qEu3E5LmjnE+W/Bw5Bxdv30IB91YDk+oNQr/sD4ulT/i29H25PNSgc/hC7SN5V+zrpX/fnhXNO50H4TH2hLqnTfQEnNxGMyN+oCxXEYXZfyLo5YdYf6hoP6qJXu0Sa21/jg5107HMP76mqemEEX7w3/CXvJunnBiTyPU9W5BUOFn+9kBFpIsNwHbJCe3onBYfTjzGBuTCrqAYUeNgTvVH89Ridk2JNyCXbfLFyzU8jmb9x7CZpicD7espDnjcPLpQg8e2YtJd6+QAOpdQdWhG0IdoCHlGufXpU4ouHOTppQB1F9218TFutWmNCL16ggDjSXepmdRwWQxD1j6+0Ommjw/s55faSwLVCdtM8B12/PbfO7CbWWEanKPl6CcZmDFjHebYK/nZNJoVdyES67Gp/XbBDEsprQiOUAhDdRRUgkI9+4zgm5PwNCj/8pE2Fp7d69KIG9HeRRGjxoRvhLQUKhlGnJzYIh0kpMp+BuazumHZgzn5ApFuZljAekellkzjsz5SdBkhe3cwjgSvM1It1dlefJSguGBUiE5HjL+bq/7o81t/u69OxbiWKidCLXTirAIR30yxx5HFM0qye8klsknnbVzoD2ZZRltGNHXn/NAph+OqD5eMXKLsX7B1o9jarOKtg0mDsdl85FD1wzS5yFGJH9X9WqdiflvQNiou76pPLaAjdyrpoNapYdjKK/KrNs0m2RDpNA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98eed89a-4dd2-4727-b633-08daa1c5e804 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:20.0692 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pddIXsws37PBITqp+NnYhNEoeYE9W54I7Otetj924Gd20xlSv2m6dODqcE7Rk12RXpsGaETDnLr5SkbS3u7nTRQIlpl82mvf+Z9TDR0+R4s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5653 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-GUID: Ai2zOxx2YyuGF7Vg_9RqIwoy_dZZBRKN X-Proofpoint-ORIG-GUID: Ai2zOxx2YyuGF7Vg_9RqIwoy_dZZBRKN Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is going to be removed. Convert libata to scsi_exec_req so we pass all args in a scsi_exec_args struct. Signed-off-by: Mike Christie --- drivers/ata/libata-scsi.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 29e2f55c6faa..484eed985db6 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -413,9 +413,17 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg) /* Good values for timeout and retries? Values below from scsi_ioctl_send_command() for default case... */ - cmd_result = scsi_execute(scsidev, scsi_cmd, data_dir, argbuf, argsize, - sensebuf, &sshdr, (10*HZ), 5, 0, 0, NULL); - + cmd_result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = scsidev, + .cmd = scsi_cmd, + .data_dir = data_dir, + .buf = argbuf, + .buf_len = argsize, + .sense = sensebuf, + .sense_len = sizeof(sensebuf), + .sshdr = &sshdr, + .timeout = 10 * HZ, + .retries = 5 })); if (cmd_result < 0) { rc = cmd_result; goto error; @@ -497,9 +505,15 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) /* Good values for timeout and retries? Values below from scsi_ioctl_send_command() for default case... */ - cmd_result = scsi_execute(scsidev, scsi_cmd, DMA_NONE, NULL, 0, - sensebuf, &sshdr, (10*HZ), 5, 0, 0, NULL); - + cmd_result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = scsidev, + .cmd = scsi_cmd, + .data_dir = DMA_NONE, + .sense = sensebuf, + .sense_len = sizeof(sensebuf), + .sshdr = &sshdr, + .timeout = 10 * HZ, + .retries = 5 })); if (cmd_result < 0) { rc = cmd_result; goto error; From patchwork Thu Sep 29 02:53:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 610835 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42F0EC04A95 for ; Thu, 29 Sep 2022 02:54:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234607AbiI2Cyj (ORCPT ); Wed, 28 Sep 2022 22:54:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234530AbiI2Cyg (ORCPT ); Wed, 28 Sep 2022 22:54:36 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 536EB2BFA for ; Wed, 28 Sep 2022 19:54:34 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNiSpv020738; Thu, 29 Sep 2022 02:54:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=Y2nXRbyZHFIomcFhaehA/yfxymAfJdFssTx2zwAbOnk=; b=H8BRxCH5GtxwPHLVjgeKPSJsi9n8hcTUYNpTmX3Du1KGkQNqP1gt/d7H2VwKx+GTCVXn XAMmGhldhYvM/Uim43iBpB9h9Zw/7Byc24cicv8O4d87+BvrZjBcNM3d89rQbKfvfZ9E 6TsIxp27ddF0g2uDlos0WHocEXrMtJaLMQUOyJpCyc2mo/JNX4uN0SG/JU0xL2/hyon7 SWm+ROeP7idFOjRGEB98RqjN8sKPoboHJ/ZpBJrdyLmP1vv8Ra1kq1wZb5TyFB2pnd0f IYszhLzjNcEdtXdSDGSkKi48MOI+SGXPlnrIhXaDFhuxkIJMMsyObZcZq8fUPfSIwBlg Qw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jst13kgar-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:27 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28SM1cec039455; Thu, 29 Sep 2022 02:54:26 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtprvtcqb-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KQ9sJ4/ozp+upyP3VR10/U+TPsMwCAkcshPrWqlK+buGgdsek2rqQkRNPDqCQlIOuFmTjJ8z1yi4S5u+BZvwn/+njg/bHulDk+H0dbsE2c+/Zl/Wg+YA0ojtp0MCCI5Ac2HLR7tVdJq9Z7NJftcOzr8UGLyDB5XVCb3EHUXWkeqg6A31ewr5jF4XaH4LcX8nTvXjsXafPlzCY1DLLqf0UH9wZcaPN50/QJx7Q5CcqB9PnApRQfQaj2y/5FUKQnhLtHKJOOEnV1P6Kj+ebeosLxuplP4Wp0791n/5pkz0A5yZK4EVCCQDWls4IPKa+urFDcdMWNY4IM++HuNuiu+1Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Y2nXRbyZHFIomcFhaehA/yfxymAfJdFssTx2zwAbOnk=; b=Gneao15KcSVIIkSAvevUIZkrSLX0VTSuG/oDhDixmZB8XBXTsKBVSNHKzecWI5CuBr+6g1xP4kW4/32vE2v94RJddjfMtN3yGlRr/mCbIuTV4AffuO3V+lM0MeFgSHRROqD5HwBN+w4uStCUTa2ZPaz9pOUI8QJJDJR4C+ho8zmgEbZvnlkNeBHU6Xt056IVToWOjvUX/ar5JwtYogLIKjNGtCkj+ZV3josQIj+zIBl8gtmD6eCC9kkFkMHVBwoTjpFY+XwWNTxXHBegLb0VZVqzfQ4XI51Lbhlp34QxQxrUCTrT6rnKA1eMA+o8oaIt2y8oEYG/g92oCoDrYCn9iw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y2nXRbyZHFIomcFhaehA/yfxymAfJdFssTx2zwAbOnk=; b=XgODTWWaJRyLjEjMRS8xVcrzICe15bTkPF8UTr1cLaOA+ZLHCeg0szmDNMvJMSVrcAUTE3uF3bp/EvitN3fU498Rr/Z61woMOVOOZw9cGrSIK7B2GBbVRGhEAE2FuClo/iI74xOCB8b5nHqMfFSPn5cbsZhXkMLZSE51b15J5mc= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SN4PR10MB5653.namprd10.prod.outlook.com (2603:10b6:806:20c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.19; Thu, 29 Sep 2022 02:54:21 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:21 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 06/35] hwmon: drivetemp: Convert to scsi_exec_req Date: Wed, 28 Sep 2022 21:53:38 -0500 Message-Id: <20220929025407.119804-7-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0013.namprd20.prod.outlook.com (2603:10b6:610:58::23) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SN4PR10MB5653:EE_ X-MS-Office365-Filtering-Correlation-Id: 69525f7f-bdfd-414d-7e02-08daa1c5e8f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Zwnv9h0007KjoBz3kb0cibVd5rkXXjjFEXJflq+TiYrA6wi+jX45XHhsiwlKwoE7roNObyS56ccvtwTJGccDM+dmseBfHkcJ6G8vO+/MX7eGXyYlp1saDigY0axuoZnAg13RY5n5rWEamqeGub/u/wqq4XF9aQhVl31QDAmVZuYWYRdKky6NzmqIC5LYpDmFB8hH9p7lN/mdMyQg0QGAdDTFXfKxmXecLpUXtvDEN6hoelFf+DcKqWyWqFv0XSRIbJS7JPGqW41JjgtARK1zWeCr0ZTRQ1wLzYVBAEqOKmd14Ge/X5BoYfGXGaVf/wXxG6XfLqBGWlhM9maKk4Tw180D/674r/xUx5Q4RtGljSXrbPfeGpjh0hk9Nnv9oaKX1f513KGaSGL276s0fpZplCtCCOX77C01Eq5V0rvxnw84vptgwH+S9LvEfw9vuPnRzS2pHboMUrXMtdtoIDoa43CgpPESeBJYs23UyU4zohOGtyxmXWxjwjs4TWdLzkzKQ+Ogz16MMMSggIJPqw+ZX87xywsc5kHhd8gaUgZYU78bTTwdeoO3vo/c73BgVnHU4n915K6uxFdSpUmiQz2HAg42cX1aLaOK9BA/vJuiAhpzRGqsDJMnhR4GHF3Y8LSIRr3TJqIQVygSyO+kvP9r1Jb6YyiKV7OVup5/kyf7OJg2ywECD44nPKbKrtAq1OXqQYlGWxtychu9QDebKuer+g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199015)(66476007)(26005)(6512007)(1076003)(186003)(2616005)(36756003)(478600001)(6506007)(38100700002)(316002)(83380400001)(2906002)(6486002)(6666004)(107886003)(8936002)(5660300002)(66556008)(4326008)(8676002)(66946007)(4744005)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NK8Pko6zsfOJb4YEbfSNU5msy5xQJl2+AL63fXm+D9hXn4xBUcpFpWQHPpO+MYoF7mvPEgSddVEHGLMpnUxUBEwpROwrj2/V+oFDuBlcaI8kXJJ2S/HisbnP7a/k+53C59VdB9GItpq3b7RtXxCK1juKuUmnmAXMzQXWyB9S576eBZZ79xW6i+TlvAIQVaeTXsEO3ILniy+X5UfkTFtVbLSN1ucA+w0+ZjXM07dGAqUg+enpX+wdEmLBs56MnlWcpphJ+Uzdv2wfHwnrUmPagAKHLnoptlPUDb1kiuhrN87j3BYKQ+fnU9CxTVFugsQQaKV5EWVFxIgPPZAoB2ixlZitZaSkX6hQMLC/E7lg/2mbmn6DTB9qNa/nn/5Du7DiB7DfVm1UJT13xlC6YsJsfjsZYwSBZ5q3/nQ0cz0vtd5/MY1Tmn0c2iklLZHFdYW+SWzmdNAuqaLjiFkk+Ai5KjK9FhY1oPEAnJWmrNG7uWCbyn3d0DYJM9jHQyA7JbN/e5omKI6p2d1MHvLf12ptAwWA5RvvhV3QY+01Dw6k2U5eFRwdIUZ3VSXHT2I+RRDIf2+zZL91oPjO/e7D2uLs8MrFnoi9cqRlMMhzj2voenl8c27CmhFwox1D31RPOoNTm0bTvTLg7iEDoePYVHbLOX/TOM/SWHsmZisN/+P8VwXeXE8XcyDzFli8Nhsdbu1rrT09E5D/V60xUWX5mP8UAw+TgIT6Rzeo7Bs6z2+JFCZJFDPpgnuPJzaK2oeBrMlIjWpAgdrUku8jjJbf/rUlL6rJFWfrEVw5SQjHwA+Jn0cUk2zkrrvbv/nfuzuVzh/UO61QzW6UGurBTHDimRTC7s/Sb4lKb0wfrCuDUAyQHv/AO+g+3vX84I3d6ThrfdZE/fCOxAkB8eLAvonQZi/7keik31uzmV7sAysupUP+1HrLVps6S63zpDO9p8WsnwM4ekzPrUJtIRtSEZgcmX710OsXOPTo/nQKqgTTfQbE8LvFlmqBbO9jm8YpUEVikT5461jWTvHJC946HnN9/j/6elE9LMYbkKITlRbVWb6HC0oIy1YYDt1voYO/OyQoFibFWU3MC5wlBYFFo1LUCtxeOWtjHmG2yNpIklf5t74B4PRn1/FIURsw6Ug0cf/fVWncOyE+DIXV17+qvPzMbkocQxupbTxnIcPhgTLQwo90EFCHOGfpIiIkByPaCWyDrIKQS94ZFLCE2VkLXVb01pO7X2tjQgW+3Hwrtqo8WJEvI8L6gj6mmkYA+ecA+uIETdpvtbnXAp0J88PS7H9Fhms897JrjNzxId3vYGYomUQ4avWbtiWPzsjPh54OJbBgLhEY6pr2blYm+G5sDgs2+Lex1jlScsFbLCLgu7SiNNc2OsuwE3aVBoQZWrV29XU0zj4zqukqhwKm9x47xT2iAP1wWOBjXkGl/SZeFpFHUKsDxgwVyc9eHtROwFvIoPhetZLIOXdNZFoZEDDL0kizKFNcQaCjqakhJ7wS/stC+HMhHupa+HWyiUzkMpM2KRUsQWbSxh+TJfDXpWhZE+I2KzT0bl2Oyv5tM7f+JFSVPw3KJQltEL9YMuE1pXcb5hEBBYMLZqjC3kcr6bmk9T+PVRRGSg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 69525f7f-bdfd-414d-7e02-08daa1c5e8f5 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:21.8034 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XYi3+efpJ2l4t9qSBGSoJDpdw5VF+0eEqBi2+/mLFp0C00oXciqEo1Hi87JO+AZ0EykPRcJqCsvdI6mEJ9vOxdDKTzvZK7pt8qNeJodjP8g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5653 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: h1cUpdjSleyL5iwC_vbRBvBOsuWAqEXu X-Proofpoint-GUID: h1cUpdjSleyL5iwC_vbRBvBOsuWAqEXu Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is going to be removed. Convert to scsi_exec_req so we pass all args in a scsi_exec_args struct. Signed-off-by: Mike Christie --- drivers/hwmon/drivetemp.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/hwmon/drivetemp.c b/drivers/hwmon/drivetemp.c index 5bac2b0fc7bb..ec208cac9c7f 100644 --- a/drivers/hwmon/drivetemp.c +++ b/drivers/hwmon/drivetemp.c @@ -192,9 +192,14 @@ static int drivetemp_scsi_command(struct drivetemp_data *st, scsi_cmd[12] = lba_high; scsi_cmd[14] = ata_command; - return scsi_execute_req(st->sdev, scsi_cmd, data_dir, - st->smartdata, ATA_SECT_SIZE, NULL, HZ, 5, - NULL); + return scsi_exec_req(((struct scsi_exec_args) { + .sdev = st->sdev, + .cmd = scsi_cmd, + .data_dir = data_dir, + .buf = st->smartdata, + .buf_len = ATA_SECT_SIZE, + .timeout = HZ, + .retries = 5 })); } static int drivetemp_ata_command(struct drivetemp_data *st, u8 feature, From patchwork Thu Sep 29 02:53:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612201 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 307DCC32771 for ; Thu, 29 Sep 2022 02:54:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234530AbiI2Cyk (ORCPT ); Wed, 28 Sep 2022 22:54:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234543AbiI2Cyg (ORCPT ); Wed, 28 Sep 2022 22:54:36 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 539BF5F44 for ; Wed, 28 Sep 2022 19:54:35 -0700 (PDT) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNiJkQ023234; Thu, 29 Sep 2022 02:54:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=1PvwM47rb6P7g6jK7bWRImH0d68+Etl1rKiEAPDOP6U=; b=sglnu/N8WOnSTBedItrpBurMVKkZO1BG9WQMUMwf7t0j8m+5nnK9j1isgM6J/dOgyeX+ Vg+K/Hnm7PQ9TIou/8foFxvGcys2yr+M0lX8LrZwfd1PWr82rdmOwDYa4icos1CS/y2q RZxSkmwlYIrQQrDHPHFKQBTJ8O6N6yqja8AyqWTJnM2rcKLfIcQTOqRPk2B6dsPB6lM7 FraVffy2F7LXfuUDH/StXh1ePO1divvKwZm6Gy4zMlAW68ZwuW9wKNVl4lTnQdmGLT2D lgihGlyaY26QUVnSaZp6BDDsVfLXVc0uHaB1HQRtB2tUYcoIw1turiJeGb8jKIj5qhVw DQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jsstpu2wu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:27 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28SM1ced039455; Thu, 29 Sep 2022 02:54:26 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtprvtcqb-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zix/JSUH6fWey6gQbqjjrndFsiqfSeMd8QBgLYOtuQMjvfJrafkT2lPa8qKudVSTCgZgFNvNksJZFXPOLdDJWPFnRkxgT6VPNIVol0jXaRNpRBca99avOl+2M7+/wdM8ZyhrpN75/Dn+4qous+y2iBa5SMNptAhImPc8vT1pGA+dyS1bNU8CHiuMPoQiLlwWc/7EfV4nUNkF0dMerm/LZVK9JOU48VQClXiKPn9y0AX2Z+bCREzN6puSyCeriCZB4dTY/X7FKNzvUuJ5Rc12GJNxSj88hvfzP2ljewnp3IoLQwHryGq82Gyr+OSAUWJgHiR5vGvX2p/JtrgivYIpQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1PvwM47rb6P7g6jK7bWRImH0d68+Etl1rKiEAPDOP6U=; b=I/80LHgO1rybI9NFb/hd/Wjz+LVS+AJV0JpN0GNH9uDezjINiOqUKazH4X4idghc+tH9PDPkjrWzDOx6VfqYXjQ2MmBcciqmLve/vJzLD/iA3iqfRc6zMmllJXS+OmERkdSCwXKocIjSQ0MjVcBWQahSxRpKYmlsn5Gtub4q2r4sX2igSbN+ZE+5AhQnDoWmG1QNOTTLSmBVJwjfREVD8nYGoKbUx2M2t0KKv2qZbLeEU/1cjtJJpN3xC6G8FG8UVrrfGXjJRpVCYjeJKpdfVd76LF/Lhjdmzp88XmoqDaWK7SA9q4wqNBYuPFv5kOLTGIrijm+Moz3VhZVVeZ13tw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1PvwM47rb6P7g6jK7bWRImH0d68+Etl1rKiEAPDOP6U=; b=UxDm/g6a1GYZ1JpPZpiGSPbeFrk/EL51JpBQqkXzv4vW/kv29Dzoi4hDE2S6Ylm7GvmK+xejufg2qZE8B72bnOkqAHJkWGJwPR/pYYt2bHCo8Rt1L4kUPAGTjSoH8RDCa9Bf6YeKeMSzqSgXpsV6uYb6WSbzaBv+CqeRxmtDI9o= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SN4PR10MB5653.namprd10.prod.outlook.com (2603:10b6:806:20c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.19; Thu, 29 Sep 2022 02:54:23 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:23 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 07/35] scsi: ch: Convert to scsi_exec_req Date: Wed, 28 Sep 2022 21:53:39 -0500 Message-Id: <20220929025407.119804-8-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR08CA0002.namprd08.prod.outlook.com (2603:10b6:610:5a::12) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SN4PR10MB5653:EE_ X-MS-Office365-Filtering-Correlation-Id: 8caacf32-3bc8-41b9-bcb4-08daa1c5e9dc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PKNSpFthj5/UATM2zGutixLozqFmruwmKOV3PZzLHc2c+AvGHQ6+s/525sBqbOjRsYDjY1ZPYx1hMgF0NI+I6/a+mPcfuwkUaBcwYwEP7Ll7w1ffTPlsuUUpness2VWSa9DHVFx1htGgWpCswJMXIsDAnojkpLzQmdvb79WHn7Kct9TYCTrA3Z3Gb9uatpcr34ClO9LFut3kFRwk5VVB//5ZDRaAxsH1d2zH4nXmjvnf1cTI8KkMDv6b/GbJQRSkA7Dtbtwvz8+15IoHdsr2yBx0RJfgcwbWxh4K51GzxyC6/H0l2bggwtIG57JgYf3SLo/dkyCHUw16MQZg/BjQ8dVUczl9Qt6TKZcDwfIjZNxnLyJaZ8kroPdVDQ3Dg5uO/POP4jVng5CiBNrE0nOXAkThlYRH6cVeRl4nc/s/X9pcazmb0otjmuzDX2tapPyjfn0/cO4ZbCYl7H+trs1W3mN5Vqg/ws0LTGJMHYuRrxfjKbhzo/4ozESnoQPtWYsiQ0r1zBeEpc+TKbx8sqRQa9qz/ym2vs54camcrn4alUmP5Kjjdt8IJuCT31rIgBQqRAZT9VTWE80X/pTgpnSKipGfyvKgP7c1fjzD3pwmPTolgEqdelrXT9wk6MCHMjAkFjdWpXeZruoEHBwbJyczSFpWEIQ6CmMd0pj5TbR+EsVXD7xIJ+30qlCuzs+SIQ/6hxksN0tKTakEnNewKEI42w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199015)(66476007)(26005)(6512007)(1076003)(186003)(2616005)(36756003)(478600001)(6506007)(38100700002)(316002)(83380400001)(2906002)(6486002)(6666004)(107886003)(8936002)(5660300002)(66556008)(4326008)(8676002)(66946007)(4744005)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LbLnmDkkT5QE+9dxspm7ma+kH3A3N+cxhvLt+8+3UQ+jANR1q0DOWeJVv+plQA+ZVoH3OrkGBgCcLuTASrFb2LIVtOb/uEkSTa06NpcY4Do67zqg5DTCfo8ruB7D3aGSeCp+RZ029lTNdibQCgnVj7pQCSUIMi13nvY4/hlVal5hFDam8MM5SQfo0VJVoLA4byVmcsednbdIrIgctKWPOSfvXCuQ6dPLESOm15JX73qw4NfH7lEhX4g7r1dUuFi388ENVg0S28mELjATW3IlWJsZKQX7U5OiJjTN7oeDZ5uKJl5w2w2cNvc4JA2UwCr8VejgqwhF+2drfn3fcDc2RH/2eumsM4tSFEE6eQtsPtn6xLbs8KejUr6RwHPnGuzLUpqzA2UGLo0vRoeqr9T8Wuu75U8OBA1v4D6JbFXyPLluH15p+aNBU85eJbTk5qaqsRHVJORxgDdeMtMTu1iY1lCV9pvDWDBFGnBEDBJfjOwlv0KmBlaLpJS9m4Zb/jZ77jGt9G1HW5k561oOIjYzCYM613c6FIVI3pSWYiMJD3Z55Fl5txzC2qqtshh+ebYABKaVbeCd4KEkA8QgwX1mpVqqTyQbElA8zQFEeKgLb+UAWK/n1kd/hK85QO7JjMd34s1Hef3pw2utUTa2RekgvgDjXDc7IF3vi//JOXyNLkvsBHvVLqQOlI3HgOdlQYGCg6N3aqgTdgTmU/buh6lvKGcHcTZsMEpKXFEFrMkO1BKfAcjuzrVHapz+qRGE4JY19hBUIfpPoobdxfPYnS+ip05xdpDIp7XEt/KJalPK8eLBHHWaBPdA5yNCVZNWc9IL+4z7E0Xp4XpGiOiKyBOTkj08CCcZMHW3MRI62BFC9U4eCRNXFp1djeg5mILs4xCNFBILnJA/4WB0cmgsvzL0IgkowTjzYd5zpaugyB9sY3pALaz7qlycUCL4nTwd3MdEybyCW1SEq3f0Ux6hFZq/KZC5cSSsU70gyXfZY/T8SBpGtEHQr113EF0BUwlDPQpT56ivrCiy67mytaMX5yb7kl/Y+OP9ctRVVvTdtPV1s4SnEsOw6wIuGYfapG4zCOnRk5V/wUYspW8UYwxpqwwFTg9YFe0xZJJzY3Y5YB3G9VoGvZaHWSv78DGl9tbwGlqst6zLN4I/vFQKEEoGev1PGFc1GQZdsz86hIAXMbONVqWK1iRTk07IToZmqyfjXZ/feBMV2Msx4QtTrMHRuhM+mnYM4aW3qyimu+tTpFQmbUE1KRFPpXAB97WA4HljV6kSLM8xKWQe1CWK5OwszqbSh5SuUwxfYtLFhEx0pcvB1jUJWdIc3fSXMyyjrFEX0IwK8li3TZdUszz3nmeoUmjbfEmTUou3RYOCur3wAmXOOR9W0tcsPZAz80UQV0pCMxqBpewjv4dWjhkGoj9yHQWj2y78ONOTIy+sQATvKxB/Fon6Zjf+mJP07EwjVnp5wYnZVLyCyURk89rn/88+VmpNePVLsS9kANQdEU3Q5iAYVCIUJfZcZMsHZ4WglPZSYs8uaKUQufMLPIwGNUiq3ZcshhTOH5YELzp9H8SWYbGI8fpKysJ7YKzpthML3BcZVxj7DaIGfQmIgQlE/e4zxD8DMw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8caacf32-3bc8-41b9-bcb4-08daa1c5e9dc X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:23.1470 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Qebi9SKog9OLwf7POGY8Lpf4lV6z2YRZXLBUAFRYPyHDz9UTdir36Hr0uql2La52zdYVGF4ZiL7Ia16wniXLsW6KNFPjbnB9TwwdorLo7EQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5653 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: pbDt7g8QC3ASmLlrpGFxkKeK6aCQFouE X-Proofpoint-GUID: pbDt7g8QC3ASmLlrpGFxkKeK6aCQFouE Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is going to be removed. Convert to scsi_exec_req so we pass all args in a scsi_exec_args struct. Signed-off-by: Mike Christie --- drivers/scsi/ch.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index 7ab29eaec6f3..511df7a64a74 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c @@ -195,9 +195,15 @@ ch_do_scsi(scsi_changer *ch, unsigned char *cmd, int cmd_len, retry: errno = 0; - result = scsi_execute_req(ch->device, cmd, direction, buffer, - buflength, &sshdr, timeout * HZ, - MAX_RETRIES, NULL); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = ch->device, + .cmd = cmd, + .data_dir = direction, + .buf = buffer, + .buf_len = buflength, + .sshdr = &sshdr, + .timeout = timeout * HZ, + .retries = MAX_RETRIES })); if (result < 0) return result; if (scsi_sense_valid(&sshdr)) { From patchwork Thu Sep 29 02:53:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612197 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E6C3C04A95 for ; Thu, 29 Sep 2022 02:55:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234836AbiI2Czk (ORCPT ); Wed, 28 Sep 2022 22:55:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234859AbiI2CzL (ORCPT ); Wed, 28 Sep 2022 22:55:11 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 450124D156 for ; Wed, 28 Sep 2022 19:55:07 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNif6Y020801; Thu, 29 Sep 2022 02:54:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=IW0dMrPTpp6b6jKffX1ZsG6XTvsN4xd7DFp4ZVSxR7w=; b=ftBFJyTzSX3tHQ32ZOhhYAn9tYM+lQgu8SNdLrke+o9hHeKhb31RwtMqX0lVnSP6fhiV VCdDg6pxVv77+yx78sUZQrF7dYg9kqGvVQBpO0912fqptDigUwlXbyucd/fjI3Fwd0CY bILAWthj/gOCjvr/i11EsqCBzPiw4SJyvNzEFo1UdiTnAQ6dPgoaY4t76WX48sFtraQb 0ASmj0YGqTPYGwF32wYgq1yUA7KEP33UKSjrWAePsBkzH+2SSeJE9L3OTRCoAAPulK9b MfT7BloTO0s/M33qIO18PdDVT0WIJJ1o8mHtPEKH7I7/Rwo/Yn7ZGXQCbttdYlIrfFgX WQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jst13kgas-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:28 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28SM1cee039455; Thu, 29 Sep 2022 02:54:27 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtprvtcqb-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j+1Xq/SGyotlOr9m0Dv43fPtsvl4f/i6g1v35QYNMih5t4z7vTOIJcRINnIp/WmWMGASiSRoXfINb+eJQO7gfBSeuyPlCJbLcFPvYQg+lMh5QBLXqSL/EW2I/QoasT7gqYUAQS6vBMuJ5CJLhHWOZP7Y1Ht0068Wdoa1GuYueGgtHp1mkngHAZNqv38wN71sgjAVwiN33DLFQevg4gVrLtocHCSjnie3inPauF1LQQJLfd3o0/QOVjJzT1CseN2btixuKPIQR+pjMf6oUXx04JV9l0n2Sh9tHuOfQp/w9K5SzEvBSljO0jdB/sWktCnPpMlkZ193kQo5injxmsM9/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IW0dMrPTpp6b6jKffX1ZsG6XTvsN4xd7DFp4ZVSxR7w=; b=K+XD6QGnVTqOUyveGjIA7BkIyIpPFF9IL863MF3jLEb9GGAgkCozn2FreswvoN2HuR5i8N+Z9ga+Hgke940g/j8f2BUE9eTvhYswkhLTodjs+DCIvIjhivC8PspWI+AumvJ+0I45bZPQSLptn9rGi5bAWYhnVeBbP3/FOwiOMtYIAmxL+CgpGt9tnv9cJ0PkpVpxWWBkRMmn3UwyHe8iB0BrLloJ6SCcVybQFKZGtqu1LaUnMLY6QJsWtH+2gmfJ+LmEroxy9b9t1F/OgP21wubXO1j3hjk0BnAHP/w0yEggTihz4ncsRUpUihLWunOhHw19RRYinC/TiqsdtvRAbg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IW0dMrPTpp6b6jKffX1ZsG6XTvsN4xd7DFp4ZVSxR7w=; b=AYGNHBNETpbyBcJKZ3mrdC/bz8Qp2WF8mraGOQenDn6ecadJPVTdpmJff9eMch4zzFElke+Yqp9V/L+GqzYKXvSy7zHkN5RriPRWKvqftgpjxoC8/+6BWtRyqJ74+0hfRFx9/E5KzTNyYvGChTtVzR1QtsjDpdgbHe4QHjf1WlA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SN4PR10MB5653.namprd10.prod.outlook.com (2603:10b6:806:20c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.19; Thu, 29 Sep 2022 02:54:24 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:24 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 08/35] scsi: scsi_dh: Convert to scsi_exec_req Date: Wed, 28 Sep 2022 21:53:40 -0500 Message-Id: <20220929025407.119804-9-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR11CA0017.namprd11.prod.outlook.com (2603:10b6:610:54::27) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SN4PR10MB5653:EE_ X-MS-Office365-Filtering-Correlation-Id: 827032b9-bf13-450e-5dab-08daa1c5eac6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F+pfofrDAaaTrB+0rgRL/pRpRv0R3UMDb78JMErh31wKMKEXn15oPm09+K47j9Z80aF9bbtZuu4krYbXGNECIjhIU+OXVpdggoEhGU3Yi7JVbmMvJ4B8u3MRisB70SfvgEOhWEEwJqTfQumhv0StDXC4ZzWhgy/452hZ1sZXbVgwNbhR0rfxLZ0JKQZme7EQ0C+sGafaNNmcNzFgFldd1jP05e6QPXlCD01k2FCXin4m4nrdFIUzN2U967df/9NQtpmdj7fSyVX0bx5tsA/Gn94g/9q3mjDEelLcIexPOfTET6iHBUmyfbkAmjB3uYhUtQdltIgvLfOyPig5KsXqqHC+0uM2G5lG+qK1d4nbl0/n2nooG636ZSrsneUuGcq0fY3kp1NbCY5JoLNExKKHCCoSp3eRO4x/kPhMaMLAS0RRQu4AKe3Dgj2zQNGDuQFl3J9y4k3ItvZ9Fa7C814HBwL/qpWECT0Tu/lV3W+xS99BeShT5Dg8jhCYptL7eZVXjFnELdg942DFEZJ7f0ZHL5zwBVLLjS/UoPN2Ux3/QQVklkPX/+41KXS/ExUcE4WJzs7oEojvU2g5jXcqGacXX7RU63QwoRpOfNeJxICrS172RXoGDFWIb+qwD3DXc61aoHbSHqRTgCfYwo7A9SrkwzLCHC9wX/vsOLHemT7/7BJSYZdLmUPkzxIRFf+IrlE/WtFl0tIlOjTRL6dR4PXVKw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199015)(66476007)(26005)(6512007)(1076003)(186003)(2616005)(36756003)(478600001)(6506007)(38100700002)(316002)(83380400001)(2906002)(6486002)(6666004)(107886003)(8936002)(5660300002)(66556008)(4326008)(8676002)(66946007)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oq3Iy1YVbaTkIhf9vwYK/b0WCR6/XECTUfAobwy+YvU58mUB0z+G9SQBXadwPejhZ9mzBGqFNNo6lJKZc9VhTl2lCxMsLBl+OExAdWwCXbXh+Cas260DvNmnkCQrhpT3E/HAMZFUVl8FPoduOm60q+eIImDA4/iMVY0/qBXxh3H9ndosC+TFR6pNiBfIhqzWQ3Vl8VUjGngWZ9tOrC1iSDlCHmgGdjhPlB77gkZtIEf+OE6vwqqb/PCm1oMX+It7QAyD1AZPgaotHXPuab76jZpD+w126NVpdF2Hw3lnWvxg9FUiIt+xM/rvNoioX2laZ3Kw3yp7z+fi8tST5kh4UOys7hrJYMCbEBVCa8RxVCDe710TVzBIs0qqwINuxieikF2SzbO5zgbhaU6AtKsSD2ud80uo0VZOgwR9wjUYCxvazkU8GJmxntJM65jecuFMioVlFpnewPmWqSVcQ5TAkW0X3LVPdnXxZ4MLP5tBHGTwbSPGp8M6igRUVudT6pcu1JUUBjoCWt0Xi7kZQuiG3IdEBe3OS/IDad1TDqbxlGhJn1V+rDnovxnVgkRsc/bRPFLtg5yxnPOaExkAzY1vltDKEU53+vCAOGybfIjFz7WkTt4OBo+n3xMldxIf88cRPEXWWUKNYK3LFLIkL7PrErsDe5bmBoGi71LrDKAU0wRs+R2uUZ4O6jupsvWhyECmnVrx53pZQDfTdYW92Jp0kKm4ENqRgzJgr0BGSm70D8MLahFjwMjy4c2YVQ2v7xNAgw6xcsSnNSi0FacFfVEM3Exy3dJZux1mDGxKj3Yd76lXqEwLN66yUyKW4RYLMEAwer0DJsfG6fWgaJ4BzSVuhUU7n6OZUDRED2VDJ7ULzPjsWhxUj6bonu3fTf+wwnHpsnCgbjPtQB/tMC1U50dnFVKINl/Q4w5pN1Oe/57Gwzzoh1KWLxbksrD0AU4YsgEPShSt6LSU4kIHTrDQz4ieJcpHPd/6fMC6UsDwzzI6mWHvEOAh7SMM8FvdUnMa757C8IEPzOFjSVBO94JbZrSYlNlpAXjpjf2MtM/qElgijmnl50QmB6ftQlyTaomAmTbnj/q99CV+r9DZUQMmVTMdcQtVvwoJt/qSICol4rqTJHqNnri/g2zDBfLqJ04uQ8eoLmb1zeye52OgyYBcaWDWItrYgW5AO74Iy1laDM6yIfXXRzWABYAFSJtfZ0WQui0Jy7ajeZ8JlmFv3YodJIPLSgx8VA+J4sXpilcgOEOjXDwSJjaQQxv/aQdGdgXaI5ntc5mi7pFz/3b5EPtBs9DuXIoRtVGQhFkTSUUPQ0MpYzPAPK3GAHXIeSerVnUAfh761xR3utsrQ99KyD8UIfcuYcz6MDd3QmgOUR4uUVPplB1ztafPDoKRh0xugRmPg1IuT20R6T9Nj1m0nj2VL/MUr5bJsw0R+XXOBBhNrL8WpiwYJinftlQTlvF2RCMWf+mtvtD2u9E3gGQn6ScbjDgHCPMjo8jJMyaP4IXR8WqqGoSGqOTahUQiKw89fxMs1VtUnzqPQbo14RO0Raxh477ei4T/yDbbNAvzB8qQOQ3nYuAj1kMuEJ1RYH8WpOo4lmgrOJBXoutbT12prYYWk/Qx/g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 827032b9-bf13-450e-5dab-08daa1c5eac6 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:24.7094 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uFVHE8hgHrLGvVMigw3SIcWdOkO3GTXtdgl3bay50+DRQ5Sll5utYquvaGMEmb1BgBd12N8RCGAKwXAU+Xgf+W3rNtORIeBULagqU7nCqGA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5653 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: 10WqbC6QKhqDbFQo3xEVIG5g2XPGFdgq X-Proofpoint-GUID: 10WqbC6QKhqDbFQo3xEVIG5g2XPGFdgq Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is going to be removed. Convert to scsi_exec_req so we pass all args in a scsi_exec_args struct. Signed-off-by: Mike Christie --- drivers/scsi/device_handler/scsi_dh_alua.c | 26 ++++++++++++++++----- drivers/scsi/device_handler/scsi_dh_emc.c | 13 ++++++++--- drivers/scsi/device_handler/scsi_dh_hp_sw.c | 20 ++++++++++++---- drivers/scsi/device_handler/scsi_dh_rdac.c | 15 +++++++++--- 4 files changed, 58 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c index 610a51538f03..e4825da21d05 100644 --- a/drivers/scsi/device_handler/scsi_dh_alua.c +++ b/drivers/scsi/device_handler/scsi_dh_alua.c @@ -139,9 +139,16 @@ static int submit_rtpg(struct scsi_device *sdev, unsigned char *buff, cdb[1] = MI_REPORT_TARGET_PGS; put_unaligned_be32(bufflen, &cdb[6]); - return scsi_execute(sdev, cdb, DMA_FROM_DEVICE, buff, bufflen, NULL, - sshdr, ALUA_FAILOVER_TIMEOUT * HZ, - ALUA_FAILOVER_RETRIES, req_flags, 0, NULL); + return scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cdb, + .data_dir = DMA_FROM_DEVICE, + .buf = buff, + .buf_len = bufflen, + .sshdr = sshdr, + .timeout = ALUA_FAILOVER_TIMEOUT * HZ, + .retries = ALUA_FAILOVER_RETRIES, + .op_flags = req_flags })); } /* @@ -171,9 +178,16 @@ static int submit_stpg(struct scsi_device *sdev, int group_id, cdb[1] = MO_SET_TARGET_PGS; put_unaligned_be32(stpg_len, &cdb[6]); - return scsi_execute(sdev, cdb, DMA_TO_DEVICE, stpg_data, stpg_len, NULL, - sshdr, ALUA_FAILOVER_TIMEOUT * HZ, - ALUA_FAILOVER_RETRIES, req_flags, 0, NULL); + return scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cdb, + .data_dir = DMA_TO_DEVICE, + .buf = stpg_data, + .buf_len = stpg_len, + .sshdr = sshdr, + .timeout = ALUA_FAILOVER_TIMEOUT * HZ, + .retries = ALUA_FAILOVER_RETRIES, + .op_flags = req_flags })); } static struct alua_port_group *alua_find_get_pg(char *id_str, size_t id_size, diff --git a/drivers/scsi/device_handler/scsi_dh_emc.c b/drivers/scsi/device_handler/scsi_dh_emc.c index 2e21ab447873..0ad6163dc426 100644 --- a/drivers/scsi/device_handler/scsi_dh_emc.c +++ b/drivers/scsi/device_handler/scsi_dh_emc.c @@ -263,9 +263,16 @@ static int send_trespass_cmd(struct scsi_device *sdev, BUG_ON((len > CLARIION_BUFFER_SIZE)); memcpy(csdev->buffer, page22, len); - err = scsi_execute(sdev, cdb, DMA_TO_DEVICE, csdev->buffer, len, NULL, - &sshdr, CLARIION_TIMEOUT * HZ, CLARIION_RETRIES, - req_flags, 0, NULL); + err = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cdb, + .data_dir = DMA_TO_DEVICE, + .buf = csdev->buffer, + .buf_len = len, + .sshdr = &sshdr, + .timeout = CLARIION_TIMEOUT * HZ, + .retries = CLARIION_RETRIES, + .op_flags = req_flags })); if (err) { if (scsi_sense_valid(&sshdr)) res = trespass_endio(sdev, &sshdr); diff --git a/drivers/scsi/device_handler/scsi_dh_hp_sw.c b/drivers/scsi/device_handler/scsi_dh_hp_sw.c index 0d2cfa60aa06..adcbe3b883b7 100644 --- a/drivers/scsi/device_handler/scsi_dh_hp_sw.c +++ b/drivers/scsi/device_handler/scsi_dh_hp_sw.c @@ -87,8 +87,14 @@ static int hp_sw_tur(struct scsi_device *sdev, struct hp_sw_dh_data *h) REQ_FAILFAST_DRIVER; retry: - res = scsi_execute(sdev, cmd, DMA_NONE, NULL, 0, NULL, &sshdr, - HP_SW_TIMEOUT, HP_SW_RETRIES, req_flags, 0, NULL); + res = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = DMA_NONE, + .sshdr = &sshdr, + .timeout = HP_SW_TIMEOUT, + .retries = HP_SW_RETRIES, + .op_flags = req_flags })); if (res) { if (scsi_sense_valid(&sshdr)) ret = tur_done(sdev, h, &sshdr); @@ -125,8 +131,14 @@ static int hp_sw_start_stop(struct hp_sw_dh_data *h) REQ_FAILFAST_DRIVER; retry: - res = scsi_execute(sdev, cmd, DMA_NONE, NULL, 0, NULL, &sshdr, - HP_SW_TIMEOUT, HP_SW_RETRIES, req_flags, 0, NULL); + res = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = DMA_NONE, + .sshdr = &sshdr, + .timeout = HP_SW_TIMEOUT, + .retries = HP_SW_RETRIES, + .op_flags = req_flags })); if (res) { if (!scsi_sense_valid(&sshdr)) { sdev_printk(KERN_WARNING, sdev, diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c index bf8754741f85..c4d1830512ca 100644 --- a/drivers/scsi/device_handler/scsi_dh_rdac.c +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c @@ -538,6 +538,7 @@ static void send_mode_select(struct work_struct *work) unsigned int data_size; blk_opf_t req_flags = REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER; + int result; spin_lock(&ctlr->ms_lock); list_splice_init(&ctlr->ms_head, &list); @@ -555,9 +556,17 @@ static void send_mode_select(struct work_struct *work) (char *) h->ctlr->array_name, h->ctlr->index, (retry_cnt == RDAC_RETRY_COUNT) ? "queueing" : "retrying"); - if (scsi_execute(sdev, cdb, DMA_TO_DEVICE, &h->ctlr->mode_select, - data_size, NULL, &sshdr, RDAC_TIMEOUT * HZ, - RDAC_RETRIES, req_flags, 0, NULL)) { + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cdb, + .data_dir = DMA_TO_DEVICE, + .buf = &h->ctlr->mode_select, + .buf_len = data_size, + .sshdr = &sshdr, + .timeout = RDAC_TIMEOUT * HZ, + .retries = RDAC_RETRIES, + .op_flags = req_flags })); + if (result) { err = mode_select_handle_sense(sdev, &sshdr); if (err == SCSI_DH_RETRY && retry_cnt--) goto retry; From patchwork Thu Sep 29 02:53:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612193 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0A87C04A95 for ; Thu, 29 Sep 2022 02:56:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234481AbiI2C4w (ORCPT ); Wed, 28 Sep 2022 22:56:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234533AbiI2C4l (ORCPT ); Wed, 28 Sep 2022 22:56:41 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 481121191B6 for ; Wed, 28 Sep 2022 19:56:40 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28T1TMZb004231; Thu, 29 Sep 2022 02:54:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=lFtlwiE3awzlDyF/UcTSVH2It7Y2wrljGZQn1Ltzqa4=; b=lIlcnmHdHONFVRl4LmB5raynLEQ4dGfUkVEdXSW660xqWeYWF5gf6GFBLf6oBzK/sXkG Y42AblP6XQeridZFhf5OXnJrxxW8gIsionDRDIIKwWYsGRx43SvayzcxXE12/PR/rnS7 65P94jtu3T0LTkYQiXxD0oJWIIFNWMjMSUz6ClA7fryIeXyXcvqozr/73MJ6dmb1xHDU GWzw5Dm+jfMojVJWN8/a6gsyK917Hb+epU2Od2duDPHhS07UwvCazFU7ugjolmkx24Wv i+XLAnyzDuyaZ0QHmdQ38TBpdh1fxe5/neSVgjE+uiJTs0sFWARuIChaosVzDYlADbtX Ng== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jssubkhhu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:30 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28T1HoFS036921; Thu, 29 Sep 2022 02:54:29 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2174.outbound.protection.outlook.com [104.47.56.174]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jtpvfv4rt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VzRRPZj2Mv0LAIHdTej+NzO7EslyknSq4Yeuh3TmX2Zn28fLJ9IrP2jbUXppIu9CMAJ+wVpc6yr3A1cWDfM4XRkK6NP3FWsmMncCNVXjFhPxJ/4lpq1TaEtehx4A3DzsasbO/dgVmAVvAbuWjB//2yRhyGEwdzCNH4FuG0ixpGOxvXTeui7eQe4zUz7E0aOP3PdFei8cxYEYyUfO25C0KIMRaufLtykoH4zlacBVKajxgmmm41gfvWH2FpC5sEuZaDGMMy6YuMAc5dMmJGT0PaLWBfkmeaPYrKGBF6SgG5eWsstO0HtaDpZes3EQcGtexA+4osAcYP9ABarQXW3qNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lFtlwiE3awzlDyF/UcTSVH2It7Y2wrljGZQn1Ltzqa4=; b=LupI49AcNReuiRBMqL3qNwt8xWIbKP//FmIjs51mJXQ+vyUBKwJqxi2hpGHvUmA+r2lxqKWB8To7gQjUn5IcSSBudQ5I3GSqM2gwA48FRK1h3Q17OHNXC17KBM4KkwcWPM5U2BBcmP5haosRq7F01CHtjWeR9WiEILWYj1OZ0GIcVMi/+/oYj50olFy3zF9/UhmkmZmyFjko8R1WpcaaIVUKU86NuW0nfb77AHHy1rc5jJbFCDd916qJFI76Hbx1YLXt2+dsA8s+LiUSGgXCSzf+ouK7hT0pBRhLeq8ccH2I3Q0aege4TJefqc+NmDeS4uGfifwUs1VpeJ0TK4r0DA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lFtlwiE3awzlDyF/UcTSVH2It7Y2wrljGZQn1Ltzqa4=; b=DpEIAgN6An7lvzUQsGftBmbgAlhsGQiUaXBGNxsTCr+ltqg05lxlbHLGCKFPc6A+ZHVFQaDedPd+95shug/dcux9A3jabZTlo/HM1dtVxW9rnApesoA9lpR1KgjSM9P45bnSWTwtUS5a9oGSU4EWt+P8utrpH8qZ4cnkHX9i2Nk= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SN4PR10MB5653.namprd10.prod.outlook.com (2603:10b6:806:20c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.19; Thu, 29 Sep 2022 02:54:26 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:26 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 09/35] scsi: core: Convert to scsi_exec_req Date: Wed, 28 Sep 2022 21:53:41 -0500 Message-Id: <20220929025407.119804-10-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR07CA0048.namprd07.prod.outlook.com (2603:10b6:610:5b::22) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SN4PR10MB5653:EE_ X-MS-Office365-Filtering-Correlation-Id: fb8ddc7f-3e15-4e51-ac82-08daa1c5ebdf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YdSpWPMnBalhOwftKPBrNoMizVyDEOQFAZ0iKxU+VqGToDuyiexlgz1V6RHi6FTMEIRxfmNw3LBlh0b0jor7dKok7t476jV8vdkiJAblQUu9kHeRv3KOBHfhmYATkKJ3UQ34ClrgXKz/4iv7zdoLLF2e+8UZ7sA6F7lITConyK1iwxUU4Y41lJFYT7w+x0CG/qgU0ulBH6vlsgCbPHwqMQ0ehW2dQQejdVmeOWOCJgYBeNNKEwq8cCIKR0ljI08lQZKmvTKdSIMLePctuwcsdqRJicaytGqzcqJ5rVX8ikuva4jxuwRFXiSRVHP13xH7DhpQL5kJMKSt3nblQsHoZoM5U291gbPVSqK8XR+A7KpWho4sBjnVjSWZ3iZv06KmxomwuIh64+wuLLLOkBt8ipQsQCfgh2k6uiLGK2GHXLDeC0u7slPUbxAoOW5GBbca5Gi+vq0t3lB/I+vdAgrLO7zSd1p+bN4loc22CT1qNSu2IsKmM6KvuP881uiuAHK56YVI5Ok+W47VPMPfK5RZ5y2h94RdXMPfCKgzIsUvflybHteYhyzINWV0xsOU/eOVZpe0uUTEbjUtFrNPW8+rxJzSVNcafwQAhu7wh8rhLQQyQ0eNHwVovn49WO8Bvwvx4vFSmepdOMHEVuij5SwtXBn5jxlNA6CcvJ9ZY0PJ5pfHdbZNcB+Te0kEjJZsgMsvPIOehfeaMUsSbdVfFcoH+Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199015)(66476007)(26005)(6512007)(1076003)(186003)(2616005)(36756003)(478600001)(6506007)(38100700002)(316002)(83380400001)(2906002)(6486002)(6666004)(107886003)(8936002)(5660300002)(66556008)(4326008)(8676002)(66946007)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: D16TdJRVVWVEBf+9eNDXurqC7qFtFBT34yrXt5VI59nJEUlLPpPtmbun+azNIlRmi/T578zvE5bKcTxg4rESteS/80DVr0mZBZP6rxS7rDyKeQfN6yQcBdJnOGi9fJNvA8BK/ckvgCMstbXbkRgUtFFmLDP54u+I9DQaFnHZFY/LVA9d7jAE3kiFG84NuysdgzbA9A8imzuVR1XqrWfMctBhAnuATl5XPZ1m4tmoiM1dkRS4/czR3GFtoaDiRuUOxcwlwpeKdPUzUQ47wP2vlX5/mrr1o5TuQ4TbpeT9ezNBpOLputVkCV6DJ7xhRD/OIMhQI5j+vxixrLBgPBPldMopqYAWijLBt7ZlJQ3Vf09+tdrkh9gFtrxgSqO56fpi/vLF2/DT1YKU2EmZBvtCndoPGZJ/eBUzOsZiezQz7auvIkfiKCZ/APagTZZkhwVHW7SJPauNBB48abS01ePwDJNU8iq9LwJnYLV+dUEqm+NWy7u49pj06mEkwBslyEN08sUm7d6j+qJyjFIfD8p55fosQjpBbVqFgDNZ1gqe5ucd8tuE7WUaN6ZHJ8lYP8RvtFqqgn5wKLcyNoj7wjuu5AMTN+MmWqAJrLdKVDNj/mrt/ieTiuruitYsJkh7zxKvH6XqdllOjgO04YYJIOHWXNPk9W+jVyF6iFJ3QxVyGljuqZJLUEWp2tbEV7nl/DX1MZqLVslzteKUDjPtsGxcpUoSJt3ERHkwA8AyceGcKuBwMCQnYLKuK7KKtjXxH2R8Q3jQF/pBxNftJ85JaAUo2nbxnZToUw5WZwiwOxz2pj0ajoXFW1dISvSfI7uriENgzYYclOBHrDu0/06V8bw4eZR9irJzmvdKndf7ca0DN+zUPOYc5WZAruuw1/gY+qt6AdzfGffWQRYVPCpjbAtJZHi1nE3gVmDhARL9m2JO4Hc3jMhed7VXVfB3xXddcirtaY6qljgYcr6XHug3Y8ukn8r6WPP7Wc8tu6MBbBBc5M5gHeeePHECeGeFrrQqExVmjXqzCbdr61QbdijEQq55vGUyGhNk2Yk7GLqrcdkvL3mJVNZuIVavhu4xIOtO5R1ZcRm6vln6pqFMd8a10RcKNBNmVH4S6nZkNu2+MS3kufbUcD7OhLPHhnE5h6y3Uc7fEjeZn5F3XD3a9xM5HpkGcxnNkoMCcaRJ1+CPwHrdrn3eknTkEiP1xFAm4cDaIUlXccretbL7yuoTeI9X7w45CErIfLuaaRuxiCl5V5z489J8EE6g2Bbm6ByB4lxD5/aFwUbUUCsX6Qi0Kyh5TmAq5IwbJPVODib3c4TqI85rgaA9BCDYP0grRTfppUGUjc6KWd7KmbVV1kOTmASbjke1gJY++naIYQiTFFs8wUHa9befSCjPbSSjVJnO18P1KTdFm2i9oLhLlzqlIbgYSUmLRM6z6B4vnVlLyrNMN4209FZL1K/GSXbbQHJYKijLrE8HUcU+cv28cokpiklDMHKmd7ppCJP+rfcD2+oEqi2M/xpYC9bmtrLHCyzJD9GZbOwLz+gYyqBLDHlApU1Hoz/kQRbEkL/OqNryx0CDhvV6k/rVktPcwiaohzQB8PPEj4pqCLeCCpI41sSUqex4I4BASA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: fb8ddc7f-3e15-4e51-ac82-08daa1c5ebdf X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:26.5530 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: icl/L5JljF+Rcf/3WIznhFY+yi2FT2vWmNF1LVohxrJR8w1jos9LDUS6B17Zbn452+3uAlWDykd4z5OKomah0VPCuLfae4/o/QpoXLarAhE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5653 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 suspectscore=0 adultscore=0 mlxscore=0 spamscore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-GUID: LuHzEOXy3Od-4VangzKb0cg4X0bUI6md X-Proofpoint-ORIG-GUID: LuHzEOXy3Od-4VangzKb0cg4X0bUI6md Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is going to be removed. Convert to scsi_exec_req so we pass all args in a scsi_exec_args struct. Signed-off-by: Mike Christie --- drivers/scsi/scsi.c | 21 +++++++++++++++++---- drivers/scsi/scsi_ioctl.c | 9 +++++++-- drivers/scsi/scsi_lib.c | 31 +++++++++++++++++++++++++------ drivers/scsi/scsi_scan.c | 37 ++++++++++++++++++++++++++++--------- 4 files changed, 77 insertions(+), 21 deletions(-) diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index c59eac7a32f2..8d8090c8fb05 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -309,8 +309,14 @@ static int scsi_vpd_inquiry(struct scsi_device *sdev, unsigned char *buffer, * I'm not convinced we need to try quite this hard to get VPD, but * all the existing users tried this hard. */ - result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer, - len, NULL, 30 * HZ, 3, NULL); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = buffer, + .buf_len = len, + .timeout = 30 * HZ, + .retries = 3 })); if (result) return -EIO; @@ -531,8 +537,15 @@ int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer, put_unaligned_be32(request_len, &cmd[6]); memset(buffer, 0, len); - result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer, - request_len, &sshdr, 30 * HZ, 3, NULL); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = buffer, + .buf_len = request_len, + .sshdr = &sshdr, + .timeout = 30 * HZ, + .retries = 3 })); if (result < 0) return result; diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c index 729e309e6034..5708af4485bb 100644 --- a/drivers/scsi/scsi_ioctl.c +++ b/drivers/scsi/scsi_ioctl.c @@ -73,8 +73,13 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd, SCSI_LOG_IOCTL(1, sdev_printk(KERN_INFO, sdev, "Trying ioctl with scsi command %d\n", *cmd)); - result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0, - &sshdr, timeout, retries, NULL); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = DMA_NONE, + .sshdr = &sshdr, + .timeout = timeout, + .retries = retries })); SCSI_LOG_IOCTL(2, sdev_printk(KERN_INFO, sdev, "Ioctl returned 0x%x\n", result)); diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index e1c19fea24e0..9136a3dfcd67 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -2123,8 +2123,15 @@ int scsi_mode_select(struct scsi_device *sdev, int pf, int sp, cmd[4] = len; } - ret = scsi_execute_req(sdev, cmd, DMA_TO_DEVICE, real_buffer, len, - sshdr, timeout, retries, NULL); + ret = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = DMA_TO_DEVICE, + .buf = real_buffer, + .buf_len = len, + .sshdr = sshdr, + .timeout = timeout, + .retries = retries })); kfree(real_buffer); return ret; } @@ -2188,8 +2195,15 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, memset(buffer, 0, len); - result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer, len, - sshdr, timeout, retries, NULL); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = buffer, + .buf_len = len, + .sshdr = sshdr, + .timeout = timeout, + .retries = retries })); if (result < 0) return result; @@ -2273,8 +2287,13 @@ scsi_test_unit_ready(struct scsi_device *sdev, int timeout, int retries, /* try to eat the UNIT_ATTENTION if there are enough retries */ do { - result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0, sshdr, - timeout, 1, NULL); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = DMA_NONE, + .sshdr = sshdr, + .timeout = timeout, + .retries = 1 })); if (sdev->removable && scsi_sense_valid(sshdr) && sshdr->sense_key == UNIT_ATTENTION) sdev->changed = 1; diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 5d27f5196de6..58edd5d641f8 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -210,8 +210,14 @@ static void scsi_unlock_floptical(struct scsi_device *sdev, scsi_cmd[3] = 0; scsi_cmd[4] = 0x2a; /* size */ scsi_cmd[5] = 0; - scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, result, 0x2a, NULL, - SCSI_TIMEOUT, 3, NULL); + scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = scsi_cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = result, + .buf_len = 0x2a, + .timeout = SCSI_TIMEOUT, + .retries = 3 })); } static int scsi_realloc_sdev_budget_map(struct scsi_device *sdev, @@ -674,10 +680,17 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result, memset(inq_result, 0, try_inquiry_len); - result = scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, - inq_result, try_inquiry_len, &sshdr, - HZ / 2 + HZ * scsi_inq_timeout, 3, - &resid); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = scsi_cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = inq_result, + .buf_len = try_inquiry_len, + .sshdr = &sshdr, + .timeout = HZ / 2 + + HZ * scsi_inq_timeout, + .retries = 3, + .resid = &resid })); SCSI_LOG_SCAN_BUS(3, sdev_printk(KERN_INFO, sdev, "scsi scan: INQUIRY %s with code 0x%x\n", @@ -1477,9 +1490,15 @@ static int scsi_report_lun_scan(struct scsi_target *starget, blist_flags_t bflag "scsi scan: Sending REPORT LUNS to (try %d)\n", retries)); - result = scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, - lun_data, length, &sshdr, - SCSI_REPORT_LUNS_TIMEOUT, 3, NULL); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = scsi_cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = lun_data, + .buf_len = length, + .sshdr = &sshdr, + .timeout = SCSI_REPORT_LUNS_TIMEOUT, + .retries = 3 })); SCSI_LOG_SCAN_BUS(3, sdev_printk (KERN_INFO, sdev, "scsi scan: REPORT LUNS" From patchwork Thu Sep 29 02:53:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 610833 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97EAEC04A95 for ; Thu, 29 Sep 2022 02:55:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234790AbiI2CzJ (ORCPT ); Wed, 28 Sep 2022 22:55:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234817AbiI2Cy6 (ORCPT ); Wed, 28 Sep 2022 22:54:58 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D08E527B05 for ; Wed, 28 Sep 2022 19:54:44 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNiSG6020728; Thu, 29 Sep 2022 02:54:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=suqDCWo8s+3gGmwA77bIU2xk+R+HOrcSjIdu5ABO2QQ=; b=jndYMPIky/Kn3FxnjSICZQf9f5smbb2rPb4O67xfsQ2jTi3TRzbZZxYySuUXYUQfrUTs J7MxzBOJkgy3vBbrxStCvumRsnpd2Ego10aHDPxQIuFAO+ajGV16LbNZ1AKbJsl6Uy1S mpJrlEGffXLJjIrzdhidxhZVtPK4XLr7wpGYfY+S42Wmi8y0Rx6cTh4endPn6kRJ53Ot 1Rm3GS1NsVqmah+OKreFqxNv49MmKCW0vBLo8N9vNYPIQlSaJn9ZcnHAksfNOPBkydwk xvp4lBHfo6rAZaS776SUSGUQygGGli2EyTwGNIxu+GtiwFkTi3yQ/TaH3jCrn9cf5B3t kw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jst13kgav-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:31 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28SMObfO002234; Thu, 29 Sep 2022 02:54:30 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2172.outbound.protection.outlook.com [104.47.56.172]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jtps6v7gd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XLDQ4e2nD1KrYUufQhSh7QUmrHDaXC6YoKBhSH6h4i9BNdTSrjml9Lp/0X/EiSsdXpCbiNJJ+b5MyCzT4qeafooqxTxX5XFHNG3Ans9eOalxwNfBQmsRWMj6NpeamAQox/YL8qdkxE2eJE5+nm3duoccjY6AEB5CT3qp9vRJFePcV7WuGXoofzhGvoLASZBop0vJnRnN7gAZiaSHvBNkFuzcPI6Ij70IrI6OBt0EVSVeGVU/UuQ8CAGQ7s+11mwXRjxnKTTxzh7yoUs8pIB+VLqYohgHSmNHpvFjYPd+Z8SVZZheQGBZNJCRJv11N/KlSBiLjCScYcB+RGopMXdShg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=suqDCWo8s+3gGmwA77bIU2xk+R+HOrcSjIdu5ABO2QQ=; b=KP93cTaSEyyrgzd/M6373hJtTpk+OJoR/ILc6OJpxpAXa7UPRlG6xzGpGuf7LFgmv2YuLOleVrM3f4xeTERxXB8nRiitbbSG9vhgGAXZxnAEXxBc1pKK2IT7K6FmT0h3WjSn+rzkdhqXZIV4+Znr96Ml4cWsQd1IaESYTGGVvs7gYMao6BBBQO+E4LGHSnXoJCzbfXomoQ7XkEQ24sVJnxs0yxc0Pxud9C5aMY5ig09PCTcqP/HK6SxWwYECOKWlPbvC9ltKJmnuhKE3klX094i1rr5IbT4pdy46YBqsDteLSahyC5yv4ixSjxRjveLp1CoID4govDit4KeyD8KWiA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=suqDCWo8s+3gGmwA77bIU2xk+R+HOrcSjIdu5ABO2QQ=; b=qLeyt9w3sMopZ9ZXTPg7gcTHhspmI/vhOz24xPh/OYbfVN8BkOXrtyCyY5BtFwExQA68mqXl5rj/tmC6IdM8tQnGB2M3vSER3YVNviFMLfMbp7DEiPOJRlN/wrMxRUFLNqvvYn3JIm1tV797s2omtM4W1WyeAd5XAPZIMsIBD58= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SN4PR10MB5653.namprd10.prod.outlook.com (2603:10b6:806:20c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.19; Thu, 29 Sep 2022 02:54:28 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:28 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 10/35] scsi: spi: Convert to scsi_exec_req Date: Wed, 28 Sep 2022 21:53:42 -0500 Message-Id: <20220929025407.119804-11-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR11CA0005.namprd11.prod.outlook.com (2603:10b6:610:54::15) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SN4PR10MB5653:EE_ X-MS-Office365-Filtering-Correlation-Id: e3e5a9dc-7581-4bbb-0ff7-08daa1c5eced X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DetQt7fskHoBgHuyhyJQq+WGYI29CXLHqJ3d4uYRTYk230G0J09xzvPiP6k9rcGV3OegNhNMH2wzIkZOXD4JL2WIimUKag5OMmwW2XYsoVWxL/whTokCe2vlw50znAxbAXeEEiDUEd9l/aYj0ftr9sgvuCg1uNLV4c1M60F6T66eWOiI91XzizNwVvrxm7vaEnmm9AVrnbk0xOFuNNRCSMhFSdrM7NahHmuKZ/JcUm+QJXCs0sMHDqAg9HWbVxru1oarS07buw3rNLsNUOIrBp6glff9gFRSBjc+rQ4+SbG3rUI+mRMVDlirwrv7uCSxdt4ZA3oT9hSg50lsf3DCFnceIP9kDUou3sG9nJ0uuMB1Eu+eOvAUwOoO2HyKOObR1cfIAqUa4SU6XDEOfpnyRAdV9JECHRPWQ29MLdR3934+seS3fPoVTwregAB5TmnopCZDU0bGfwjuDhJU8ssyJ4Fuu+LgdRdtlfA1zAyPZcIkFu027PiaShCdO0INcaFO6zMHWWaF9clhix/9G2bUe5MNmgNKcS2+r3Kfnaf1JlloTl7qgWUXRy6/TwSTM7jzhHUS8EAytSpvkC2yRzVrYbJTHXQ9sn6IM5VEuJhdH/w4AEuYnw0gVPwOaBAQ5qzMF859dRbwZSVeppPQF84U9GRt21sqzYRZqcyhgKfddGxwJH/cx8r7gOYubOrRWuTkipo0Z5buO0I4u/497c94yA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199015)(66476007)(26005)(6512007)(1076003)(186003)(2616005)(36756003)(478600001)(6506007)(38100700002)(316002)(83380400001)(2906002)(6486002)(6666004)(107886003)(8936002)(5660300002)(66556008)(4326008)(8676002)(66946007)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pURoxyNv58rxe4FU1yREOeJUii2+3GyBBK1TVGF1hTtWIZhOKn7Xq5jJ8f3dKMBRj90fM0GdEWWxGn4UNk9k4cuIVYqdyDKV4jvQk3tc1bbpGC07W9+B3M1URMBKDMW5iXLc+7vdj7O9g54UwftcEhYcvr64OUOULuwLDjzV0ig2lLE8Qtg3bQMUUA8hStXS8JqGl0Iup/uG+F2PMT+wL05IEvMvzdLLRKAgLzCz7uyEnX5Gu1ePHSw+aIakT4LUUKTqBg/UyfA58JmNqed2tz+wXQZirPSJdWQaPbbSoAdtlsvrmikaX3FPb44PnyoBCT2zx21gD0QcEYUEK6FuQTSiqPFt+Q6CL6M2Y7BPSmFvY/qLG0WVGzhOzYxoNmbXIlOQPvqjodM1qJtZ/mjCpxfijGzU73iNV4RpbDdx9ES6aAYs5f/7BFdkRguhKdQkWgzdChoKFgqKg9+VqHVNIp3XgXXkjI+GCggsOPK0UKFrZwaAzrnX087Je2AuBNZO1NQWp6nYUvPPr4LZY0tglN8toV/CcVrnTDhgpqXF64m4b9Yvbj1QDytWaf2kiVajsfWMLVD7yZfKDcnDVA+GmeZKDHLp0+kx2TWZMd7jX7U/1iLnyAzJcc/En31aFFBXoJJ6Fs4mauBcTzBcEUy1mAOZToKGkU6wsQ/hVfwrAHRdyn7/pyGHpYlWUie76+6EhHoR9EWVGmFiwCfjiRo1MV6VJIUOqj2GX+0WsVQEqoXH4/lD9jqqZXP7JB8YMaxP/hiizqWG6Bvr9SlbVKbadOL9HBWoGHAnqRTiMMwhhzVjdyCLa0sDTY2QsvK8bify/lt7Dj286IWJgOGsFWI30bBh1Q/9TyT90QGXuOoxmjqH+AjPv+XxeJJ6lssiHH55ptX6GajODT9se5DTB6Zao+DD0x0IzryIBAPDUlJfQDgA3NRXCaGcFQHk3RrELMWxmyPy1tkzT1FJQiD3HF7cpvRLcNhEtLwzgCwr4uI/vJCSP6gUcmmb7vhSD2QKTuw0L0ysA0mN+97GsRI9b/BBWxn2wofCmYTU+Zw6mLlRN2bkl300bT9zGl5W//1kUIiF+0l+uT1Yj5rLurglGDfKC7gVNIPOmwfg6p3ZX9PP57Khbu7nzIs4KRAGdf7Ou+KrmLC+q86H7ZsgjGlg9fwVW5otXpQl9UKAm3cyIz02rW3iyypqZSqgq575xLb0erQY7SlVRxNkAsv9BIeGgB/gWYFQfETwR2RuS396nQWsViNf+EzdC45LPN9rZXdGCEKU06JAULZGc9PX1Hlp+FY66xdeXHglm1Z6R+0APDgLU5fcFw1MrP4zferUdyfz6OgZKCidTETLe/u+bFBlnO/ARs4+yH2yD/gyssR8k3pOa2frygGmJkga1XmToSMCuV+dCHv8du6fhouyC0EgpNrQ62HWOTbHvwIYvgqYBdjAtgyC4rD7YYvj6bdyvii6dR0kb0Sy/Fp7lFn552dIg6JxVkKm6x5qPGO5Y6qVtLii6eiPLFe799poVsIF2j5X5MoCLDiuPN6Jd92bz4UrA17ZHCW3uguhsX78ZJK9As8MfPvnETmVLIGAejovAhkQukQ1N8msTCNtOnmH9zHXZLpYGg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e3e5a9dc-7581-4bbb-0ff7-08daa1c5eced X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:28.3028 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: A6OqqXN2kjZ5/xZHKkcWwrFvbOfXYZr6a4KdIoNff+pV5BjvCnPdtY1NYzWmX5v3TnXlAVwgzoVFRXlBVjTTo9amsKmZdViDZQttaWehFsI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5653 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 suspectscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: AD26uTDK8KS3f7vhg4SdA01yN4QzN9C6 X-Proofpoint-GUID: AD26uTDK8KS3f7vhg4SdA01yN4QzN9C6 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is going to be removed. Convert to scsi_exec_req so we pass all args in a scsi_exec_args struct. Signed-off-by: Mike Christie --- drivers/scsi/scsi_transport_spi.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index bd72c38d7bfc..55d9b13b2f8e 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c @@ -121,12 +121,21 @@ static int spi_execute(struct scsi_device *sdev, const void *cmd, * The purpose of the RQF_PM flag below is to bypass the * SDEV_QUIESCE state. */ - result = scsi_execute(sdev, cmd, dir, buffer, bufflen, sense, - sshdr, DV_TIMEOUT, /* retries */ 1, - REQ_FAILFAST_DEV | - REQ_FAILFAST_TRANSPORT | - REQ_FAILFAST_DRIVER, - RQF_PM, NULL); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = dir, + .buf = buffer, + .buf_len = bufflen, + .sense = sense, + .sense_len = sizeof(sense), + .sshdr = sshdr, + .timeout = DV_TIMEOUT, + .retries = 1, + .op_flags = REQ_FAILFAST_DEV | + REQ_FAILFAST_TRANSPORT | + REQ_FAILFAST_DRIVER, + .req_flags = RQF_PM })); if (result < 0 || !scsi_sense_valid(sshdr) || sshdr->sense_key != UNIT_ATTENTION) break; From patchwork Thu Sep 29 02:53:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 610821 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60416C32771 for ; Thu, 29 Sep 2022 03:06:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234726AbiI2DGE (ORCPT ); Wed, 28 Sep 2022 23:06:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234151AbiI2DF5 (ORCPT ); Wed, 28 Sep 2022 23:05:57 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3FC880503 for ; Wed, 28 Sep 2022 20:05:56 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNiSHL020728; Thu, 29 Sep 2022 03:05:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=XnZU5VcTWwg8nXRCGgjlKF6eSM1/5osmWkzJlUV8cL4=; b=qP82HQcnA+AB/BnnPb04RfSqtVoAPjvDGXqHkQsdLV5Cbdx7FEBUSQ9jxzgAOXKiM/8l a9CEsMA5cRq1Ss8oarDte94KVWiDdojxhuweiPOeAu0n/zHR9r1YE7Dr+8r60naQ1PTf eRqfc6wL5t5h5YWoxs5MTywGbBe3e9vTBfpD5TyShy7tiSDdcn0LYxTuJaJqMKZuF9xU otImB7WAxnDPH3RmDpWBOjUa9rddtBXG3GdEbeqRoM2mBoEK5Qamil6Jll1KFbKS/AdW b69pceagY/n3rhXLj5RxW6evmb6vh8ekZSkKdVbJP+qpdyIvKJFZm5A5u0h2+/niA2aE EA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jst13kgpc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 03:05:43 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28T2e3x2033544; Thu, 29 Sep 2022 02:54:32 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2174.outbound.protection.outlook.com [104.47.56.174]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtpv22qsr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NsvARNslsKky52Dq5dZHZPNA6RaDfZTtgOC6BS+QtbtVostZuyFlyaxj/cLTSc2P+eLnIO+av4TsWPWPQIdQPdim+6Ehx/z8jO0p5c6Fvup5Q9mInl3EwKyn3zqWWVEBOrcyBFWro8BqaUOo2Pi4cMDp0JDhkctAe0II7u6+t86Di9mpcDCTYQUH6Ot9+mO3Os1mMkT+wNBucY3eVz8p5FPoQkx1r8fqmCB9Lh+neB6qXUlE/rRwoqceyeLM9+3fbBbzaVbavHaNrzHweR+YoWyc43e2H1QI5kt0SLdXyS84d3k+CKdgNQ9ZzUXPsj635ftKsCAbXX8YkTHBkVYu/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XnZU5VcTWwg8nXRCGgjlKF6eSM1/5osmWkzJlUV8cL4=; b=Pd1Va0yIlmzeW74w4dMSSHdgDT/RdWVpyUNdB/+Pwlqtjf47stE3BImqo10mt2Uklv9G47YPdbtzhYLjoOaxSgERpStk5vfaELReuvXRb+7zou5hcTyk65fs+9vQAct5KwPFU80+PpYPKmzmrd4G1Who7zEKkH2TUTLU8ARO9hCVoGmFJRU+ESh1PKboO28PfAyDftD/asgHQ+4Q5hm7esS1SYRy4NzTrYnwMz9XnQPyDH9McLCQA6j3HNsd40HJGNh4RqqHkmnL7GN0iIM3whrUYwZtt/dJMSRw2AgROEh1Do6kd3GbXJ9EFYFe+wczspnPo1SUK/yxVRn/W1UXVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XnZU5VcTWwg8nXRCGgjlKF6eSM1/5osmWkzJlUV8cL4=; b=fLNJ3tM1SEXPnpDqn7oBAGt/nUSIym9sPwXCf3DiEPrYNfR7CBiLRoLKMUufcCCdBR+DloqeuZvAM5U5NTAQfvbNS2UBTZ01usZZ2Lv0tGL2hXcVBDAME3drklCkt3kOwaDPjupDtDG0NRz0DlD9ShgltOTAryosDqkAaEXUFxo= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SN4PR10MB5653.namprd10.prod.outlook.com (2603:10b6:806:20c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.19; Thu, 29 Sep 2022 02:54:29 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:29 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 11/35] scsi: sd: Convert to scsi_exec_req Date: Wed, 28 Sep 2022 21:53:43 -0500 Message-Id: <20220929025407.119804-12-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR11CA0009.namprd11.prod.outlook.com (2603:10b6:610:54::19) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SN4PR10MB5653:EE_ X-MS-Office365-Filtering-Correlation-Id: de18095f-9265-4cf0-1330-08daa1c5edd9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Qvri4mYn7Q3p6LFsNOsN5TbU5jgJMWNhiaqbSXJjU1rIXb3SFnfbrcHTBSp3B1EbCwaHTfhyMM5wPvXbZDccW1Yb0RDK8Qd8DwfZPyy+V+Tw7mwHkbrXs5OKe/qEjy3ZRar8dfRdp2nOIh2CC2HAZKi6HpQeCWdgVTP7niV25PlqXAUPG7fUpA4vYQvmgpU6fKBBV4Euac+3BbbrRuG2MXgVbsOcHxWJmvHgbHmuCT9ZZOzjaIfzK33od02EpsKI4eTIE2N9vT6llfeDPorJJqjvki1oXEdAN61SAsrhzxb+LgSRZ5qjGOv3beKT8cX7KluCjmhljSsxYYzz8cpe73gO18fL7D9MY6sLPiISv5cze0uzF7yRve6OgEWEAhuy80hrXe0P3ih0Ay+V1l6PAFPaAK5Hd4bDDQ6yjj+1SZ/CVURoy9fHLew4s3vJVj6xShbydXPa6aQytNtQCe1GJkirqjUnHXKV4J879ELbh+WxOLBhmU4+sQ8pzjRfsDbA8SE+x6OLQr8MGGZewE5VueRKkTmlZK5kEn9aaqLfuIEvI2uVatfPJks3OHiijl6CBELboeGB+9NLYG4qdtEz8CkW4DgKq52ongRSdhjC8bV+EHQswPb+FqkJq0S0zkqZk9hxpXiZaU9VoZT4brTzuyi3UoCiVbqK8oKNTdoyi2w+z9rvQbfUkKLZCp6H0n+wnl05kglpXAhJKq9IY518jA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199015)(66476007)(26005)(6512007)(1076003)(186003)(2616005)(36756003)(478600001)(6506007)(38100700002)(316002)(83380400001)(2906002)(6486002)(6666004)(107886003)(8936002)(5660300002)(66556008)(4326008)(8676002)(66946007)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: s5wyM5E0QLVQGk74IqZy9RLmjWkN794mpfjA+NZpppR3XYIL6C+enYecCu9XUV/91Axj34nWWzFlxeG2zHZBNQy3UJWjYPVhc534+Y357AUdqfjdCgqL6sRFpRt9kh5ImBn4vDxGJG/EOWjvx2gpLS2cSC6U4NkB+B40laMGjXb+SK7W3MUTI1K0GL2JoWLMNInJSw1GnmhFWSR96nTPtg2JxwNcIbFeNMMll47EL7lBeq2+8Jr+GM+YBZDpt29xO2vIZnued18BhtsWaLzG4Bdft7YXC9ujPhzrGrmWPEt1TdJJ/xk5ENBNiJ6sPVR3ouNJaXDrrUV7QZR04Fw8damx7wQ3Bb7UuKlWAd9J9o2LqfMNERi+86FwGCm/xqmwso+X51jv+1Rsvor9TD7R7hThuqAuxqRpDvR4w7gscG41jdDo5XFVnW3g6j7X+9UFOMhd72YAEcbXsS91D2AbH/dQQ3o6Mi0jBcbMps7c06c1q46RW/Nm6RgD2911lkOE/5n84QjuSdFlBEgY4wENw160ihVlE0x4UhsLMszmA+AqNverB7zQoVqcey8xUhKCi+VDfYO6Bcq/JJMt5XNnJWxjGOkl2Usl1Hxo4p1itgBa1ge0zfRwZoMzAinbRDV+Q6ihLB/ElUJ8Xq5cJftOe7mT9ZvMOSHRj7Vl7Bpn/Uqtd6E9xfS78S+fswZHasJuY8QEwukQPS1eP8B6pX4APOmFgfrnv+V0C0jFmsIGQsiHUzpuSxQGsuoXSyyP/zH7EW2Shkwwd5BBoOzYCDGRitQMDrJ06UbD05k4ZFUXSApS0y07R/E61mv6qiwpcK2MYtgEOd3shwaV+8Zaw1gq76hDcCNXyXec9iaTeNPWCHKniRdilmUGcgU5YAzCFVkeRJoUAjfZM6AR1LuPOreOzqLKwjAZmzj4AjlBY2kLqpYtLDncUpO2PXhxLFIsR+6dwf/mmyGK6n5LMfeJrBfoH4BgoDSB99wsrDz6mqtG/IPeQB+bJdFIVmz3h/yk7UCarLwTBuRhz++zFQdL28ocBYkGvkya+PmWSj1fFAEiPlaP80RPOMqmy2ia49K2iXcCUHPbRmLMXxHKRUZWpptTQawOcXNHojIGhY6vL8Z2F1g8t4RFK1LnD0K/uXX69I6Lcb2YRcdxiXJz0m6PDp6lbXBXLjUm2GtcXm49BBPH5CdADPFhC7CvxoX+yi3wzcHWS+VatH26P3Qfwk8SRhW1xOxidbF+fSx2lIzzBe0b0I/OLvk4WQhJ6TyOu/NOlh5kCpa1biNYtj/+Wc2O/1X1UnGMOk9hvVGq+sKBnIUq2iiBcUu2nEdvh/72Xjgcl68S2ktjZdQ2bDl2YPaQzBgGhNuYYyAYAMjolhO3jrtCv/Zzbcpj5k5672SPdGp2My8vTZIETwe8UV8OLsBHSF6NdMsntNHUH7TvMSvkE/CSN4fXxANLXt+AN8kjdf0S8+Fe9L8hx10OWxJsVCh3+CDtotfac8t8WcklYocA/VGrqE12HwCIE/yGikeEzWeEjpEW13A7a2uvGzrqQsB+t6Td3/hUVi3PDsn+y6eEyuazIg0kgw9LrVT02bRm943K81XOlHbAOUD2RdqAYlKnHpwybA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: de18095f-9265-4cf0-1330-08daa1c5edd9 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:29.8495 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jXYqIuw11WEnFiFlNhmlvSD5w0WlaCgEP0cETUaMFggrgyfREJEmK7UVJkudE546/T1QMGJ1E9jtvDFDbtfwgMlf+bvuG0I1bos1q0GScaM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5653 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: V_1SjjXHs6s9RW6BtnjEh8fc5W9gBokd X-Proofpoint-GUID: V_1SjjXHs6s9RW6BtnjEh8fc5W9gBokd Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is going to be removed. Convert to scsi_exec_req so we pass all args in a scsi_exec_args struct. Signed-off-by: Mike Christie --- drivers/scsi/sd.c | 102 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 76 insertions(+), 26 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index eb76ba055021..37eafa968116 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -671,9 +671,16 @@ static int sd_sec_submit(void *data, u16 spsp, u8 secp, void *buffer, put_unaligned_be16(spsp, &cdb[2]); put_unaligned_be32(len, &cdb[6]); - ret = scsi_execute(sdev, cdb, send ? DMA_TO_DEVICE : DMA_FROM_DEVICE, - buffer, len, NULL, NULL, SD_TIMEOUT, sdkp->max_retries, 0, - RQF_PM, NULL); + ret = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cdb, + .data_dir = send ? + DMA_TO_DEVICE : DMA_FROM_DEVICE, + .buf = buffer, + .buf_len = len, + .timeout = SD_TIMEOUT, + .retries = sdkp->max_retries, + .req_flags = RQF_PM })); return ret <= 0 ? ret : -EIO; } #endif /* CONFIG_BLK_SED_OPAL */ @@ -1594,8 +1601,14 @@ static int sd_sync_cache(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr) * Leave the rest of the command zero to indicate * flush everything. */ - res = scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, sshdr, - timeout, sdkp->max_retries, 0, RQF_PM, NULL); + res = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdp, + .cmd = cmd, + .data_dir = DMA_NONE, + .sshdr = sshdr, + .timeout = timeout, + .retries = sdkp->max_retries, + .req_flags = RQF_PM })); if (res == 0) break; } @@ -1720,8 +1733,15 @@ static int sd_pr_command(struct block_device *bdev, u8 sa, put_unaligned_be64(sa_key, &data[8]); data[20] = flags; - result = scsi_execute_req(sdev, cmd, DMA_TO_DEVICE, &data, sizeof(data), - &sshdr, SD_TIMEOUT, sdkp->max_retries, NULL); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = DMA_TO_DEVICE, + .buf = &data, + .buf_len = sizeof(data), + .sshdr = &sshdr, + .timeout = SD_TIMEOUT, + .retries = sdkp->max_retries })); if (scsi_status_is_check_condition(result) && scsi_sense_valid(&sshdr)) { @@ -2062,10 +2082,13 @@ sd_spinup_disk(struct scsi_disk *sdkp) cmd[0] = TEST_UNIT_READY; memset((void *) &cmd[1], 0, 9); - the_result = scsi_execute_req(sdkp->device, cmd, - DMA_NONE, NULL, 0, - &sshdr, SD_TIMEOUT, - sdkp->max_retries, NULL); + the_result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdkp->device, + .cmd = cmd, + .data_dir = DMA_NONE, + .sshdr = &sshdr, + .timeout = SD_TIMEOUT, + .retries = sdkp->max_retries })); /* * If the drive has indicated to us that it @@ -2122,10 +2145,13 @@ sd_spinup_disk(struct scsi_disk *sdkp) cmd[4] = 1; /* Start spin cycle */ if (sdkp->device->start_stop_pwr_cond) cmd[4] |= 1 << 4; - scsi_execute_req(sdkp->device, cmd, DMA_NONE, - NULL, 0, &sshdr, - SD_TIMEOUT, sdkp->max_retries, - NULL); + scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdkp->device, + .cmd = cmd, + .data_dir = DMA_NONE, + .sshdr = &sshdr, + .timeout = SD_TIMEOUT, + .retries = sdkp->max_retries })); spintime_expire = jiffies + 100 * HZ; spintime = 1; } @@ -2272,9 +2298,15 @@ static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp, cmd[13] = RC16_LEN; memset(buffer, 0, RC16_LEN); - the_result = scsi_execute_req(sdp, cmd, DMA_FROM_DEVICE, - buffer, RC16_LEN, &sshdr, - SD_TIMEOUT, sdkp->max_retries, NULL); + the_result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdp, + .cmd = cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = buffer, + .buf_len = RC16_LEN, + .sshdr = &sshdr, + .timeout = SD_TIMEOUT, + .retries = sdkp->max_retries })); if (media_not_present(sdkp, &sshdr)) return -ENODEV; @@ -2357,9 +2389,15 @@ static int read_capacity_10(struct scsi_disk *sdkp, struct scsi_device *sdp, memset(&cmd[1], 0, 9); memset(buffer, 0, 8); - the_result = scsi_execute_req(sdp, cmd, DMA_FROM_DEVICE, - buffer, 8, &sshdr, - SD_TIMEOUT, sdkp->max_retries, NULL); + the_result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdp, + .cmd = cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = buffer, + .buf_len = 8, + .sshdr = &sshdr, + .timeout = SD_TIMEOUT, + .retries = sdkp->max_retries })); if (media_not_present(sdkp, &sshdr)) return -ENODEV; @@ -3608,8 +3646,14 @@ static int sd_start_stop_device(struct scsi_disk *sdkp, int start) if (!scsi_device_online(sdp)) return -ENODEV; - res = scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, &sshdr, - SD_TIMEOUT, sdkp->max_retries, 0, RQF_PM, NULL); + res = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdp, + .cmd = cmd, + .data_dir = DMA_NONE, + .sshdr = &sshdr, + .timeout = SD_TIMEOUT, + .retries = sdkp->max_retries, + .req_flags = RQF_PM })); if (res) { sd_print_result(sdkp, "Start/Stop Unit failed", res); if (res > 0 && scsi_sense_valid(&sshdr)) { @@ -3740,6 +3784,7 @@ static int sd_resume_runtime(struct device *dev) { struct scsi_disk *sdkp = dev_get_drvdata(dev); struct scsi_device *sdp; + int result; if (!sdkp) /* E.g.: runtime resume at the start of sd_probe() */ return 0; @@ -3750,9 +3795,14 @@ static int sd_resume_runtime(struct device *dev) /* clear the device's sense data */ static const u8 cmd[10] = { REQUEST_SENSE }; - if (scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, - NULL, sdp->request_queue->rq_timeout, 1, 0, - RQF_PM, NULL)) + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdp, + .cmd = cmd, + .data_dir = DMA_NONE, + .timeout = sdp->request_queue->rq_timeout, + .retries = 1, + .req_flags = RQF_PM })); + if (result) sd_printk(KERN_NOTICE, sdkp, "Failed to clear sense data\n"); } From patchwork Thu Sep 29 02:53:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612188 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27DA5C04A95 for ; Thu, 29 Sep 2022 03:06:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234481AbiI2DGB (ORCPT ); Wed, 28 Sep 2022 23:06:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234411AbiI2DF5 (ORCPT ); Wed, 28 Sep 2022 23:05:57 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B137C7F258 for ; Wed, 28 Sep 2022 20:05:56 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNiRPg003466; Thu, 29 Sep 2022 03:05:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=nzQ4DsWrbIepq9gHhkDIp/sm9Okg31VE91zu/E6WMeA=; b=s2xxYE2VV0YDk2uaOjm2aN3GdLs+Q/0bleGMYP0oWvdgWd/2M/zIbBZkbBw6hnVtQJXV fXfCYHd4595EGnpfPQ79ra+hRn4AL2IvLKOemFyoTe2WiSvE2vx6A35jgc8viABXxeoU +yfN/mOT3Sul3DPvZkEZrxw1wM4vqy37i/IbFGweBY7W/lSp3Y9OrivahbIjtGLFAXHn 4BtiwuWWNNhNa8s17r0QdBTYUxjcqWxuZZZ3gmCoQUmUN7952xE8BhbjYzjKRquGglAR fTqo/N+u9GLi5KUtDnnaDsB2uRVZtFeWeRVVuVizCcEz7D9559Foc0cU2cHgP5gAglfu ew== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jssrwkjqt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 03:05:43 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28T2e3x4033544; Thu, 29 Sep 2022 02:54:32 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2174.outbound.protection.outlook.com [104.47.56.174]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtpv22qsr-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EcsBG6PoJWbw2lJ4SKI+CoVAU5bQID9WUxQjvj4v+fLaiVmcThOWz/LcDapSReWy2I1tY7tkpYcCoxp+dh9gh1ThWJvo8UQhUyVSBdRdQvFgVUR9YSEBO8sGQs6HQllem+kzHHZmR2m7dN0RVLJkMZM0J/1jIU/tTNF9Lb7trqCViW+nPH3v3ZAb63Goo6qZuPTLY3pX9V5QECy42lIDLnAyjsm/p5StvoUzV8YaXrw1JMWBoO18Mh7pkGperqTphEZTAJbDhq1YoRM4Nkv56w6XRpHJb4V77JYU9jq9k56P3ADPV/iHMnXFQyNLcQ5ETZpYa0YIEr6kp+EZL5qqzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nzQ4DsWrbIepq9gHhkDIp/sm9Okg31VE91zu/E6WMeA=; b=PjfM+ePuFeF57NwM/0engl5hKMY787NQrssW4oh4SHrNWegN7Pu/6F/62zSNNYE/4Qqr1WJrVUvzECPQqxXhY41Ca+689V7oHAvm9QZtY+0N1LGLFp0sqVMLQ4xLER2aSmFlKJ8xks3kKBAKLCxISCEU6tba9yA/TzHshc4tCnqi28ROuq6jEyhzM5FFofmfJGuQx/GzBbrf7xEnh8wHuRD8OGYFrHkA9TBgSjyx40VZ4VXQWWFScn5y27TonamCWduuyNwYodq2TPfxaSpDMBp3kovlL2uRwjBOuhna/CtcCQtyfK9hfXkj2WccQezGgA7oiDh52GbVj/YlHYW4pg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nzQ4DsWrbIepq9gHhkDIp/sm9Okg31VE91zu/E6WMeA=; b=JIyKnI7epBa3acPxRJN5xfTvqFJGCwtBWld/bNh95q2+3za8C+Y8X7KFQpIgRhd3VvFJrp2ujANyBSFnX4EmXL1RXnyw0OigZEmnLEM1fFjUoH9Y6OswLbI59k4C6dfCxBf7JBfDxc1iVLGyhzXVXGaAZWTPvcV+9mpEm2gzq3c= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SN4PR10MB5653.namprd10.prod.outlook.com (2603:10b6:806:20c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.19; Thu, 29 Sep 2022 02:54:31 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:31 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 12/35] scsi: zbc: Convert to scsi_exec_req Date: Wed, 28 Sep 2022 21:53:44 -0500 Message-Id: <20220929025407.119804-13-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR18CA0008.namprd18.prod.outlook.com (2603:10b6:610:4f::18) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SN4PR10MB5653:EE_ X-MS-Office365-Filtering-Correlation-Id: d05b9ae0-f198-4a44-dd3f-08daa1c5eeaa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IxC632Dj2e9UKteXFpkf5DGk6znzcctSwYpcatA+exeEYA2e6WpDoZ1ZQ5UTIwl4ZW8P7vyXzQnIBHA+kdUfb1LzkbPl9vpZOOiuPBPauNmZ5qptXuS7ro4oSScT9GhyvRJge+lA5xWotj7cCWr9wGTKmuZHVnC0UAVbEkWZhEHSIniG3VpCvkYzgjIYI1VZFgTxwB5ucL/s3c8v/nzScVO7yaSY8wNAhg7Vj0jutr+0qmBRpWin20fxfNOJJuD+1dYO2Agn0lzxcEY7sb/I8jDTUHHWwu4tWlarF1kI+siOgKJvb5NIAEL14Vc8MgvSL77DEoAE09OED/YZF54I0Eg8U+6Q2qGTCQ8oestO5l9v5Rt8XMf2vL1/Imx+TwnCd9x6oWwHdZT3IVeDLB/Ou0HiNqss5GkvW4cT+UCyOGlPB0GSUoMfp9e2BH7uk5jMZ4n23iiuUYtTpqw3xHym0VoFiBWDQnRQCab8m2JOt9ShltEqZtiH58UDNXx7+h34HlYcoptZjEi4GtoiAUvJrUzz7iQytI8vndmaEQSUWefCuu/rEM2fUdMxjywvuT48RKK99tv0/APH7C+N8gHlP+klMF86hILaLoXhJa8fT3lbN+cZxj5l/9kYu8Yyh+o16y2t+3+4Mlyf0+tEbptHMcJltOaga/1zH5CRVgg2s9b79ritdJ3q06xv0XegR/g8DtzQi81uZE2URc3odqxSyw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199015)(66476007)(26005)(6512007)(1076003)(186003)(2616005)(36756003)(478600001)(6506007)(38100700002)(316002)(83380400001)(2906002)(6486002)(6666004)(107886003)(8936002)(5660300002)(66556008)(4326008)(8676002)(66946007)(4744005)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: s1wzQDj+LCp0l0fBoYwHR+XhPf9QKmT2ff2/8CY2xeIJLmyt/TQlIHf9zRXex5b5DCbTzQ5L2ZtOzeebUZVOpuLcGODqnXYN+ifBVzbl/G8gDG3KgXQWzJHqIbQyY/7GwwDA51ZLtuL6XmfdgY8aRpt4eq3L6wETAXULofYd8pTJndR8Cknxc+xX9zgBW1EDEJPUl9wwjdRht/LH29MUS2knF9MijS3Mq12QsgjAGH/EoHPZ6Eo0FP/SsGWPcQjXIKH+HuqU4ANvXkC+kFAIhBUQbH5uOwgAuIYzgpJ1F2Rtq4fuzbDLO9A818hFtDn9e5hsU66ejNrsayHRKBQsG5pcVUPdYPLrCiA3hd0vv03DdQ1dt9l7cyhPfxUfw9tnQzl8z69QONmiYGz/TpWuX9Zmxg/m43d2nBeZ/0QEUJxdEg6YXVyH4AxX2PN/8FV/Sn7bI6D0viwoEhCJC3bpON9XxXRbwG9rZMFT5H4S4qfqVWaiP/cj06sy7QIG/T4XIQi8DfP26ZzE8kBfeS3Q3GrsmOnkRZ2wxaoqbo+5Nzuf7s2oU4tffc4Z3OEGt8fKm7ZZUTP1xNfrccw/IivUoUDBqD+/9QCROVuBIfBvEQouAgRGlOv9U1jeu/Xv1n9TEuGoAoqJzACEatYTX5a+nwCUaaPatjQbxFq7dGl1E/VG8MH9PI0LxAwGxC8rgz7WBTqs0ORyBEuHE8CiJBpaxKpObJ4N+mKv1A1enIEI3luAs4ZV69jaol78wbs0KPdbITiBXy49pS4ddaV0RhIOqFBAj5WC/JTTdyw8JLtmCr58W1sQ2YvMlXDujGJ5NQXXlWlF65O2HgQHir1K1sL2dpKbeujjvqF1T4bMoMRE7n9iuL6HYdmjxSnaKMhuyfrAsV0KcXS/y0vF+zLtLRf0W4lk0wKlDLVMGeamSOf4UcZobRFc40AzYh1Gr5l9DGeuQ4TAiomTJtF5c64aP1wXQW50frF66P8WCb7qRWvJDiWwqeHVoGUVaZVUU6KgI21stx99rxeK5cqfsPsZhYMQKNuBqEBRg4mIk9bDRYKGakqxPQhLcBEKSgstIDLJiA98eX3pKYQWNhdgV0PuerrvU1D/utXMl0r9HE990Rvgmh+qPhCp6GIea+Chvok8FDM863WYgOFR8Y9fDZagvrvHQ2O6wMpEDmzfBqXrz+FvFUJcoMfz2+TJwQLF2akrD0qZPWPmf43q8s2Ad5+p8sWee9fToUxM4t65BwEIS9UGbNzrv2yVzR1jWJHDx3EADnkTeTECfjVt7Hx76Q+0J4mpYLaxvjAbt0s5e/RzumoboddRHtTqM6oQXFQBxEIYO032A1KEg4w9yP9q7QN2fvIv2GQVRMfei8KgWxW+y0T+ItMkHO8Fa9aiYcTO6pqUWZt/roKjRhoiag0WFdZSvn1WITBjGYku8nfrtbFjDEcJUdskU9l9fRDXOHUhS4ikoMWuloxke+kKmzquMmJ0fq3WxSc4cNLVMK+C9bXZne1mgbZH0sOksFSP5yU40rAcT3eTic5y3e1zIlEvNQ6Jk2ube5AQEu1yFH5j/FWttPfvFRHFO9CFtcb35heEQ0r/em2HE4ESWXPu7NLER/lwnHiqLw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d05b9ae0-f198-4a44-dd3f-08daa1c5eeaa X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:31.2557 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tuUZE/WjdVAGtDOC0G+2TManEOwcCFYVVNNGmZy7pIrUGI41F1LTj7ycR98iJNGRn/tf7rReVzsSPYUryEvW46Wx1GRZCldzVcGFgfDmSQE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5653 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: Ji4wEGNKBbxcI-e5fJROZJCbNKUjy5A1 X-Proofpoint-GUID: Ji4wEGNKBbxcI-e5fJROZJCbNKUjy5A1 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is going to be removed. Convert to scsi_exec_req so we pass all args in a scsi_exec_args struct. Signed-off-by: Mike Christie --- drivers/scsi/sd_zbc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c index bd15624c6322..d87884a19a51 100644 --- a/drivers/scsi/sd_zbc.c +++ b/drivers/scsi/sd_zbc.c @@ -157,9 +157,15 @@ static int sd_zbc_do_report_zones(struct scsi_disk *sdkp, unsigned char *buf, if (partial) cmd[14] = ZBC_REPORT_ZONE_PARTIAL; - result = scsi_execute_req(sdp, cmd, DMA_FROM_DEVICE, - buf, buflen, &sshdr, - timeout, SD_MAX_RETRIES, NULL); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdp, + .cmd = cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = buf, + .buf_len = buflen, + .sshdr = &sshdr, + .timeout = timeout, + .retries = SD_MAX_RETRIES })); if (result) { sd_printk(KERN_ERR, sdkp, "REPORT ZONES start lba %llu failed\n", lba); From patchwork Thu Sep 29 02:53:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 610822 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F9EBC04A95 for ; Thu, 29 Sep 2022 03:05:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234144AbiI2DF5 (ORCPT ); Wed, 28 Sep 2022 23:05:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233713AbiI2DFy (ORCPT ); Wed, 28 Sep 2022 23:05:54 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EA157F258 for ; Wed, 28 Sep 2022 20:05:53 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNiRoL003459; Thu, 29 Sep 2022 03:05:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=o5Ps0Clqi5d+VS8MrwF4D6dP3/XDtGXvuRdGiUNkATM=; b=3HGQL1S1swsRk4jhBylt1qwMZf81j3GQtB4oSt8yTvi0G36lW/SYxqeIbmHYWkvLTJ/W 2C2sTN5qH8Wgz1SWa6F0/ytoRjdfnRCz7Ejr2+HCVB6xe3xdwe3xSryiNxWKJTggDo3I UZNBbPWdHslGjvribKKzG4BmmVjn80PoPk3EFbxZSeDl8NXLDf64atbS+4JV/3lGXq6F Ku0MamaecM0aBJwz3iH5SVXxCYfkFXaEl7mpaapQAUGnuqcruZqMjFc5z8bs95c+ql3l jcFJP8p29HMPyKSdvP8o2Ir+zOsGp/kqTZYXZZKXgNq1GwteyEZtUQw7Di1Gezfu8opc fQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jssrwkjqu-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 03:05:44 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28SMvNCH033540; Thu, 29 Sep 2022 02:54:34 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2171.outbound.protection.outlook.com [104.47.56.171]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtpv22qta-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NiT9bQyL98qjCc3HGoZeGetqrGlcJalEf0pkEEYgf+HIlzXr3UjW4fs7RPS90YdMgiBdmn2/cLitXMHypcw2eEkbblY+UaKMGkVAgOTZ15vNDvCLq1n0R/GGEV/WgcdOWSF0KGCAE9/whr99VbieMUwpzcNV0GmUSEb/w5esv4ThrCe2MSMmdy/0WXrvISMZuMDzTg/s7et6D5R9VO8qcpzfRoSDgoSO6L414R1U3bUNASPUdmPgiL2jshdGQ/hcRFQrsprLRcxJW24VSN8QndZquJXasfipuKVen9ycC0wJIpJXcB3md4kHie97o2yqld10z/73xEbQSKkHud+j0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=o5Ps0Clqi5d+VS8MrwF4D6dP3/XDtGXvuRdGiUNkATM=; b=g+P7YuglWfgSWb2M02uAt7z/m7iGF9+E3Xp0bSlfpoRUOQZzibJovi97wuahEGlXVJhTwAsZ6B4qM1lVH3IV2FjlDx95KKCzOAwyYcBzpE71LlnosaisUfqFvRhBvZ/8R59E/yXs3A/ZaucyHN+FPpXQ2dFbovo23/ihTBpXzv0bAsBcLefOm6z01e2Huz0ulZtDCVB7No59c7JwQYzjnova2Gpp3AO8or8+OPHZokCIYAlREvGe5XKAqRUbpJYK3swRGXjwfEhXUc4JoTkl8nAOAfqCBxikd6xw9A0haXhEjTfF/ggAvhXmtvTm/P5Y7Gw0Z+Y4MljlhTv+9+hFBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o5Ps0Clqi5d+VS8MrwF4D6dP3/XDtGXvuRdGiUNkATM=; b=VWrqyMGw/A4CnvjYTcv/CdptG1sQX1LolNYfv9HwqTkKpZGlJlG4czwHunS/o/Nz4x57HW3aPjK5/t6XTJVMkhLDcbHfY6uXVN/GF0tNh+eDjYtoxgUgN3RQcHJVI/ZBDW4HQ3HurkefPm2U0ityFXr10ztUqDvT0Su5Z5VjoBU= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SN4PR10MB5653.namprd10.prod.outlook.com (2603:10b6:806:20c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.19; Thu, 29 Sep 2022 02:54:32 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:32 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 13/35] scsi: ses: Convert to scsi_exec_req Date: Wed, 28 Sep 2022 21:53:45 -0500 Message-Id: <20220929025407.119804-14-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR04CA0079.namprd04.prod.outlook.com (2603:10b6:610:74::24) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SN4PR10MB5653:EE_ X-MS-Office365-Filtering-Correlation-Id: 3174114c-3f65-4ffa-6bdd-08daa1c5ef81 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0PUHTi7wbMh12cKEYXDnAmiREyVlWRjPG5S7ew64KOba+VhLSIFm8E+oeiCG258ePDLtVVJa+ow1zsqYidZcOGHBUkCPPjiq9aYc2e762GXd3znOjWUzyQ1fx0wdKNs5RC4ywbzPYVdnz6y/0zg+9B0DZSSOuTZg4Bys5hvkDdzlCvO731g5p0pPzkU6YkolylmXBlK8jebMkWhzEDxI80/dbAmjHwZVhD3ckl2CIjVcCcARSqDh3GxBZAXLM/PDjn704n6AmU0Cv67BDe/MdjThi7g4OXe6PDzGFhL55PaalbuhoUyaqjy6jCKaWGl8gQjTOA9FMQTuNw3h+S+58/MIP4NEemNhejr1d2GY0ANDv94CSdxHkYtSuUZ/jXh9PjVtn+nT7gyt2BeLwK4XdhBaeacgOjeX9neJPUYg+BxfP641jzaPMoO70EmD8YkVMDdJBc20Z11udCIfnsDsWn/71U87Q4G7Bot8DI1y028vXnatLFk0Ek11CqLrg0aBxoQKQuAr/99WTatQGm85wDNPWJlyBxMQr1i5vOBV9NUeQDS3m7fKYyBJBaNnswAZhR5a8eBtejs5H8pmkQARz46QrKghJxVLuU0NFkEJZDtmMZ10zd1CAMJ34C3c82ZVtuZDwyyVbOfxmXu5XRRvrwYgs0mUw2fLI+MUVz6l5+P24RQptsm5jEFr27uw8iDju72UUnamnKRWc8arm+8nxw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199015)(66476007)(26005)(6512007)(1076003)(186003)(2616005)(36756003)(478600001)(6506007)(38100700002)(316002)(83380400001)(2906002)(6486002)(6666004)(107886003)(8936002)(5660300002)(66556008)(4326008)(8676002)(66946007)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KJv84Ha/SvB5gT6XfG8a1Bs3qm5McSrFNZF4rpeRpfzikV63X/SMzcsdx+3TfG3fGUzVNk2hMbxTCDubTiEVSEXnUX4SeyZ5MTaW7953cD0VK+ICcbwFnsFa5GEaBM/TgOVP3nZ/XerylJLq0HVNwk/vUwXtAqBpXeBSI69SgRIC/wuUo29+pypYLTMA+o/zomp5Ag8AIwcy2wLfNajocVKwKuCOsin0fQniXlfZmAGyyXIzaEFNZgwXNSEGFEp1BRoUbxh8SOzP722ES6okl3DrCVNPeHOpVVsvzOO/t5gwUa2k73xS+VqSmSf4nNBVJgiZQAUleQkT0BhOmWWwjOouVccvGppaxitIUgEKWkCsvjQs3maKV+/al0KAcF+2F9kd33rqskTbNsrk8+CbOSuJFLFPLVd9ozZtlpdgh1q66hNecO4b8+zArZQkKzXv1L7UxQYXCp6W9JFi+yvf2g/grCWLH3CacNcDQ5wPR4qFpaNGtmr/HO/MUuBKf1PVSaWuXhSnXhm/txkK1xJv7jdJ2UMK47Zswb+IAh8bxswR+1c8hJgSUFmJPKDTH0S6kK3Vyz85dczWEJu1l3hFaPmFP1yO5k3CJEVf4qfgAEksVb0O3KWBtzLt/FwBwXqDJuERrS03kBpCb9FxGtv8MXpzxSA+FfFLlG9FHsmpJS7A6kp3c5/CxB4daOIEZ7bCSls8Q2d1CjveurrwqPdFsMyBVw3CvxnXcOLidjNL9+M4jVlRj/WF5WSaOr6y/mSLvCfcCZmyuRGdj4ZKPXvq6RZr7PoFLHe1FfpdtGnkuA6IapbgiCw/kT3PwpUarGXUgVJrJIFF8S60jn5ax2+26O8y3KFUO7VSXnEPqXhvTc2HIJA80ESYyqpkdGttkZYucJupfEzY6hj5i/sRVbyYHMj7k5Jb3YTS1N5JrXWFSSU+eMFzwW0Era3doNLA8qeXgHOeD6UuAT+BjAfysZSgtw33qxvCPrsvJH03PrDOQZnaWbUjF4UG/tqyEwVSLSSR390T5BP1PD2hsjayNRaJUDrYC7HBL2MJNuaNHMFyJNyPJHuD+n5FH05zDoCYGWzP8sVSICusVfzIYFyu9A1d2R5oYjBBGiveSR1DZY8+aZugVb2dOSsJWQvGgS0hH6pQMoEbkwYgKFkLw9O++76bUWHQSgFQv9uFW+J36fdP34kvRm5JOuRDshCGv87ELpTgwUYGWgNxZMGMtuatF5+BKVeVc4p12TqM6p6spi3ak5FcG4M/IsjyYqtKYWBEbuHLihP4QnrDxfJd2ahtKfXzpXuWc/SgzXMclNljRJ4KuIGc8ZoOYD5pH1oLjqdbC1J2tcEnPpiZMtqSse0sfNVtTahdqLIYvHngMlVFOC7QDrxDHaQ7ht4QGOxmB9b36C3RqWYj82lC5na17kaYPaYdG4eFFTXsJ+dRkxGMcNwKeV2O0dw9fJV68yys3c4fnUu0B8KjdcuVPoAmm9jJ95WcoNFOOGk2HwLuT9QJ882fO83x6h6bxNAku9sPx/1AfG9/vfofmZY9ItuH+Dd7PCQ0gGdCJn0xu9XQUo1JNqS2eEilc0jtnxC6Bqp8CYN9GBFkkSHN6gxyJ8U17+A944WycA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3174114c-3f65-4ffa-6bdd-08daa1c5ef81 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:32.6305 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DBPUgwtxGpoxECuUwpNG7kNUqdmawMsK3I9BkFPEFFk2o832ek8lqT67NHYAwZdQcCmjkmEjTIov/lr4688Pvj2HqDnYJIJJL8wY1fR0itE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5653 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: EablzX-PXClsa-aw0gO6kCtcSgtODe9F X-Proofpoint-GUID: EablzX-PXClsa-aw0gO6kCtcSgtODe9F Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is going to be removed. Convert to scsi_exec_req so we pass all args in a scsi_exec_args struct. Signed-off-by: Mike Christie --- drivers/scsi/ses.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c index 0a1734f34587..c90722aa552c 100644 --- a/drivers/scsi/ses.c +++ b/drivers/scsi/ses.c @@ -91,8 +91,15 @@ static int ses_recv_diag(struct scsi_device *sdev, int page_code, struct scsi_sense_hdr sshdr; do { - ret = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf, bufflen, - &sshdr, SES_TIMEOUT, 1, NULL); + ret = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = buf, + .buf_len = bufflen, + .sshdr = &sshdr, + .timeout = SES_TIMEOUT, + .retries = 1 })); } while (ret > 0 && --retries && scsi_sense_valid(&sshdr) && (sshdr.sense_key == NOT_READY || (sshdr.sense_key == UNIT_ATTENTION && sshdr.asc == 0x29))); @@ -132,8 +139,15 @@ static int ses_send_diag(struct scsi_device *sdev, int page_code, unsigned int retries = SES_RETRIES; do { - result = scsi_execute_req(sdev, cmd, DMA_TO_DEVICE, buf, bufflen, - &sshdr, SES_TIMEOUT, 1, NULL); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = DMA_TO_DEVICE, + .buf = buf, + .buf_len = bufflen, + .sshdr = &sshdr, + .timeout = SES_TIMEOUT, + .retries = 1 })); } while (result > 0 && --retries && scsi_sense_valid(&sshdr) && (sshdr.sense_key == NOT_READY || (sshdr.sense_key == UNIT_ATTENTION && sshdr.asc == 0x29))); From patchwork Thu Sep 29 02:53:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612200 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A4E9C32771 for ; Thu, 29 Sep 2022 02:55:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234807AbiI2CzF (ORCPT ); Wed, 28 Sep 2022 22:55:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234818AbiI2Cy6 (ORCPT ); Wed, 28 Sep 2022 22:54:58 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12D4817E15 for ; Wed, 28 Sep 2022 19:54:43 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNiROR003466; Thu, 29 Sep 2022 02:54:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=IiUH5GG/3BQ9wwYU4lzcYnFaZSMe9E2CZT4vaCbO19Q=; b=yIWtz4AXLZKHTHRXm05dFLq7xyUfxvXfvWt8AYXaoDXtIDJG45Iex+qrAON+xarZHpAX K5+G6PIMODjSY06DftQz2lnbtK9gWqZJIRHceQbEGKAGR6BGi/DOHD4ZdYdad1yGuemr NlDNSwdmwi0Mhk4eTCeLapG4ZFXDLgCE5emBgGXHTO9z+s6OP0Lxaki41PHR9sC6szFw 2qe0NiQAeBTVMcMqFKpUWziZXmwIOr/F108rgKIb70TFW2PrY2wDS4GhrqQOPLGwmROj r5pSrBqxeMqG0bRO3YvYvoBHveye0MUQqOmC52kbVxn4/2aR/7YkjbO0SWJrcLpN2VWu 1A== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jssrwkjcd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:36 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28T0sHJU002307; Thu, 29 Sep 2022 02:54:36 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2172.outbound.protection.outlook.com [104.47.56.172]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jtps6v7h4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ck7DHRE+wxrHs9BCnaFr/IZDcFmcr65frHBZRo7/OrdgEw+19nWxjR16So0rdrjEkqFlhauCmfuzwRDh3+sKmFKusJWcZmHOdRBN4jW2ZkDU//FwofwFpxIYA21UTVCXQJUdqimaP8YUhHfDulmw/QEeMGvLvCMjhGcVy+q6WNMh3aEPEhly8T0egqsB+hOj8zmwQOz7PQfKKE/qzReqv/Z7TU0aeIvAg13lnu7S1ZrP9H/ewn2R19LuLmJ2S37u5y0Xdytoj9m85gC+icZ8OCjVSpWA+CoGc3onz79nA2bEAC+/4cQjOSKvWfhkTQscivAkLdBRZsoNeKI2/U7s2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IiUH5GG/3BQ9wwYU4lzcYnFaZSMe9E2CZT4vaCbO19Q=; b=fH9ltU9PBPs1isGPYsJAaRNX7++k3hqGMX3JtxjexpLWJFakmbD8CbQgUAogaLE21tGIJsRc5L3+4k4mCWEYoY6xhamqgZAU5LzMXSc+NOOZJc5kegLSQUoLFY+h11P425Euo9LShjNdPqULwlpN3rR3skrKS5Q6TKppa4iaTfYYTVtNckru+pMYtaQ0s4GAqQpkOwTdjmNex6XcRA09VCkGUJIpNrk5MgRqKK2V1jhGNX6PqXl2AxSOoDpMs+5fyARskl2Xpc32yhgGMkV6u6GlGZ1XZB+7v39Mt4sjnHBluXEauko0rs/LDV+RnD4epPbm17QzvWv5M0lCENCqyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IiUH5GG/3BQ9wwYU4lzcYnFaZSMe9E2CZT4vaCbO19Q=; b=qyslTs/VuE91Qq3OPLZrUi1kWWbVaiR69zetZ3vP/JS89Ngw03OSNZIUGJHMV4HLEGajfFPci/XCexuYuLGKRjkANWBmVzFkjHUgqgeOL88dovjWGYl3982WIhqPVUPO6ZzAljx/gbMWfCNqNGuW4owF23vYTpDta97RWlocFhU= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SN4PR10MB5653.namprd10.prod.outlook.com (2603:10b6:806:20c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.19; Thu, 29 Sep 2022 02:54:34 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:34 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 14/35] scsi: sr: Convert to scsi_exec_req Date: Wed, 28 Sep 2022 21:53:46 -0500 Message-Id: <20220929025407.119804-15-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR04CA0065.namprd04.prod.outlook.com (2603:10b6:610:74::10) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SN4PR10MB5653:EE_ X-MS-Office365-Filtering-Correlation-Id: e062743f-00ea-42d8-0ef7-08daa1c5f04c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: r8o87gcXbiwjk/VnXF6RWS7yxo4g367QaxKro5zKA71LB1EAGumMX310odwuMwM+lShOhdWbc2pVkQZovX7HaFcwayqcy+yBnz0icuUn9GnoIwnqA5sCl6dBMLb7GOLWaTXn6cLu2XsyS78d43GyJl9IHHDnlBalTYx1eA7QtMYeXvztlRKypE8fIsBV1QlIpKvEwuEVe5iOzoUDL5EmLsp1InDzg+xv9STlluGERqHHN0P1NlGwhVEhGDkpL8iuUkjT7cw4/bmy8PG5xTqstg1RovxJ4Fl3aTDW4sBq6Yoy5nqV6pBxjODJ+QklCZdNYDadfskyxYHgG6656uJ8dlrLlFma1lUAAaE64fqJPL/gtmghmOpHqwaK29+ZljZkez5hVUT0+v5I0BUGbc0/B3pyUBE/DCgglDW1T5pej1A3nvbn9xqSscz0sDrS3R3GmMKkVTl96YbpJMRIAelBVYbIBZGzgI4ebUVmAF5x0+D7F14CX3u9W052EE082GLom/OJWubaaYoypwrtOR5EWQ9amJmtpYUHwFiC1eu2P3IeFwdgizmAxxvSkfvO1eTE1VgsotNmOyyzR6cPmuKanTGQLHGONSt10NaJjvXEbSjcPHJiwETZ1odkF79xQzOakTOADBBNbPZ2PpifepBPIaSDFaJRe+3GWd/3jgrRdivOi+sapxvX8SZtOmSMLdLHdAwRjCiimEuNI3NrRFSWzA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199015)(66476007)(26005)(6512007)(1076003)(186003)(2616005)(36756003)(478600001)(6506007)(38100700002)(316002)(83380400001)(2906002)(6486002)(6666004)(107886003)(8936002)(5660300002)(66556008)(4326008)(8676002)(66946007)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hUzsmZF69onCPRRKuqZFcepOUALwVz9b5ZATiV9giXwqgaCvC0DGdOWBdQIY7Lg4mB7MxeVHEsidDlbaOFAinvHr6LUIS9T8vULE+ZW09uOECLVpYuvLpHsFLmyE5DxvtCIIZRNXd8eWBnAPxKzmsDbILweEPuaj+4I7FgpA3vx6aSS+aF/iLVnwbC/465xbw8uXA7iXFLiel0lv0X9J3bDM/2k8dnpFlR5+Y91a0Lyr03tUR1YJnYkllUM8MTJhb1uggOjZ4kWLLkG5tncr071hiXW/Mv0K62RQaMlettDig0YJcZZMlTHz/WQqItmT3AbKyEbFusNUBPv9jIzsgDtaIdSXt8pjrMkm9ebrCPgpkQKVasYYpYEqoPfhsnbh5NJMHM3253YMblbEPgezm25UCkf8exivT9p4WjSRkgp6QUp0f/lmFNCwcEvsc2+42y17FZf0rA7OP8yPE4fxb/Yuo/i4Zb0EhHB4aMh2vPOJxxleuz0EwSXe48ltin5d+F4OCAWAJpg+hwOB82v5VLLACTLAnKFQuhQeDqcVVMjK8sP6i8md9KnZY8+ocbOdQhC4CaajfKdy/vCaMVAv+TdlGiLFoWsVRKYCZi9mKNi/xRD55vMtmbYaiVL4FrJaPiiy4Et+y1xo45HHhp9jL28f6/2sA3kaXV2nAngoehlRFlcsVY4aLSWLL72MP4DN0+PLqsDnWzWtXW6Sczvm/cFqMmsGX6XNwi/T53gva403RMp+LCuLaGsCDKGRPMDD3FU4pvi8Gn4aqP17ElG7k2XzWQAW59IIzfmZVfqPctfgNt84tefnAtDZgC7NwwVvTzZQUOdOY1oDyn673qdvapFLQ4rhuCdpUAv1fEqAZMEK+uSvw+jUliWpbIvRaV0xb3UPL4/u5Kmq4H74smpnP8ZHW8bSLMErGTQ04hayBeL31FYflt0QKg53ykDIkU/PE1+WRGZ5zlbW+kJeg7v/qIHcKUFEnloqHGExdYZSIUtSu77S76+/MjmUF/SQk8Jt+i/c+xIOFcBMnJlV8W1CHOUvzQBBfnCyTnTdckY5Wu/0K/QXS//TpUkZVQIFl2M0MIplA5/+ZMPDDrH0WklxjQgrst00OM3E//EPm7Sepw65mfQt57KFJ2wR9S0InCJvcY25efi2gSufbevqNteWJHtSRVZjgme/gZ+e+/aXXxyOLJW4Cjhhk+7JQAzcPVQYh40OMJ8rNMTWf703vOki5jbzks9NZuwNrxVmLkHhg5B7Sfp3hiA+iZNrg2wIWrqt6GtMT4XHLCKAtJISoDt08o+Jy00pWVWCnTaGbKoKcVbDhFc8kveyIOppd+LMABfo9K2yuIUQNCsCRLyJxe6rhMizLjAxMsTsQsIjMOGUo0e5MEEUA3/udJhNRC5GK1q1pQkjBvZ38GwYphiVb+pQW5fnut/U8LWveUHeoQlb7W+lCTHwmf6dZjtdrwWlu311fiO7qKrpvEhCkkJU3tcqRvP07RdAp5l9t2HvWigo+yhmiSVwJ5vdEU0q4v0+Ob2towbKcfPJzbQ6fOhMWA4Y7PTWAlpc3Dx7R0ay1NDSUH5C0j5+l6aHRmPc7B9SrJ/QELwXF16ybtPvKWelNm+8Zg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e062743f-00ea-42d8-0ef7-08daa1c5f04c X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:33.9742 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IUC0r0bGxeK6nAxjzQoOzfotv2+UMOUjl75/rVITwb4y7xmuv3vMEUSODgFMshqcrUcptrn10r56Gufm/xYWAWTRybZckKwpfJZ84gjRadY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5653 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 suspectscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: OujJ1SpXqINymwLBpv6uR0jTlsiGh6-F X-Proofpoint-GUID: OujJ1SpXqINymwLBpv6uR0jTlsiGh6-F Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is going to be removed. Convert to scsi_exec_req so we pass all args in a scsi_exec_args struct. Signed-off-by: Mike Christie --- drivers/scsi/sr.c | 22 +++++++++++++++++----- drivers/scsi/sr_ioctl.c | 13 +++++++++---- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index a278b739d0c5..e3171f040fe1 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -172,8 +172,15 @@ static unsigned int sr_get_events(struct scsi_device *sdev) struct scsi_sense_hdr sshdr; int result; - result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf, sizeof(buf), - &sshdr, SR_TIMEOUT, MAX_RETRIES, NULL); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = buf, + .buf_len = sizeof(buf), + .sshdr = &sshdr, + .timeout = SR_TIMEOUT, + .retries = MAX_RETRIES })); if (scsi_sense_valid(&sshdr) && sshdr.sense_key == UNIT_ATTENTION) return DISK_EVENT_MEDIA_CHANGE; @@ -730,9 +737,14 @@ static void get_sectorsize(struct scsi_cd *cd) memset(buffer, 0, sizeof(buffer)); /* Do the command and wait.. */ - the_result = scsi_execute_req(cd->device, cmd, DMA_FROM_DEVICE, - buffer, sizeof(buffer), NULL, - SR_TIMEOUT, MAX_RETRIES, NULL); + the_result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = cd->device, + .cmd = cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = buffer, + .buf_len = sizeof(buffer), + .timeout = SR_TIMEOUT, + .retries = MAX_RETRIES })); retries--; diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c index fbdb5124d7f7..3d852117d16b 100644 --- a/drivers/scsi/sr_ioctl.c +++ b/drivers/scsi/sr_ioctl.c @@ -202,10 +202,15 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc) goto out; } - result = scsi_execute(SDev, cgc->cmd, cgc->data_direction, - cgc->buffer, cgc->buflen, NULL, sshdr, - cgc->timeout, IOCTL_RETRIES, 0, 0, NULL); - + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = SDev, + .cmd = cgc->cmd, + .data_dir = cgc->data_direction, + .buf = cgc->buffer, + .buf_len = cgc->buflen, + .sshdr = sshdr, + .timeout = cgc->timeout, + .retries = IOCTL_RETRIES })); /* Minimal error checking. Ignore cases we know about, and report the rest. */ if (result < 0) { err = result; From patchwork Thu Sep 29 02:53:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 610826 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0ABE3C32771 for ; Thu, 29 Sep 2022 02:57:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234411AbiI2C5B (ORCPT ); Wed, 28 Sep 2022 22:57:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233938AbiI2C4y (ORCPT ); Wed, 28 Sep 2022 22:56:54 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10C0411E0E6 for ; Wed, 28 Sep 2022 19:56:53 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28T1T88W018191; Thu, 29 Sep 2022 02:54:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=u161WvevX+5j7BKfsOo/pm7ZEhl+MUf9Ydb5jNnekK0=; b=nZW5Qz9NYwONBrnd52XaNwlDQy/mwnagduochdLrDBnFXz7ZqkbtGcZxdOUbb53zO3wk s8gZv0+kWN2qiHMOSRp0zLJaoZsxshIFL/d4I9KJ/HwuUF86U+TOC4umEdPE54DEpKuM nbaDfm1rEerctFRehB5GIfM9nic+ZIkY63mNuw+vZo2/78dxfjY1JsMihG7faWpRh7P5 6ft9X9rcZKaD9xeWohc83o+6RgCfgZHmhNj5VXiNgBQm18PR+dzYf3DwOOVErGCC0RdY f7oH03lv3Ryakw6S5pA9or9w5rcQn4IoYxELv8jl4bIED6QtCfZjNvR63cDg1uEGlJNN sw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jstet3uee-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:39 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28T1aFGN036988; Thu, 29 Sep 2022 02:54:37 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2103.outbound.protection.outlook.com [104.47.58.103]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jtpvfv4tb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ajnW2bohi4jSaIkd7ZSdYAqtzr+E+h6fM1CHSipUVCBfepHJPwS7tGEYokzm5jhqee5i+yA6Yp7hvo7PcVLzf2wQqa6A2h6uUmT5ep9WzmKr1h9ZUJ+8dyMv39VYafzo7lq+nMj+bewHpuTyNVPc50ZH72bhDFfrm9l0DKvh/JGtO5uvMZWBRkpC9jTw1H8mmT+wfF98LdwYCw/u2dH3QY1kX1nP4YqkathRcj0inVOdKzh49tnRZ/VxXgM1/LuLdus5ev2SaqnuqDTRDBSGaHjiO6zHCOWdloSKWs6mOfbDeEFJ1NxcCMR5FLcj2ZZIPm6tHoUEZSmzUCHDQnB15g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=u161WvevX+5j7BKfsOo/pm7ZEhl+MUf9Ydb5jNnekK0=; b=WnjhQ4wUB/MO2FFG1Qay1m6Pdy6FyS26/GDcblYhRh1BbXEoGpnDg2Q3wNuW+J/9QesZLwp3D2oZjEaRVHR2kefTYqRzpKLI3Wy7mpmBGiNrPEhDfnGc+5LRM1AdlTX+awHJUl/SU95F7SKUq6lWg5dvKIhin4sxtZSiIk0vuq2BHCk1erS14kwBfnU3mpqI85dwz0hv4oxgAPa0cw740L6pQhXGcNDM1JOlVtEVvHWJk2K1YVWBFptWQMu1Q8x5aHO5YyPsd5UGKPBqW9TSeBmeZTmpkj3rgrmABXrtOKVNJilG2a+yfLjTM9CJi06ho51Da0k1kgaGAHQTrQODJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u161WvevX+5j7BKfsOo/pm7ZEhl+MUf9Ydb5jNnekK0=; b=wYX9E/MyOwY4P/YHPQhn8h/V/fiW0MdZbTyBgHIaiDAeamr3c8o4hc9jT81vlKa7+u+4ebGz2l+LozC5Lc2SFW74yGJmMMXakExak2vsTUOmfrJKBapbWQSj/PdAeIlHJJcnbUs2NkbMpPLAc2SJEGnWS2jtpAk2Fy1ZLrNqEdE= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SN4PR10MB5653.namprd10.prod.outlook.com (2603:10b6:806:20c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.19; Thu, 29 Sep 2022 02:54:35 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:35 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 15/35] scsi: virtio_scsi: Convert to scsi_exec_req Date: Wed, 28 Sep 2022 21:53:47 -0500 Message-Id: <20220929025407.119804-16-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR07CA0063.namprd07.prod.outlook.com (2603:10b6:610:5b::37) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SN4PR10MB5653:EE_ X-MS-Office365-Filtering-Correlation-Id: 0a1a332d-8337-4ede-6231-08daa1c5f127 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IWtOLm9rFyOruWQ2R4lVCD1sOW4CNHScB2TP3IX+0a2E0mRjXIhUkELab1RboLdFlo5bP/rpRHDtVEuQZU4x9nixvyUES5+tNR24Ww9lh0id8f0yd3bZAKL3sICbBPc31jBTt1fhWZVMuk/8jt/yPZ9tK0Xg6MLanak6jZDaxFN2Zad+yX2wTOilGIWIupdqr6zngQ6ceKt8l+oDKDQdd7E1ioMLwWUyERV8wZpr0tcrEDIEBp695FVHNEVKLZmPz5S+f5XJuA3qmd7JXad4oZrlVcV4DEqVXsA5l1TjvNAWedVf9y2Hce78tvxSbG9jT1hx8oJScwNx5GrPwOYzMTmvtnNHY200gfTsn4g6Eph3ey3OUaOIY32rRi+E/18rpkNrlnVhtOUvRrKo4CeydfZoHtrF4+4KDM/EbDQ38it3FB+VdHtKjhYdRwj7fbLtXY+HHQbIm7PYBdgXG5ZernvOy1i8pT7d84PulTymx5kL+fzqNCl6KTbc3XpWoLIJY2Q842CjoxSNd01C0tvCTuJa2hao77Zwk1u9IPrASjkWGF7cFbczwPYSXXshMgUPEbrxeHewG2VKGHd7HeZdnsPLUcysXNX00IJHQL/CvQ6SxWr38KsaXYCo2Jp2AVXQh6uzpAtzHRoXgnZty9VhmbizyBjrZ5CLS+HxJfTvqW17Yfp5AQaA2/sX1MshzAVV9DicOy4yqMEWS7uzu9+NJQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199015)(66476007)(26005)(6512007)(1076003)(186003)(2616005)(36756003)(478600001)(6506007)(38100700002)(316002)(83380400001)(2906002)(6486002)(6666004)(107886003)(8936002)(5660300002)(66556008)(4326008)(8676002)(66946007)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YqjFCmShGr2PCUwwu4HJaHW08YgDKbGDizFVDPtHZjEYIL2RfkVvX2WScR1vUEu0+5BK6tiIgzUwYuVmwzVk1VsiJr8YE1wRf9r2b4FM3Pwgk0T3g3HNR2SoCABZGfC/1UK38QlURsP5fxJkeXJVQj4TEczodfdIJCDmtH4uzlOFjBZeE49PEO/uYgaXSSBjeXTcAyjONoa758P5JY1nfdaVZy4lWJuz9tgmeObvHS6+i612GPTSvSnzjRT+VpF8Zxg+nqhTaIIiuy+TdHoXJQyNP13fbRFHh7YpwhLcZAK/H7zv+xJQgo6a92Yg9oDKMrCuDYKmgFzv0uczQ5Umr4chQjtFeCbZDn4tFLHpRqoatNbVNLkBKwQuuYKtLc6I4DLIpvqIknoPQgv4i3v41LVkPMzqndTUC7XmHLZ5AOdt38og2f1FMDyJXV6pY4sjriqw4cCRJKM2pIbGTq4OgWXnuqweJRzJ9n9zAUDwf7FujCIa6VKtX7QgjcYUcNFUlPwSlquHiSeAWlOaVEC5ck5WkfVCjeYYRs9A9cudlP1kOcsqNL4urwYOoXkarRICwR59NPX5lsnbPTIEkNI/mj0NCMydY2rJ6+VtE32ZxIG6VPcpUOv72/EUSaKStRZenelusf70miPof5yWIJeyidCDjAogDwwkm/OteADPoDyjrS5D5avwXQ9+LOWbucvRaW20AdGmJjEpEm+kKKLcqzBZtHIPpXkLGcKPLQ94/vipcgi6YVCMIkCKbhpBibIqlmlj4pNX2ydKsmxU8V7DKtWdpEOpSY879By05jjQCSoMt+3oNjnrU20bY8KiHTKt9WjKRruie+waCCUNTErCAcZP1kl99LlKxh6AvJyMxvKb1yGcXUK2RygaZy0js8+Pi9bIiWGD2c1jwHKgxYrk+PwcX7qnT35DTkcDUZc/3nag3tNNXPSxrEfReVAk6iPuvLRyslnmh4YNJpI2ele1W+7o6iTYEsH2s0j9ywh0b1Ay0t+J6ptailooSwm7IqSsTD+6ef4rVaxOKd71Xli2odMaLpKJb7n42mphj+EbXsZoQCS/yAEy+cs2zTvpXTzymekSnzwJZRrNiaIV8r5RR9XzKfczRUFJkIinq1bbRuJJCcKWJJWRXl1CYyeDJ1jn8NrOTytpJ2v53YTFajPGkvTEnhnlsION/S60L/qvl2XGNkU96q19M3x/nuqJBo0HL2dr/IvY9kzBYSO8kD5+vT+qQXwZlznDopxw6Qt73xZjJJFnIstJsXHzuGuzsnq/bq06nwIGuw898FKXprBG6r9y3NcYT7uqeIm03FNngwaTfo6MeozrmeVgDoYMyc49CyZeTgDVUObdYD2ZW+wrl9yeljmThhZ/qWwyAQgynxxm9z/Fpr/aQKJ5f3lYIam5DuzCvCkq1Ews0LoJRjzTO4EwbEMFAiL42gjuXGXT68rdAXJb3ZMlidwn8TTE6co+hUEVBrZ4DhvQ9TWQR/OLeYiQ0jpma6pDNrxFGPBzPF4Q7xFBYQaC/3VQWWZ0hKAaejUVmbZz+XwVQnHJ3bgCuCtFNLroiuic90QpZL1HJUwjkiwGSqiz1L2gvH6gIiU1X/gEQ9m+NDmPlPGgLjTUwQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a1a332d-8337-4ede-6231-08daa1c5f127 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:35.4115 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: so1kR3p8fTXRxCFT6KSTU2dbwecTILtCSC7BBi04wE2NDTryE2JVSbMuOrZdlpepY/fPA+SrtNZ/29sX+XIAm8HrsvKad+O4kvqNRDyFCNA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5653 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 suspectscore=0 adultscore=0 mlxscore=0 spamscore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-GUID: ccFoWWLgLldgWtHWzNy_O9vt4TLCrxb9 X-Proofpoint-ORIG-GUID: ccFoWWLgLldgWtHWzNy_O9vt4TLCrxb9 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is going to be removed. Convert to scsi_exec_req so we pass all args in a scsi_exec_args struct. Signed-off-by: Mike Christie --- drivers/scsi/virtio_scsi.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index 00cf6743db8c..c86a3c035374 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c @@ -347,9 +347,14 @@ static void virtscsi_rescan_hotunplug(struct virtio_scsi *vscsi) memset(inq_result, 0, inq_result_len); - result = scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, - inq_result, inquiry_len, NULL, - SD_TIMEOUT, SD_MAX_RETRIES, NULL); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = scsi_cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = inq_result, + .buf_len = inquiry_len, + .timeout = SD_TIMEOUT, + .retries = SD_MAX_RETRIES })); if (result == 0 && inq_result[0] >> 5) { /* PQ indicates the LUN is not attached */ From patchwork Thu Sep 29 02:53:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612199 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29CD2C32771 for ; Thu, 29 Sep 2022 02:55:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234828AbiI2CzO (ORCPT ); Wed, 28 Sep 2022 22:55:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234838AbiI2CzA (ORCPT ); Wed, 28 Sep 2022 22:55:00 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EFBB3A17C for ; Wed, 28 Sep 2022 19:54:51 -0700 (PDT) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNiI2d023216; Thu, 29 Sep 2022 02:54:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=+slA+0ujzknxGPvZF+6UT1OfWE9CgTqv1t02yTp5m5g=; b=tCve1JtsUV1dAggEEZ5j6D0mazmgRX08ur5aqg5ZcjbmOWjKRLFEc1Q+jcUpkmK8+gY3 nmVmReewpyjDmMEC8wYWowZctY77tQjsD9j+qfy3tTq/KhSs5f5qlRMea372EW8DISq5 cHvRr0wReLaorWosh+v5yTB0CN5uKXbTWsFcisIT0sBP/xg4mSaB32ktgLc9O5ZbnwK7 /Dgtvrd0mEdvQyn5Nj5oNlT2XGKPKSDTBzeIlb0cedqmBlQstHVxsfQJyPPoAl0tsvD0 3ju4E3S7KjuC32tKibiCxHV/9hKU/sNHVTiX0OLT1hnSl+Ml8wP9q5hfsGHowjCjsQoX Yg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jsstpu2x3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:38 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28T1aFGO036988; Thu, 29 Sep 2022 02:54:38 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2103.outbound.protection.outlook.com [104.47.58.103]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jtpvfv4tb-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R504XbgWVThoNNRp0gC8Y2b7dV7VMxtE9HkNqMm70Mb+TQ0vHkWcZB7+UWsvSoGw4aWjuDtPTZYgfRy+l1w73OZdQPj/FGBDkpS9BKg15naLCUC/mXSjLST6WXzEJhJuJzKN42B+7rXVQf36rUsrzPI/A8xE8F0lmAfDn4QmvaP52FllKb6tr47QdGgmRMrZLOJPsELfS2z9dz7tiKDQYHJkkSXmyHPjsujRix12WMEJ9AhN+kixXG5N+V43dCHIM28dH/8+pIeVS128aXlWjScqqrYJoUkuLCQGDCiR2TetD1OGjkivYGP/UWZpe3LN/GEYUpVf4r4cNoIt/DA7Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+slA+0ujzknxGPvZF+6UT1OfWE9CgTqv1t02yTp5m5g=; b=FZPtbFdQ4vpVy13e30aXMkdDrD1IOn4+xrQ30W1BmGxleR5UUXbJRA/u/oevI3QoCSDJS/D3ZLIZl/OnRb68e46e0yKGeOP3Dn/V7g/36am2kbCyNhhP3BwZbCiil+UFLyHeqLH0d7aUdhP3quajnDa7+eB2/Ke2jaSboIBa19pJCwGpVu7YlSdchq8PpVWvDe/rjTVP21Tv3cSmQAk8UcpbRn6s5pH119I1mfgFy4YArrD/FU1B5rO2sk4LdHdriDB4NMbKY6BJHVXxc7bZCVPfLnXuhwcl2rQPG+WpUenWeI4K5bybc+V0FzH4YuwLG14GviohRcbI1I020a7+NQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+slA+0ujzknxGPvZF+6UT1OfWE9CgTqv1t02yTp5m5g=; b=yghWWYyheIBuy4cMW1Ud+a/ERgj0sw5wYH1g7pimADAKW8BWNpT4HybIGvsc8pHd7DKr90KLKEZxCKNFx5oqJo6aqdqGmLMAkoJFMDAqX5lD0pHWSEOLJHVzGW9w3DXed6iFI9H/E2eQWSSn3THv1eV9z/Z051Sj6J4Ri9qkbLI= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SN4PR10MB5653.namprd10.prod.outlook.com (2603:10b6:806:20c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.19; Thu, 29 Sep 2022 02:54:37 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:36 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 16/35] scsi: target_core_pscsi: Convert to scsi_exec_req Date: Wed, 28 Sep 2022 21:53:48 -0500 Message-Id: <20220929025407.119804-17-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR18CA0014.namprd18.prod.outlook.com (2603:10b6:610:4f::24) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SN4PR10MB5653:EE_ X-MS-Office365-Filtering-Correlation-Id: 8a5f7cdc-ce4b-4abe-dc46-08daa1c5f209 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TR+XiqeE4F9dKjgEG53z2VuxgRVAI3qWl/H9HXp2P1/fAtyxMNxUonFrvZ+0OhzX/hMjdpb+mlth7GfN6qaBmcYs5bA+blFUO68K5IQmvAALM8zk7HXuADnNOJsXxK4oV+xw1MobBSwoXFSK9Nj/4Oef46d0KBLu93/D+xJ2aOb/pkpWc+rv5y8FTIc3bJvOnVwlOrDnkvzvxwPksz7EPuk4tx4NkRmPQRjYkuIuOewRjmsOnbr2HkJq+gc7+e6G9AKaGlUl3ltKIHFW7jIT9KniiHcZsV/uXMMjV+SMMcWVr4h89aqCdKj8mm+ylXNk+typz6Hu0jrwVBe+Jy0N6uVp/nT4N3pZPyKr8nbeKsRAzE3yhOWtvMcd+6Uqpvf/nFE3dEsSphm/mL28EtOkG6n5uIuclNmU6ANT9XT41pYpXrAfJi1+gmTBc1gwyrhtu2MWcy/Ys2oB2iKc4O2IIpovwX3frnNdgJu+plD8EN5yRnn004g4hkwUIbZ89BzdG/lvOf8lAKwUKv2NhZacM6NbVA+K5mgqy9Lwfhp57H3g6i1TzSlw1r37jG7HzL5O6Jtad35F58t/lhbAi72lx++5bf5gcekG+vIbQrE+1BsxzA3i1dJJpDC2TZN3POuRzHyI/DwHCQ43BmjTdwCU1u6i9vlEZT0w2RGc568ihYS5pfA7YDb0vgL17IFJXdAwCyLlhKUi/Xqs8WOkbwDcXQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199015)(66476007)(26005)(6512007)(1076003)(186003)(2616005)(36756003)(478600001)(6506007)(38100700002)(316002)(83380400001)(2906002)(6486002)(6666004)(107886003)(8936002)(5660300002)(66556008)(4326008)(8676002)(66946007)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eWYiF6lbtVJl6Ea9kc/HLQ1IycyFPQaw/+I+74xXOxI09OOFFmhXAiNFDramAdk6uhTw21AD6XroKImKynDNNi++9d6lkGrjsyIbKNy+T8cmcuubBeVrvIqwJWOC8EkaD9haMw4e498of5ZOQfrw4yJfjuxPZJysrShsut9z6v2i+a1gMJoKasrwYleB1cBuQUwtsNy051I21pnccTRIJg1ZtajOcaCHRIvlIAeMpXoUR817oFBjrvxF9MRqB7q+U4lFEUXK+fGQfRrGI0FbZhoSVlOufXCP0xV6trcd0xrZKw7dhJoj0SBqG66s/qk2NGNA3tW8uzP8ZhH6jM/SNY4d/Muggo51v2d7xPmQbLuCfs2TmXxjy5ujpqUAj1I/d+S8PJiRNcFuWoK2JYHwtVdbvdt9WRX6+5MGlm3lZUbPBFxgZ6FPQVR5Ji2ThsjjlxNFJrLSzfibC4n7XQuIqBpHFzo70cSAsYjBtxPGJ+m2bcD4oM1YjZN9GaXY25Z8BNxS9lSzhcd+JViFcIrasYYxDZiYmgVA3+2oXPj6NZJqKR5mS6nevrMOD4bNiAqiUdDTjBA/z0cx1QASb02Rdc3RMcl5F2FGSLpd++ZN0Xgxp5snrTd/y/msw0j3dhicCwJ4b4Osw1OxXJLHrIwDDuL27vIH2wjbj3Rg0B/k/KRXZVW6PKlV32t50+AMZIprSidzZiHvCVH4Br0E4nven6c34CT5R6uLYTepzxP0hqZOJ727BMeL1k4kvIvmskQahyIjKNKPqxWYWtW1eP11elqBopyN/+2xJ/P6eeWZeExHLuEoSiiWpYKbPxza5eV5XXq9YA1z3L3RXrcDzWAU+dq7K4ZvQN3D7DCOKuKRBHfORCdsYI01gHQi65hjuXK9ODMj9nrUa32qMb3OeUrIqb+c58VjLtkScQ+1G44RtemndXmkAogcUIfTjiWdHEdemqFh9fCQdU4TRxsC8XWmo7hBMC92gfIdN1Uj/o507/MdnBaOr/xCeLLkZTpA+Fn4MCZd8EIB3Gyf4P4M2Vqo/ztDfewMNNnog36KP/01SH0Kb76z5WdsEZcCixUTGlHcArjt5Cv1oXAnAQFDHyj951gs9G3IuIxw/DlCr08MfFVHnWGIB43rFrweVIvSycXJeIQ6d5DF3CpH8RmQHVeKtFDLHi+0o8XdXRbJ6HulsmesaMIrHo8SZ2Pd2aEDwM9zHl2dg5GjTLei0YC6GBTgy0USuNjG5ByQm2lx2gXboQv57qZYVycuAfW+DIuZvL+0Gqa0O57u06C2uFQXq0wgjMIPgJDL4oqBPkY9XYfzU49LYdWNn1xpmbpe1vHXpq23XTx+dY6+k8KrJSGFR6hnDOt1QKBkvWPhj+MPilUhaIs/6epcoRNA6gWsRwIt0Z3UlaFf4leVPGKRdJMzxNNP68ChwTFllCPGY2s/GWTEm6etQpUdcCpIDf6pDUTc+f3MFiNXfsIROtXiZ5XLTrfU4lvR0wKyPYunClasOKrr8kpfITOZPhQc+/fThgeUObPFMvLSibpWb4xzJehsrj2Bvk7aXMc0K3yfoHW+HvGseFYJ06yi+ANVl6Vil3t7lxZv8cZ073br9jvvjhE4bB/Rvg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a5f7cdc-ce4b-4abe-dc46-08daa1c5f209 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:36.8645 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: B11ojzHaXjexmCiEvBUZPSoEkKHqRSQcskdkLIC+XdsNwPzqIF3WRK8958C7sqR6ZyYtr9CESERs7T7GeTqMCehh0eCL9oaZWiAqJbt+eco= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5653 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 suspectscore=0 adultscore=0 mlxscore=0 spamscore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: 9ygZxQhV-ipT4H8o4DTkLPp6a7dyRK8h X-Proofpoint-GUID: 9ygZxQhV-ipT4H8o4DTkLPp6a7dyRK8h Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is going to be removed. Convert to scsi_exec_req so we pass all args in a scsi_exec_args struct. Signed-off-by: Mike Christie --- drivers/target/target_core_pscsi.c | 31 +++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index e6a967ddc08c..83c00343155e 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -144,8 +144,14 @@ static void pscsi_tape_read_blocksize(struct se_device *dev, cdb[0] = MODE_SENSE; cdb[4] = 0x0c; /* 12 bytes */ - ret = scsi_execute_req(sdev, cdb, DMA_FROM_DEVICE, buf, 12, NULL, - HZ, 1, NULL); + ret = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cdb, + .data_dir = DMA_FROM_DEVICE, + .buf = buf, + .buf_len = 12, + .timeout = HZ, + .retries = 1 })); if (ret) goto out_free; @@ -195,8 +201,14 @@ pscsi_get_inquiry_vpd_serial(struct scsi_device *sdev, struct t10_wwn *wwn) cdb[2] = 0x80; /* Unit Serial Number */ put_unaligned_be16(INQUIRY_VPD_SERIAL_LEN, &cdb[3]); - ret = scsi_execute_req(sdev, cdb, DMA_FROM_DEVICE, buf, - INQUIRY_VPD_SERIAL_LEN, NULL, HZ, 1, NULL); + ret = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cdb, + .data_dir = DMA_FROM_DEVICE, + .buf = buf, + .buf_len = INQUIRY_VPD_SERIAL_LEN, + .timeout = HZ, + .retries = 1 })); if (ret) goto out_free; @@ -230,9 +242,14 @@ pscsi_get_inquiry_vpd_device_ident(struct scsi_device *sdev, cdb[2] = 0x83; /* Device Identifier */ put_unaligned_be16(INQUIRY_VPD_DEVICE_IDENTIFIER_LEN, &cdb[3]); - ret = scsi_execute_req(sdev, cdb, DMA_FROM_DEVICE, buf, - INQUIRY_VPD_DEVICE_IDENTIFIER_LEN, - NULL, HZ, 1, NULL); + ret = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cdb, + .data_dir = DMA_FROM_DEVICE, + .buf = buf, + .buf_len = INQUIRY_VPD_DEVICE_IDENTIFIER_LEN, + .timeout = HZ, + .retries = 1 })); if (ret) goto out; From patchwork Thu Sep 29 02:53:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 610832 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00FE7C32771 for ; Thu, 29 Sep 2022 02:55:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234676AbiI2CzU (ORCPT ); Wed, 28 Sep 2022 22:55:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234850AbiI2CzC (ORCPT ); Wed, 28 Sep 2022 22:55:02 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FB6D3C149 for ; Wed, 28 Sep 2022 19:54:54 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNif6a020801; Thu, 29 Sep 2022 02:54:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=5MISLArN9WKkpB1Nvm+mLGf7XPpCiJsMkWkZsXc3VhE=; b=g0Xv/BlK62mWpt1YmSOCvZKd6UuslrDfFzUvrifrl06hcRiwEq8+ebUZ/Z7FFzO3fLDe o3Vz3g1njGsw9IUmC1QZfcS5Esrz8b9YsmaQs+DnfadgTzJq9fgEsYkCPVTBaNM4wS+v qeu+UmHnTbhtkR3YLWLAyZwtfpctoKnyrDwJjRjSy/kxjJolt+oRH9t7vvKI/XgqM2JR iK8Lw2T9lZIbAkmqWaUd3A482O3vPj+TM1xq4L5Xa4PlKVZRnH8TT2W8vydLCUl+VF+w 6G4tR4xzGcsTYCN9SOZAtd7Fi7nAGyorQ7EdR7z+TlMEBz/G5gsD6ykX+WtMZS8pGz5c Tw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jst13kgb3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:41 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28T0K0uR039524; Thu, 29 Sep 2022 02:54:40 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2108.outbound.protection.outlook.com [104.47.58.108]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtprvtcu4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=biyzC+Cqla0SnZIfbGZiEw7dO2NoLlxWXgJ9P/0BEeN28z2vujYkreQZA41CCtfDNYWPs55+9JKbq3/FTflu4cRRIOIbZcRrCPcu5WAIN/9Gidrdqi8yQbP6kfoT29cvbiXvV4+fwWtjS51HRqLJpX1LYC40mrhRLiBIh0GIyN1H/iE6kV+4fNgf777Hoaap8AcstZVWT0bulWFm6Msy911jsGD5EzxJSM2HlYtYLFPbk4+p++i77c8/ro0jnHlvOJBL0/4ty+rXwg5wKdZtG0Uj+G1v3Qoy5mhnRbgv+REpy8KKQTgVvnOhbYExjzT8wslASSCGlDSRzrBRgrG0Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5MISLArN9WKkpB1Nvm+mLGf7XPpCiJsMkWkZsXc3VhE=; b=c69BEV5Ns08JEJPoFPZ5T5xKBsJBkeOno0vc34OWVq1CvlSpMcSlwTjWDplzoe1Ah/ludt6bYqRT1Ur+SvpaUYEPei7Sg9JTYh7J8MN8Y1rdz8lj6pYN2yGe4UZ+88G4eVtH0r4hiA5IqOX7YAFRrJNahlc7e5jw7af06Si5qeikz+p4JyIlKRnsVPRQmH2lgLNV9lwXuWfBLUsRssLKjTg07dtFtlCZk34o0wktM5aToQKpfVmK0iusftPZ04ZiuFdebs/DRwJWGvNjKarkwU4rDE7P7UQol9LbUDiI80TtzjqQck7v/QILWl54Q40S3U11H47t46toWJnjovwfVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5MISLArN9WKkpB1Nvm+mLGf7XPpCiJsMkWkZsXc3VhE=; b=TSMR6c/uSZeb/AQDL+7+DHrx0emrsqtC31CV1hLFXYCHdHUOk/Ouc7wB3xpwy1L1ND1k9JOq6uab6TUgHTPQZZq8Qdn1IR5BSFE6I5ryQ3KzLc1R1JnAFDQGLhrqlezZD41VScD3kPjSX/6VDJ7sNFyUhklxV8XPCg0iDiLziPg= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SN4PR10MB5653.namprd10.prod.outlook.com (2603:10b6:806:20c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.19; Thu, 29 Sep 2022 02:54:38 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:38 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 17/35] scsi: ufshcd: Convert to scsi_exec_req Date: Wed, 28 Sep 2022 21:53:49 -0500 Message-Id: <20220929025407.119804-18-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR07CA0058.namprd07.prod.outlook.com (2603:10b6:610:5b::32) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SN4PR10MB5653:EE_ X-MS-Office365-Filtering-Correlation-Id: eb252cc7-a3ce-4722-a428-08daa1c5f2fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WAQhKrpfoDkb3t2S/ObWUrFRk/BNNrELd95XDiKwF9Sq+xLo/XjPPmnNaVxDkHbaPVoHoGu7jPvj3RJ3aVt2wO/y2l3z4McRd7O5U+pb+zHHSV/4FNoTR+w2ZhnlxL1kLU3gyZ9uHVvY6+mE50TQ8Nibui7HCo5f7/sW/J7zm/X/rERBeFmVZ3PGQTd5m9lDOoLA8VkzQYnisFwlyjJzWN0hvd17vpaFqEvlbOKjoLrNghIJw7v6U6euPD9QmCrNe3aWA4StD+sQYMGEKvV/R39XjqjXUsfglBLc9lFCjJI3xuOA0OPAloG4lT0lTXXQ4yIWIyAcQLbo0R2nMn2uNHP12qVFYsWeY2IMSm4JU9H+Ig4JIMo9lpVArWlSCbe6FEkOR+gGsCJzgod/8LEjen8lKet1Gy2Dc1BKSLZbsbFYYpdscrSDPn9Jd20cR9uDOwalbLz+w0m3KF2Kn1z42OMxgohtlqUIAWdyY5FlLPCvQ80eSPgUOSU5UX0SAw5waF+cGzxBuyYmWLX9fhjcwG0v88k29ZsoRg0gvYmshTk0P2S+PaJeMCsC5h+ULl24+VYQdwlpgBAqBLRIOH1w/EyaU482o5IEi0ayMkwb//IpGx3r/57enZhZ4mj8TyNCLU3HP0TdVsx4clAyq6VPZXBA8wftgymbGme+EHU8CpJ/BeSRd4TwQkhjqY1g+yMkmwv2/6ryF5+L8Tf2gpFs1Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199015)(66476007)(26005)(6512007)(1076003)(186003)(2616005)(36756003)(478600001)(6506007)(38100700002)(316002)(83380400001)(2906002)(6486002)(6666004)(107886003)(8936002)(5660300002)(66556008)(4326008)(8676002)(66946007)(4744005)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QkrL9BDlV19OlSCQq8QkKalfUYUiLuctCe0zyR+gJKfX+UOyfzSP0PxrnemjlfYD3XNyFgb22ThOrSKJ1LvWWFCXfuM3459CsIU0mZu2H+75X3PYeVyZvTlN5l3bFoZ/53k3R5KaWxXU9teYXCoNFGQTusWRhB9klhjS7rwkzfFgYRYIC0/Rz/6OrLw/8Bsx15F6mKclofFWies/Bwd9KPkBXM6UC+vltqpMiEE/jxrr+dBJ5Cm/CJoeSUAzjKuDPulnAHzY7esAoU9q6R2cS8Ee5aFrFx4TuefDujkOLRrgO9Xs/bqS6YkcofPNfg+jTnT4etPE1b9dZrv909teBXcRHkdZW5x4WaeUQJxUJSGdWJqn+OapWA4E3eFtZxZhRs2vTYxvURinLVJpQtkw+er4I3sAivm+1ZRpqSHIFkk/yTfhN7xX/ZrdkmmT0t7dS4U0T/a3xbprztvMxP3Gzp/y8CsSnSYIrIevIM3+4K/6ZWiX1xVdY2/DIqOcjsZmM/ZqXdgNFc4AntAXtzGd4o5AF25EQDMeyhWFg9dPr9hN3Z6PmqDSO80Wls2mQu4QW2+puKSzuUgHWXcEQYkwrBWZlgemUq7aaW9hlxoutrS7/RrlXHeOk8C3k33ZECo66qTr0lp9gmMahD0BFszgYuOubyJp5cZONxdIvTaI7pynZbWWb3NbLrEtg+T7VRv7ywT2VJ7ja5BFyVabOdE42TLYYuzcfZB9rK9CA5y2AIkoTAHbsE+Bo57Y1trShNdr4UaeIJiT/7m20qHZ2ZAMcxy1/U6dTKLDF+5rN1nNFnWS8qiRej63R/U7x6WuzBK6s4xiVW7PHPj8ufKZAWhv6/KCRaIW/LWIQfKi9KwhTsB5F4UNtbkYRFpR0mrb2gwpXK/r7UvgOBSFMq181eneiAiLUkybvD4PPftt6OH4m5ImIALounSmwF+x4kXt7UACq/snLneGgjlJUrKIUQBji3Df6OB2njNU62jP3xaQPyXeHWemOLnmb3wTGImP7guZptvg3eaa8ttaRggY+mjLmqzjDKHEgNJL3RV6kC+gpv0bURhcr5dX6FL5NSUSJT3dS3pMip7G7WnvXAeynbmiPzz6+VOQOwUXfUaYCRyje/MBOmTXOqQ8XNQilNICndXY3Oif0or5aCluB0PbSOlL1oJy7WTKDsTyiaVu+Kp8jnJFJlQUk2D3vfByycPdX8tmfqNbtTdLMGFVPCJ8cLlF5HIEgAWJQ1XjZbhgVEd7/7s5c6429ZdSEDKTFN6q5+XHMfvSE3BZbbW1Kjlpp1Xjzr+h6cX9I1BZt3B7/NTV8X1CXrQIwWeBFw6Yy0PprO3p1CkV4kpmUA8PLsqdxlJDYETG6XnF4v+UTXwQB2PdNFVYnaNtVla7RcIwvh2YD4d+S2UM3+prQUFnICkcWZcZeiDnlR2K0b7As3Dr63TlH0mnHIDagFc0P6DAmchvYbUc6+A2WxYeX6DSiKgMx+rqSLAiOQKdABd/sHnE3Hqt8Db3WDevTlttnyD6htFMDCW6FW1RVT9XjGd+Ir6cIHMXpMNyH6YDAddpfiJwAcess4HYu+719Z93qIhQEj4wrlEQ07HN/HpOQl8Y94KCDTqBGA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: eb252cc7-a3ce-4722-a428-08daa1c5f2fa X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:38.4894 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Dnj9CNUR7d6nPimikBs2vBiVonen9bIfxd2UiCEZ6qq14Gp50njT2I45uc/F+xNOOvr+Wl7Eud8BbKYG1EaxQo+uYxeDRkZXfUBqRfsYEzA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5653 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: dj_TVVJr4VjE4PmkksSFJM5fV1n41gPL X-Proofpoint-GUID: dj_TVVJr4VjE4PmkksSFJM5fV1n41gPL Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is going to be removed. Convert to scsi_exec_req so we pass all args in a scsi_exec_args struct. Signed-off-by: Mike Christie Acked-by: Bart Van Assche --- drivers/ufs/core/ufshcd.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index a202d7d5240d..fdea6809ec5c 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -8781,8 +8781,13 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba, remaining = deadline - jiffies; if (remaining <= 0) break; - ret = scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, &sshdr, - remaining / HZ, 0, 0, RQF_PM, NULL); + ret = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdp, + .cmd = cmd, + .data_dir = DMA_NONE, + .sshdr = &sshdr, + .timeout = remaining / HZ, + .req_flags = RQF_PM })); if (!scsi_status_is_check_condition(ret) || !scsi_sense_valid(&sshdr) || sshdr.sense_key != UNIT_ATTENTION) From patchwork Thu Sep 29 02:53:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612192 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A65BC04A95 for ; Thu, 29 Sep 2022 02:57:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234843AbiI2C5F (ORCPT ); Wed, 28 Sep 2022 22:57:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234745AbiI2C5A (ORCPT ); Wed, 28 Sep 2022 22:57:00 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BB9111F122 for ; Wed, 28 Sep 2022 19:56:54 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28T1TQV1004288; Thu, 29 Sep 2022 02:54:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=P47QewVp9LKx7wE4piOR6tYKPWFGqi25KE0IY3Eg02o=; b=SrGYeziBIovHtGTid9tDq41yzbmLko9PmoMFPylAQBTm/GEj1/8M4VKe8FEFi8fpqlJ2 4NAhuuRYBqfSVmMhsd7MQcw5N8DIdEJ5Xqxibib9L5U8EkOtGkel0CscpK9uFyYqYPZM qs0LKO9TzblVdeCWqrek+DqpRnro4z4ty9XdyVornCgBGfz/BtJPMvhyfLi08I20vkUM /eYquSxK6xHZwdItGd5CCXsWk75WNiwd3FeixkiKli2v4Bk8YcQumedm/8Xwngns8FCo UqRwAWGFZUwYFBWSpaBEzjS7/uKAxsAsfhoTXGy0XtQAfapf6AGrukMNsDg5djfwph2Y WQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jssubkhj1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:43 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28T2PEWu037062; Thu, 29 Sep 2022 02:54:42 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2102.outbound.protection.outlook.com [104.47.58.102]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jtpvfv4tt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yt/zU70zHCeARcyUENJOe5Nl2ZEwB/jn4PW793/cz1sYWpP0RtgWw+wRcv4gSbesH7AMbp/MmuHV4qVoxlJlw4ccQXAxCGnAzw59pGys36LNTGA+tjDz9rxXL3jNrgjMYsiqjCwVCHacVA2if7KivXy07qMsaUV7Hd7tCy3+fBywzzkjD90udgPBOdhoRO0fvGubwTgu/IZIUENVW8CM/mxLxKMJ+m7WJoAXX8bQdfy0WqD9lrTzmHCYuDfXEqc2OJnKC9LRu2AE560eqlff1abw3y6cHeDoIrbgugremvP02YH1xws+w9lahdgG73cAQ+ov6792TCJM25PUrZvFAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=P47QewVp9LKx7wE4piOR6tYKPWFGqi25KE0IY3Eg02o=; b=C4NT7scEKQzAd3H/bIWdvrXhWAyvG0cB3ULu6ogWnQwGYATs6FhfMBDHsku3/QBpnaGL87LsOB85X0P2KfVkmtKF1cq3T+85gxVvbDZ2ZHc9uoJxEXJSTHO7vA9FUY+w8wRt96Yfb5s+ohrC6K9Vxaily8VonuUWJ80D5OlqRwguJItYNu3G+yl4EnfGm/0NHi9vEV48yge6cbQwyzOVw30SK4oDWnGdGziOSEbrrylXa+OsGb+WVoXGatjLVcFjd5E/Qep/LQ3A/0FFCvVlRePE/tuUDxvwymlaidPWOtkKnD1/RbRaI8mxD2k1zPzSaRFZ/QXMEvPS5leG6ZksgA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P47QewVp9LKx7wE4piOR6tYKPWFGqi25KE0IY3Eg02o=; b=IEvjAyRP7MkQD5bmDNsoGQFrq++woB+E9nRTwlEB5tjljRXNPGlInUhObU35tsCT18Z8i5X4LPXv6WxceL1kvM+LV2JudpCb2OWHhqVo/0bPnxEWhHfKDiYiXNZH5jrzDycVSvhn4Z313ynSqKI5W6MRkFWCt+MIgCSV22x5wP8= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SN4PR10MB5653.namprd10.prod.outlook.com (2603:10b6:806:20c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.19; Thu, 29 Sep 2022 02:54:40 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:40 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 18/35] scsi: cxlflash: Convert to scsi_exec_req Date: Wed, 28 Sep 2022 21:53:50 -0500 Message-Id: <20220929025407.119804-19-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR11CA0010.namprd11.prod.outlook.com (2603:10b6:610:54::20) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SN4PR10MB5653:EE_ X-MS-Office365-Filtering-Correlation-Id: 518a311f-1e80-42a0-b9d3-08daa1c5f3f9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BHwB+lxdx61u8PPcJOP9hu56t4j4aKoO69mk3RU3hukE1o2oKJPme8G8uY/Vxyr50YkSsDBQlmRJIVYriP5X/gy7QfFaLFra60eQ2zcVINkvQha8w449/tARHZpgBNTnxmYZXQpcnHuRKo5//UVJ70qsdleeeRLCTyQhrmareJZRQDG02wN4Kk9PP6K5PxqGmLF/rK2MogWgswNk9Y9smxDKpsnxFhD9uORnYqgTJeLSgmjveG2Uhs68pfqZD5QMD7Nz8d3aYL+vXC1NK2zqUPOiCKKR3GdZMa5cnFdsllT6WMjFQhUhcNVWZbL7pjBHBdS/jYjZP2zUtsH4c92BOMvXGwfhTjvxRBvXjIFoNuoBULi6hknd/o4qAKiOfQct0CkcY1Bk1ayv5yDDQq5+MV0f01RGZymXhXp4hWiW6r20/by0jQfbpHXZu9QVqdVB9vuktLXv2QGfMnNSjC5ZPYam0vqriQ5rvf2L0Lf6DCMTzIQLZXqdcHGla9hoc9aHVhdo6Tz9fvp8nD3aDmW9foR0I186K+0+yLniTdRVZGwElSViv0tiGMLXgMKoOsv55gy5su1RgmQUQSw81oXudnR2jDO5K4tclXFtJz+UGV4Rv21UV+mulwATYGbfXJAyqP/qkPMBV5GCrmu5qmU+p64dzCDP1jggtYa/SnTJpd66EzOLN+A8QdWcHOTsecUXaUVmuJ6VZGPRdETvYSfRyg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199015)(66476007)(26005)(6512007)(1076003)(186003)(2616005)(36756003)(478600001)(6506007)(38100700002)(316002)(83380400001)(2906002)(6486002)(6666004)(107886003)(8936002)(5660300002)(66556008)(4326008)(8676002)(66946007)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uDuwIQQkY13SujYVnnrai8jndBPomP0lP6Eqa1O2fFRO8RL4Ey/EITpbRrwZcCasRg9CbcPN2FptHvEutrxC1QwIb5g+IiRCilQ8hCD0poJvGTPIcpBkleUNU2F5R1DHp1y7tZv+ZDIUWY3o7nWliOvjbHg8NENmQqD4iMCzPEffArarkp50g6IKY1Ud/wb5sqL6xJ+Y3UOAf3NTSJt8CJXkaNJz6aa0HOs5omLz11+UT96O+I4+aBstRE1KEx6Q+h4MleXDrmQDFiAAyZxeut1AsK47LuIy+xpjYJk9wmXopdtef2KmMzdUbe3cuZnBdq7lg3eXOXBTlwDz2SWuwKfk7i+23VFU5DxEmXF6IbFHzrjkzAKstbc+3wPB3e/YKtbBRWN0FFvkn49A/PV9/PLXoui7z5ucrB6ktrUQUDq+nIKN+IvVhf2gWIuBA9GjIIr9rqpyv4daQ9WPZk3tvjtY1OW1Fg8hI1YHyE8pBv6t+eHRdLtgw0+mndXblXLZtjxg0GRAzKZNMIPohZCHwBVqwRC1Og/Ol/l9UyDj2I9nhhVDt/xsyV9ScQ8FXQW2vBZC1xMH/Cew1Z2+3up0BeIA9KDo0ueQofcyVX5cfY9zhI0Upd9EH4pDnWaClF1UZ4fM+qae2N9EdjkYS8hsBdV52olaUppYlWzqhYBvf7J81CwyasP8y47j8HAR4543/p4+BCw6SPSit/MJMWunjFalracFlW5ccLnlU++F87TwKYexRRack+zDfqrKwIg++2r/EBH/LypX9xj/fLj3dqaH07jQ6n7qumno65CBmSgeNSsDknpMBv/ASy2TZ4FObXCwbcrxsP1uZ2adNGV/rfZrRLpgoLGPJ2BqxcCBgE2oWhDyhlGzcEomObX4UXvSSE50tZ+jYYiqkXU9rOBJWOOZysxFW/0tM0KlaKDKOuh8M44j4TfdOCJkm+Ia8tqzatkoFpLWDb22PksYO+gdwBGcJG/2P3j3ysxi7Sxhl+/qAE59f7aD89DO/zvtTzAxkARvE3HHLCGPBhjfgW3DJYNe20oZJGUHJfs7dqXWORnER1mKLcNa/TboNGrQHtbylrz3lObMkEO+Fq5YiRTK1g7wtplPR0aizJQFBhzOlSX89pcxSpcnZO5Wspkg7H+QOAHclfl/d40AGOrVQK0NN12NUFnKnCZnPNSjyiLZPI5yA6EA8vIDgNMTudEnMjNC46hySaw6MD/TLbq0nUVtN1qfz1mrnSA5kUuzEDA1QG8ghBkwJ2wzJ5OtjaHz2QbJWo5XOsnrPhBilQoB8/cg6tIb77m5haf3ZqFdoDLZl6EwgjUsnSqra/rM6lmBfPtRhUiBKEJu07My3vk4oH93ZGZWGl8cQyPJ2A08sEHal2FpzGHgwLPQ2xN9LGY19MtIPMjZ+yVRXr+6XcO+ZmL72IaCStTRrpx0S3XXv8hcePZlaT/0hstx5HE4hVZyW4kTA2viUuM4Debgmd/zL+cPkAgCk7yPpkyLncITXkXt05FklwaH9mWVoG91e52m/x8sJzoD5T/2z8Pr9yqqXA1SSB0Az4sknGDqKqpEkAs/om/aNiw4nW+fFzgVA4fg9450tO9wQvv8OE5vxeza9vlY7g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 518a311f-1e80-42a0-b9d3-08daa1c5f3f9 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:40.2236 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TS8Ck4OSsPCsZ/OZth0/LhLByolV58y0aPzrfS/Njs0kcBuznTJ8peLRZGBU6aPjEeOPkzS5to/6I8Pp1Ht06UTnnEsnwige/DcsUdyzDXY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5653 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 suspectscore=0 adultscore=0 mlxscore=0 spamscore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-GUID: 1P5czQfVD7Gs9aHocutqwXgSNxtUNFLN X-Proofpoint-ORIG-GUID: 1P5czQfVD7Gs9aHocutqwXgSNxtUNFLN Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is going to be removed. Convert to scsi_exec_req so we pass all args in a scsi_exec_args struct. Signed-off-by: Mike Christie --- drivers/scsi/cxlflash/superpipe.c | 18 ++++++++++++------ drivers/scsi/cxlflash/vlun.c | 11 ++++++++--- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c index df0ebabbf387..724e52f0b58c 100644 --- a/drivers/scsi/cxlflash/superpipe.c +++ b/drivers/scsi/cxlflash/superpipe.c @@ -308,16 +308,16 @@ static int afu_attach(struct cxlflash_cfg *cfg, struct ctx_info *ctxi) * @lli: LUN destined for capacity request. * * The READ_CAP16 can take quite a while to complete. Should an EEH occur while - * in scsi_execute(), the EEH handler will attempt to recover. As part of the + * in scsi_exec_req(), the EEH handler will attempt to recover. As part of the * recovery, the handler drains all currently running ioctls, waiting until they * have completed before proceeding with a reset. As this routine is used on the * ioctl path, this can create a condition where the EEH handler becomes stuck, * infinitely waiting for this ioctl thread. To avoid this behavior, temporarily * unmark this thread as an ioctl thread by releasing the ioctl read semaphore. * This will allow the EEH handler to proceed with a recovery while this thread - * is still running. Once the scsi_execute() returns, reacquire the ioctl read + * is still running. Once the scsi_exec_req() returns, reacquire the ioctl read * semaphore and check the adapter state in case it changed while inside of - * scsi_execute(). The state check will wait if the adapter is still being + * scsi_exec_req(). The state check will wait if the adapter is still being * recovered or return a failure if the recovery failed. In the event that the * adapter reset failed, simply return the failure as the ioctl would be unable * to continue. @@ -357,9 +357,15 @@ static int read_cap16(struct scsi_device *sdev, struct llun_info *lli) /* Drop the ioctl read semahpore across lengthy call */ up_read(&cfg->ioctl_rwsem); - result = scsi_execute(sdev, scsi_cmd, DMA_FROM_DEVICE, cmd_buf, - CMD_BUFSIZE, NULL, &sshdr, to, CMD_RETRIES, - 0, 0, NULL); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = scsi_cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = cmd_buf, + .buf_len = CMD_BUFSIZE, + .sshdr = &sshdr, + .timeout = to, + .retries = CMD_RETRIES })); down_read(&cfg->ioctl_rwsem); rc = check_state(cfg); if (rc) { diff --git a/drivers/scsi/cxlflash/vlun.c b/drivers/scsi/cxlflash/vlun.c index 5c74dc7c2288..4fb5d91c08ba 100644 --- a/drivers/scsi/cxlflash/vlun.c +++ b/drivers/scsi/cxlflash/vlun.c @@ -450,9 +450,14 @@ static int write_same16(struct scsi_device *sdev, /* Drop the ioctl read semahpore across lengthy call */ up_read(&cfg->ioctl_rwsem); - result = scsi_execute(sdev, scsi_cmd, DMA_TO_DEVICE, cmd_buf, - CMD_BUFSIZE, NULL, NULL, to, - CMD_RETRIES, 0, 0, NULL); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = scsi_cmd, + .data_dir = DMA_TO_DEVICE, + .buf = cmd_buf, + .buf_len = CMD_BUFSIZE, + .timeout = to, + .retries = CMD_RETRIES })); down_read(&cfg->ioctl_rwsem); rc = check_state(cfg); if (rc) { From patchwork Thu Sep 29 02:53:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 610825 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29635C54EE9 for ; Thu, 29 Sep 2022 02:57:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234478AbiI2C5G (ORCPT ); Wed, 28 Sep 2022 22:57:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234804AbiI2C5B (ORCPT ); Wed, 28 Sep 2022 22:57:01 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 435E111E5C0 for ; Wed, 28 Sep 2022 19:56:59 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28T1TdN1004390; Thu, 29 Sep 2022 02:54:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=7UEhgmPMM4/dM4UDOsWLEokaOnanBShzcSYryCcvwxs=; b=vZ1uwDCJo+DA5r1+V1Y6TVEoKjDznDbZALxB5xVtJmvnC5jiHgtvniOS5BiQaHvA4USP CddujzQQQ7jbeilM0b4zkXoZwchMW8RxsmuEkJn/xq0hLEsnsB1Yc2MZC7MrPxPEGgwz 79EUodbzFMuzN+CdFbvSi4H56jAWKTULAQGwqbivSErEpj78tGcw9oJnVu+a4cvaoS1f iUsauZyWzRl2Z4EI13j6L5hg+//Hw8DVJ+kgDjqim5eCmZtJMK8Tw5EtL/2NDEl1bJ4m G5J0EOwMhPQbKYXNEc3AFVQLapaabawlgU+qalQ1/qPK7PUaar89SOnciyt6hUGGjlxS GQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jssubkhj2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:45 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28T2Z5O4040238; Thu, 29 Sep 2022 02:54:43 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2168.outbound.protection.outlook.com [104.47.56.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jtpubbpfh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kjz9hcJ8+WgzlILJ6x9kupe1jpWWnRNKH+vs7OLmdZ/KKqH2wgyjmDM56Bpn41a1NCGh7nHlUlV0viL+WNJD1fEHS8IfqaaCRjTNS5bmwjGLcFC5ZQcSzzqcBAPIMkQt899rSZv+kQGdnlxLbULhf7Aaf+FwgNrk8AMz7gmskSnL3c5qmP/rpRXX7JWWcoS6Zz7NiEvPWYyMsEbuFmZIvIJZuR7ItFUH7fUzfnrgOBcJ1+nYXspkSa8qhT59jawoO+Ws1x67pbfPZyvKAzlAlHtVnUvhrbiajRcWLRhUl5S1cvkTqyaCLhzBAf07GYZ0E9PFaPAavt7HcjPDa2QcOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7UEhgmPMM4/dM4UDOsWLEokaOnanBShzcSYryCcvwxs=; b=VO56jmHcJvaChoDJ/cCOjV1ZwZinpLNNJrw3zxPulbyxys+0vx5aVRuU7EzmxWBbPwA8tkH7w+caYwcGmoyz6807aY94BhyGuX5kq4Qn4WGB2lYN8dMUVH6QNgPSjnfx65GMJelz7omuazucbdPCfta/BsTPrjg9io2tdPjaZINqWcnjyfSaUC9NfH7kHgRk72l8boBlKP0C5TtSAXBIdDczc32EW0qngMTGlufJkhihr2WuGheuiLlW2A1V5vYtFpdJDA/T99bM30b5sUkpo5xeaWmHwbDm8TMnVvG7fXnN3iaWBBpcKF0qylS0pfBjQVYcMB2YNWsTUUkTH7stXQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7UEhgmPMM4/dM4UDOsWLEokaOnanBShzcSYryCcvwxs=; b=F+Vgs01aIeklyeZUQNw0Dg8eG+rqV6F9tNguwP/UVhsI6Njp2HsafvrVyEu0WFmig18z0+Hc3DggFeC+igteRNnpLBgLzIGikVC7SZntDtV4XEzWD8UGUf5T1ETSNtXlOTe7C2BZ65YI9lGyYMEgvM/pLW8yDiLSGdFzGS74awY= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SN4PR10MB5653.namprd10.prod.outlook.com (2603:10b6:806:20c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.19; Thu, 29 Sep 2022 02:54:41 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:41 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 19/35] scsi: Remove scsi_execute functions Date: Wed, 28 Sep 2022 21:53:51 -0500 Message-Id: <20220929025407.119804-20-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR08CA0001.namprd08.prod.outlook.com (2603:10b6:610:5a::11) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SN4PR10MB5653:EE_ X-MS-Office365-Filtering-Correlation-Id: 5841adfd-956a-4613-aabf-08daa1c5f4d2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jA1kBnE9VCDuPHQq4tQpiiUH+nn0hX7DabIBzL0bfWx8+XbhBFFKC56TT7ceSZEc4MwCYXNu2nCP4Y1cYCYXWWKOTRr2KgOyJRIQUicg5Pba15hoW5b4ngg4I7/qkjILJjhOawQ9o+7dGLXuyslY25aFsvWcRrT5u6FCSyvmoLL5BT9hhvK3ULeNIyCVdnQt1ZGfi1e38wWzbM3M93sMVdItSgpj2YIymWcuZHiSn2B3OBteZRIvSxr6xycirZCQIBMcGUklWDSwLGO3uOqtt4dle45+S2menqumduad+AYS/vNVuvQ7jumNVbA7ZcuSZl15aaReEJFTle7492el6dJlv041R1eLnX6VjXo+oYVP9pwT3Mz+/pu91qugHxSJhjc6ZTwbbgYQEpU7blX5MsipE1UO645NIJoTPnMrwSS35yVzP9EQfzqHMgoTJi5unN7Bzcpy2+WW8KQrisJ0RF3s1QDvtDscXfVjefxdE5bvejnENm6DD5neCYCWL+75uTgNJhISfLmcVigdh/WZqxRG5qxegKyswNy5+gXbDbO4L2InEjQuKsUMF3sYCWNTnI00sYDAv0k24A3W99CVjaVhpi0q9/KQnBt8OhyzOYcGKhqh/zUW+jGhPCGjT2qUlALzH68OwoOb+NeSiHZYHHVB2WBa01gVUHf7Is9B++7cDXkJ4fD2Tizywmd00k7hHMIfv70DgG+gJCyk41JPOA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(366004)(396003)(39860400002)(376002)(136003)(346002)(451199015)(66476007)(26005)(6512007)(1076003)(186003)(2616005)(36756003)(478600001)(6506007)(38100700002)(316002)(83380400001)(2906002)(6486002)(6666004)(107886003)(8936002)(5660300002)(66556008)(4326008)(8676002)(66946007)(41300700001)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: N5YGnehOjFdpOQUjZ16rZcME7CDUccjyTwvnpKXX8889ghlXTWuOJwQL1ELgjd7KCoR8gF6QV9LPN/BPBe7hqMrF/2lq+8ieVFuCtzXiLShNKKP4mHb9a4cooFNmXyNidWIpIgxmG8rf+MpELNnOEuYYEFbt6YiOxBZT9cZWHvVbMQfMvjs+EyiygyE48C+vGlvu9flsWkf2YXFvBJTWe6MsquM+h+5cypGg5b6TtNca1ip01GcjHQUu5QowUgIjE+28Pwgw42SX4UPag3UJ/OPYzQkmQaU6UFohY/Y0duEn3RI4Ty1gJLkKI5DLO6EEM7OTH9GCdZthEPd2MDKxVu1FwMBweF46Nv/3MYXQb0YjnLvVj+6D9pXBCXJJ8sp/EHp8JSFu4WRhGDPi4CHHJqyqLx73rYUon1aF3B26727sdjsXRyGOGpALaQPeSH1O2YOYluHiA0zSWPJAbUunttAMN8S9JhLwjNj3BahMw4+Hs6fTkBYYYkVZh0zvRnQvqP2FYiSCEpxatNl65/2MjBBbkNgGebZGcbuypn95wjZ/hvgI05YHCAy2cAz+vcPncrEOwCdvPuiAsTaAAuec5CZWJ9H1XjrfnNxwUOoVBn/2DTJLXG+5VXvXpDc5eFKpEDNZxmr+KO1dTy+KtZxQSW+tWXTYNz+wHSH+nu0YfpTOLEWBYDq50kkWUIIgXelA9wCvTsp1XbAZ13wprHn3cOO6VyHB73/igZ6rMDOYbujGhrX9G5Sdd025ys6qZmkWatLaoL7OZkpm4+nXeZIeu6SpCoM9KE1VuoGyaG4SVgEbUuIflmY5Fd5w9BY416hgJU3OGEql0qV0l0Eo7wlmyNan4srwK3XV498dNfjDmb84QM+BS+ZulHvQxpmNfLVnj41tK5rdLXMk/QE2n2jOEXYLYrMwOQ36wF+GxsCjBbc3xpAgtsPRmRC/nJO/djy158Rsxsblct1j8zje70tw4c84MB1GqHJvqhR6T67M80GodXubPiaIwPJb8xbPZZNuDgs2b/DkEhTIpI5iSC0g/gqw7JyIxrv9knWFAC1byfrR32KLAe6zK/ein/uiFqqzO0PRJcWKHMKWJC0u8y9Siiv0sZyxcrGSoeQ6LpsOiwcsK6IPsGAou5Ugfqo+y9O+ZIi2oVZGbryhXOQ2i5NDN6Vr574LTw9CMgQmktUMIxQJxEZlbWNnkOiD4ysj+nqEPmmkxqh7kOhb/iryjZFwXAg/WnDrq2CpkYUZg65m/THhDaNCwCnvu5bx7HAMD2YPtW9Vml8GyoklRkZdA1jH2BNa6+2+CnlP1KM8eJY1uppZa8UY1IffOWWRCHIe2MCctYmKBOrv+NYhnkZmW3UIYRYgrFtYkLwrAALINOnsmvhigzG4F8Yihn6SPlHdClcBrvcpkhKrcYgtOjD7E/6FVrjjIMkTA3vERB0FajBvOinIy0zrCZG1XRorClEGHd+2xMdB8q6++xLXcYmmpt/NU8WaZ027YNbbkhal59YaeQhEKmfkVhnVMM4ftAgzXFH1AA9vCyCLm9YPJE8FeR9glDp2AWW8mUQS8AoVCIozSYcd5UjoXugVqU5Dh44N00mefmO41DVu6tBOGAai4GoFaQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5841adfd-956a-4613-aabf-08daa1c5f4d2 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:41.5673 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qGLIPtsh5o5epGOaiWCR55hSuLKLEzPB6PsZHZuV/bg6RYB+IVj0idWDnPMVSnyUXHxl5Am0KR4L3wUu6XDeUCOkcgl0ZVOzNQu7eYVOEa8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5653 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 mlxlogscore=999 phishscore=0 mlxscore=0 suspectscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-GUID: drfvJDdvqt-AG8cGjoSA9q8prSl5X9tF X-Proofpoint-ORIG-GUID: drfvJDdvqt-AG8cGjoSA9q8prSl5X9tF Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is no longer used so remove them. Signed-off-by: Mike Christie --- include/scsi/scsi_device.h | 39 -------------------------------------- 1 file changed, 39 deletions(-) diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index d623d3e62f92..77bbd311ba34 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -481,45 +481,6 @@ extern int __scsi_exec_req(struct scsi_exec_args *args); _args.sense_len != SCSI_SENSE_BUFFERSIZE); \ __scsi_exec_req(&_args); \ }) - -/* Make sure any sense buffer is the correct size. */ -#define scsi_execute(_sdev, _cmd, _data_dir, _buffer, _bufflen, _sense, \ - _sshdr, _timeout, _retries, _flags, _rq_flags, \ - _resid) \ -({ \ - BUILD_BUG_ON((_sense) != NULL && \ - sizeof(_sense) != SCSI_SENSE_BUFFERSIZE); \ - __scsi_exec_req(&((struct scsi_exec_args) { \ - .sdev = _sdev, \ - .cmd = _cmd, \ - .data_dir = _data_dir, \ - .buf = _buffer, \ - .buf_len = _bufflen, \ - .sense = _sense, \ - .sshdr = _sshdr, \ - .timeout = _timeout, \ - .retries = _retries, \ - .op_flags = _flags, \ - .req_flags = _rq_flags, \ - .resid = _resid, })); \ -}) - -static inline int scsi_execute_req(struct scsi_device *sdev, - const unsigned char *cmd, int data_direction, void *buffer, - unsigned bufflen, struct scsi_sense_hdr *sshdr, int timeout, - int retries, int *resid) -{ - return __scsi_exec_req(&(struct scsi_exec_args) { - .sdev = sdev, - .cmd = cmd, - .data_dir = data_direction, - .buf = buffer, - .buf_len = bufflen, - .sshdr = sshdr, - .timeout = timeout, - .retries = retries, - .resid = resid }); -} extern void sdev_disable_disk_events(struct scsi_device *sdev); extern void sdev_enable_disk_events(struct scsi_device *sdev); extern int scsi_vpd_lun_id(struct scsi_device *, char *, size_t); From patchwork Thu Sep 29 02:53:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 610831 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A7DAC32771 for ; Thu, 29 Sep 2022 02:55:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234853AbiI2Czj (ORCPT ); Wed, 28 Sep 2022 22:55:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234820AbiI2CzK (ORCPT ); Wed, 28 Sep 2022 22:55:10 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD6C14056C for ; Wed, 28 Sep 2022 19:54:58 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNif6b020801; Thu, 29 Sep 2022 02:54:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=wLNiwb+Rz0d36Znq1wimxZORUdX0+ai6fN8vPhgbdwU=; b=iwZftbIb5PPL/9VsHO/DaF7STjQpo38uaXQohxnJPlE7br5GUEwq7Zb0RnQQ72xw1Jrl tGGy7+jsAnUx2YGSWUD4RBvcufjIQy9g7YVoRBRloUigUlF88MutWg5vwqUT4udTwy0i 3lWxzIC3QzUoDVjzrTw3CrzYs+MLGYMqj817wcSPb44tcX/U7UjIHK2clBuXwP64wtOZ SZ17JrVZEHBYLXryolXWN5z1GvgZs2gRa/UHg1YIth3om8/mRBe2iYmqu414R1Ok6QIV edOqM2cEmiLRkj6A5rBwseCBhM54658+Hk6baF78Cg1MBdQdFcHyyRqINJpijcUeCuel AA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jst13kgb4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:46 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28SN2DnS039536; Thu, 29 Sep 2022 02:54:45 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2108.outbound.protection.outlook.com [104.47.58.108]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtprvtcv0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KT8cekclzvTIWLgfLEUYAPNcrlhrKffOSbzEjfRPtDbRnl/S+vLzDVnaFpa33ktV0XkJSOm/hUjQK2Qzdb1aV7pNZetiuQ7nSCDoby+eFM0hZo/hWit5GVt0djJmIRmLBpBtR5EELIpFZvrSzrafauoFpNPvBkc7uxjRN2swpuPfwnAG8Kfa+5GNJkJTNdQZ42lMRq+BSAqowgLYuw9R0zRaD8mYoid22sZ8O9PCKzCLsVSUHvIECqEfrdCg/kPnbxqwm5NG7GRpcTgUY4evdsa6oHmASflqIlTPjj7SPNLoC81K5EhVQDZUrUeHlDb4ie4gNkA/LYG6oPH6CoZJxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wLNiwb+Rz0d36Znq1wimxZORUdX0+ai6fN8vPhgbdwU=; b=draCO/65LtXHNU1uxcukKS+6PsvqpiHMNvgbaZjdB0EHKLcdvxTeSIw/3fXOIsaMHBowWfNWZ15JYUmGyXBsq0y1LFSp2+774n8T0VVVWUyDP9D4tA3bP038uJ6vwen8j1oY6m68ZRiSHjMWyBIfAT7X1P8NvNCMx4taXSuizErI8QNLBo4GmHeowQ2WhYcyBNeVmhazgoQdIY6QLCymBduGmAjSkS+11+T3tirMddHLJ1j8qRF0UCP0SiJr3mAcd+SV6Fo5BYfodAPBy1IpqH9AnE3l8etrdkIrO+87UmrLuIpK6dUrxWbgWqxlkPnuRxt1ON0cHLdki7zD0Z0wDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wLNiwb+Rz0d36Znq1wimxZORUdX0+ai6fN8vPhgbdwU=; b=njCuw6O5nQ7dNfh81+FgG79vgCWv3iB5aJd+9YZRLgZsK4CawsxBL3IpWISFhRDD68eil2cdnMLPjuqv+av+a3afYBVkmLWbO/8xQec01DjqbOditH9Igk3zDwgna6ckYCCSLMCxFgfov/034yotUX3QM9Hc8MroY59G2r7Mdb8= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB5872.namprd10.prod.outlook.com (2603:10b6:510:146::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Thu, 29 Sep 2022 02:54:43 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:43 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 20/35] scsi: Have scsi-ml retry scsi_probe_lun errors Date: Wed, 28 Sep 2022 21:53:52 -0500 Message-Id: <20220929025407.119804-21-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR19CA0016.namprd19.prod.outlook.com (2603:10b6:610:4d::26) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH0PR10MB5872:EE_ X-MS-Office365-Filtering-Correlation-Id: 1334a6e7-3249-46a8-d718-08daa1c5f5a6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QO6us+w4JyT6r6YUefLPDSpA3dVqJX04vtHzE5knNryzvTWiqZz9stBiP+y9KH+FcHPaNnpjGGeDgOzMhw1U2N85T7XLeBKh7a0VSCAu+Jm1FhxLdOlgGnjR4lhKiXc3naT7H7yA3E0aB1zcZkrH7sIZghrBGoUs+VLbW+fw4NptwKCVW3QwHZHC93wsVzf8obsnejdHz+dfrV4O4NZ052jGGrRxi83gP40D8Y5GW6cGzUYX8AIMnH4wwVrxx4yNOnQaG+qvaia/Vlfjt/WMHKUGLb4M4ViDzCNsjOmmCQSa8u0L5XvWT17JHUBS49s1sIKL90CqBnOYFfSaoKoC7TeMj0dLl4xhlZM540neLYukpKagmp2ir8P+8cKdwLXE7sJTN994KvI6VG06s5pokFKkyBGTuciMiPxew9xH84/tgrUm04fgjeZZJ3mRN4ig0TxUhngl0I12XhN0SoClxurXp1Jw4WfaJmiZd+D8RWdD7GRSxSVdcWyjwPDgIrmUbdMV+0pRxKaIfCf3wdYwZEiVhC7LqlMvNNfFVZtnZSnAZdcUizJfEU6QyHYIvDmXUWQWI5wSyh7R3/VCgGbd55UVfZHdXrl9XI3rolPgUC0Cu21P5YI7lCc1Yi1OVJy6wUERkSiE5VytoQLe2YlldLXED5Raj+1UpeTeW+I33O7V/sQzYsud8dj0n88leEe81P6O0qgzjpApdSeKtYzQJg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(39860400002)(366004)(396003)(376002)(346002)(451199015)(2906002)(6666004)(41300700001)(83380400001)(66946007)(6506007)(107886003)(6512007)(478600001)(8936002)(36756003)(6486002)(38100700002)(26005)(186003)(1076003)(86362001)(4326008)(2616005)(66476007)(316002)(8676002)(5660300002)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rgjWlPcbhqDikgYryX9LBjrcAeVAXcKIZ4rxTbe+tf4YOjTAFzorBxQnkmcs/G83QBnTD+LrWtVdkv04Q02RnvTipFSez/L21oF0h3pLKRiMLglFPhu8bY5doLHdHAylqK9rq355zjKNr0LUmfz9GLZ+a3WYJSdU4c2r1QIzMfoDQZlawg4eTEFXQERv1M3yyIhHE2js27i+8b2HvzBo+d1aNc9ZKX9u8FbEHDsluKcnt9CdrvO8LQjPSpet8vK3cXKvmNxyRnTF3BEQWEIp4m+QXLKPZCDj2NIL5nPyBMkOD3Kw7jDnjZn+5S7a1k3Aa1XSQdvDQWxnCuh5U1bI00vIxUCksRT+PrwGGpKivsPa4cZIOuCPZ8SCUHwVJsWS6jYk1swFCdul3dpexk6TTH2qwm47W5emjPfBQuQ/j4x2rw5rqbTOtyC78LWP7csl35EtUEzSgboz0IXFfGPl09R1XRQg7bTBePaYDYnEhGXUN3WoDdVaSZ+f1bckrFdDe84QcEpslBYe/OOHy8LCn3iL86v2/i9WbJu0WQ+kLaV84qUouQaVQ8s2tVtbmFamhEkdYoAIXO/oThCSOcf2PNWyj1sx33gfuhHDNsC2HE2tDRuuB/Q00P8J0I9OwacmioJs344krlYCxTJts1u3OmGaJtsPJxmxBkd2QxXEv2LQYLUgzp0oFgEWFshNJosM28+lk0Sg7zfEDYZQTtDdLWeD5J/xSAmiV+Z+675dxtyGBjjTPVz34VDTeeY1kpdPrlP10oa25GEcjDzvKxUgd/Vw43ar8X8M7amUDBGb+4pY6q9dLEomw2vtCmUygJlJmdBI9PldMo5c7XGldQUvH1noVGk3yj8lnr1QW1nv0QUxc1DQ65w29XasZiDcPh0YVW2sgJ/HPqkZSmAAkMB7/g8WBYg8uZC8E5L/22eT/S6zBhYBvsz757sjrpGSyCFzVyCec6ND0XcArwAZwZIkAbfQL4oN5asO7BBqmfy1p/Nk+/v7fOXzWyt9MH0CcQukJM+kBd1F5INWl86rvZcPPSpGbNTBDXyclilICDq1dTLXw5rK0XB6nCW16I4KhhbDzEBMEJrSfzIbOkPUvBhnhNVGmu7/idkAPX+ixDDzyzQNrODBJWmbceWEY5ANMC04/Y9Ce0co/AZAwv3BveHV7xHneqI6Y8vC5dd8OBL7mBqXKljLsqA3k4hc1Qs+UNLGhpVuGq21HmxuGOjFnZqNhwovqbh4NEpN9MBMoloYhUMQnElf9ECUvQeTfHOHpl7wjqCZpJBiqRj47GgNFGhsno3HqQBtAruOGAAlxBg9kM++dzgud9FyHxg19QEd+Foz41D+uCLyqV0jrtJfgjtOQ1QK+t1uy+wtfsbM0eEYuc9KT206SWW1/5KDcNqoU/G5B510CdS4bFkVx4xvGWRsC4ID1XBRfLShTu+w2sjvxC0QrroIz5ewyQhT09LFMzYHSBTDncmbucDliOhdm7Hj4xTPL5hj4DKhJoUDI5MyPvUZgV+FilR2RJpahaAyjBHKvpeyE/Vlecql1TzOUW4rQXaA1bj6Kp/VincaG+2Rg8t3vY5Sg8NvOjjUwj1IhJjSzDoPfRhVErGmr4kgD2KPaQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1334a6e7-3249-46a8-d718-08daa1c5f5a6 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:42.9421 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ffwVgjSLs0tLDDZ3mXlXbx+P6ktofcw6RQrYVUARRzhyiNxg5kGgOubE1U+y+l6NLnt5WNs0tRiA+hRT/BEQZCJ9zMJilM4QvA0hx5W4Cps= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5872 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: QzyPjQK8GS7XA5H20UX1VXioEiIkYe_v X-Proofpoint-GUID: QzyPjQK8GS7XA5H20UX1VXioEiIkYe_v Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This has scsi_probe_lun ask scsi-ml to retry UAs instead of driving them itself. Signed-off-by: Mike Christie --- drivers/scsi/scsi_scan.c | 44 +++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 58edd5d641f8..83f33b215e4c 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -654,7 +654,28 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result, int first_inquiry_len, try_inquiry_len, next_inquiry_len; int response_len = 0; int pass, count, result; - struct scsi_sense_hdr sshdr; + /* + * not-ready to ready transition [asc/ascq=0x28/0x0] or power-on, + * reset [asc/ascq=0x29/0x0], continue. INQUIRY should not yield + * UNIT_ATTENTION but many buggy devices do so anyway. + */ + struct scsi_failure failures[] = { + { + .sense = UNIT_ATTENTION, + .asc = 0x28, + .ascq = 0, + .allowed = 3, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = UNIT_ATTENTION, + .asc = 0x29, + .ascq = 0, + .allowed = 3, + .result = SAM_STAT_CHECK_CONDITION, + }, + {}, + }; *bflags = 0; @@ -686,32 +707,17 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result, .data_dir = DMA_FROM_DEVICE, .buf = inq_result, .buf_len = try_inquiry_len, - .sshdr = &sshdr, .timeout = HZ / 2 + HZ * scsi_inq_timeout, .retries = 3, - .resid = &resid })); + .resid = &resid, + .failures = failures })); SCSI_LOG_SCAN_BUS(3, sdev_printk(KERN_INFO, sdev, "scsi scan: INQUIRY %s with code 0x%x\n", result ? "failed" : "successful", result)); - if (result > 0) { - /* - * not-ready to ready transition [asc/ascq=0x28/0x0] - * or power-on, reset [asc/ascq=0x29/0x0], continue. - * INQUIRY should not yield UNIT_ATTENTION - * but many buggy devices do so anyway. - */ - if (scsi_status_is_check_condition(result) && - scsi_sense_valid(&sshdr)) { - if ((sshdr.sense_key == UNIT_ATTENTION) && - ((sshdr.asc == 0x28) || - (sshdr.asc == 0x29)) && - (sshdr.ascq == 0)) - continue; - } - } else if (result == 0) { + if (result == 0) { /* * if nothing was transferred, we try * again. It's a workaround for some USB From patchwork Thu Sep 29 02:53:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 610830 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F436C54EE9 for ; Thu, 29 Sep 2022 02:55:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234830AbiI2Czl (ORCPT ); Wed, 28 Sep 2022 22:55:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234551AbiI2CzL (ORCPT ); Wed, 28 Sep 2022 22:55:11 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83E6F40BF8 for ; Wed, 28 Sep 2022 19:54:59 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNiQTV003456; Thu, 29 Sep 2022 02:54:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=XhJrt8QRW53klPP4AIl3L6Kajxn/224DHoLajLXtdtI=; b=lzkswePE5PiP39gsCPtrIYOu5LjDR1jBwWQJ2/GGnDL467pnrnN1/5QwI2TzHso84S3z R+5g/LwwCv9OngTTTRYPpJ6H9HHMO3joKdrS4M8c4G1eBYdtgbbRC/aXnfwQHH5V7jGR BU46Iq0qK7HrIZhN5ummZTdHvVS1WqwMJkHvmgZzSM6j6exGicZhgIojWA+BVy35cZcT rw5JGmoW4RUD0LYSS8g3iKPmZR3jZHsIc3dJ6WxbtEBvjrMmbqLK+a5f8/pmExIhDZiF 9tFNU4KeZ4oEqUqmatU2tPQEzH+Mt1x70Q4hwpua2CKHpeRd5blhbmh9RRHCDKPPlcmU Dg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jssrwkjck-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:47 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28SN2DnT039536; Thu, 29 Sep 2022 02:54:46 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2108.outbound.protection.outlook.com [104.47.58.108]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtprvtcv0-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IfQemYGThyMMm8qX44IZyirsJWWzFJdfWSSk7HhcluvH7hn4voYD5GnLq+OkRrkdIOP7OSKujNrMqmiKw6WZ7Ov8OhlSJNFDWxIlfj4KaCb+2GhTZDrW4zyEPazhVnT2IwsK27nkZzugdozOGKQD6pcuE2vmaL/If5TAKxakD8NVHeTYmaDJ5s3S2AE0s/J2yBryDpAWEnfYVqYAM0aO6HjXI9InmfIXZo/DP7n4S709yFlMtUWwEq3tgd5IroA+kTxhXpuLxuwCRpiLp1drbqpNNJw2+Wl/PxzYStStdzoIfQ90RPRcto5SvqsKzuCE5jMIPUwT6ikWvtns4DoNuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XhJrt8QRW53klPP4AIl3L6Kajxn/224DHoLajLXtdtI=; b=UYuv83v3Vz3GNOSXB342VmTSOyM3MgeHsF/aXZhoDDRA6dBogli0aXOYaTrFRbCu1wLUIgVLosQyf4p+L/QeKjUdQdGo+xrS3SyjBI+Q90JPegL1hnS0EXolO60x5EGVmwfq9SqrTBMpy4xeqEqvJpUfOm33YIWR3hQX1e0OOEPJzPPoSOstLorcfj9fheFrUWOvgGH9LFHiCc1dU9DOGTxWhPskrmAsXtOqiIvXlmixcV8qSOOpHpkj/gbMimMAqL57Nxb9dHrLsfHO5O75CGOBwDDlo+wLlweShZkpSC13QEtuuyLy6ZKEPuSDcSjqjjXqrxeOqvJCVhLu7IH8rQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XhJrt8QRW53klPP4AIl3L6Kajxn/224DHoLajLXtdtI=; b=Ef5JpYu60k9/sFQOaM7+Lm7fW8CQDZ0BLU2XKsj6XLfJSIruyFedNewKCybpCVsUQkjXP9s55vaS7neRG36Vt+onyp1dmN/su/MkWKVqKJHcRw6I9LJYoTQOeHA2zVej7nYhnkSJ3aGuePPnAnRl/ww0oxK/pgJdt0dXeyK4ddo= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB5872.namprd10.prod.outlook.com (2603:10b6:510:146::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Thu, 29 Sep 2022 02:54:44 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:44 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 21/35] scsi: retry INQUIRY after timeout Date: Wed, 28 Sep 2022 21:53:53 -0500 Message-Id: <20220929025407.119804-22-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR07CA0043.namprd07.prod.outlook.com (2603:10b6:610:5b::17) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH0PR10MB5872:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b9fba98-0624-4136-2c7c-08daa1c5f663 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LvSsY/c8ANkvNnOROKxVqvVFZ8pK1KGWqQIEXofV2Xh5+fmMN6zFo4aSVVcml6n/MHUI/4IUDell5bbcPmR3nRNtMu6twZicEs7+4Lj/sKrLTvWK5irMX9AH3sUA7WL5fxZ7APUtNiWHqAM1+5hDPiBB0oWOWIvd7gYleGIExwmSgb4Hc037laHkYc64slthBxceYDTteN0zA9eir1LRct+ipPgdGhReIrf37nOewA1e+PltRWK/2M4cUDTHKtg4BnJ739BkssK8pfcF6aSgljrRgktYxOqvWMRSHbkCFs4KIMblhtCTXWbLu+eORdNkb615uKbfPNLFUbT6F+ONlki6blaBP10VrYuaNYOCB7LF2ZaFJSp3zi0s0+T6myuYKfbDV2EeGq5jePSGpbLhhaX78ME+glkG52KR4rrbMHx1crmpexECbFDlnKavJaiqkBykEQ//lGSkhswNcAvr/fYv4tJD35DIIFzhJpD2cfmHu2wFiofd8to7bIaRL9zqWr9U7waMfh2jqHyXrvUEhqsk4++G0YA5q4biz6gdpGRENKKUPIb/N5RX1TLEqQX9on/1umBnsgxyaJPp8PnQ7XPnokFc+X9YblTxIDUmZFcU7cw+tYd65VvUeDdpI8B1pzQPuKb+23TFkPzUA+4JS1qWRo6qij0I92czWdW8SMbwKeEQ+VUyvLn599ZjRHyk92G19nIR+5USZHqIMbegJA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(39860400002)(366004)(396003)(376002)(346002)(451199015)(2906002)(6666004)(41300700001)(66946007)(6506007)(107886003)(6512007)(478600001)(8936002)(36756003)(6486002)(38100700002)(26005)(4744005)(186003)(1076003)(86362001)(4326008)(2616005)(66476007)(316002)(8676002)(5660300002)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 82LSPY5mEy7t/b67ytIrfgI/obVpADBorSNn1MSbDrgjwvKaz/4n9YabF6HObXMIzzwrCJVw5dOuR48MdWSzjYC5fMSaMQJKc5LHTDJlSSQT+9gWiObBSL6LWlE4UyUvmvomKU5eCsbQlw5Jcbl2m47wJIh/IHQ8dLAKPntip4F9/87LaudAVg/0StToCAYNlEZbW9YZwT1JUd01rm7avLU4IUgvhTrYLSOSRQJGF28gvy0NDmUgqtrFMMWpbpVo7EU4FIAgpFjLGwVwPaWls17LaeEo+3EM1FwMaU+s/HXy9N5hWwLQAh1oYR/Vlg1uTCBGPHM6l01JkdAOmTMEcsxCsJGRMav/XOMhi2QKUWx5CME5wM1aSKTJjc6jdl9ADvdVXLvOo09EnPqoMyieAY3gA5dqvlbyWBHEhUleJVKZNVyp4VaHVz6+8aobFdI7bxksoIsQrdebCgCANNrFBrMXvrkj3NOsJP6teIJvz5tBCgng/F8hHqHJuRd/0AXmdnwTh0B5ScWXHjoefBYNYnYRuIAZFTEuY4gFwDbUWP7NK02PsHdSTO3LQkPwUnD9whq3HKcV8YmoQG2Mo0G/Ag8OrKLW8aBVffYJGG/a7JuUYE1m0FxX7OCTKL/XlzEpg1HmpApWa+PgdqBGgclnV9Agn7bJr5ZStAdFLJaBArj5fhwYpRZZ7EBRrdlxSOpPHgo8DixpMvUouqACD5sXR5iWRRxfzDTLfwyJRPKNJI5TVMYqwAnKClBW/52p7sSB+ajq1upjhdDPgd3X/+UjQiXiomAhYKIrlcyd2Jrtr18OM/GCqZ89nyl51ZFZbBf6zMdt/wDNLux5DzSMBP2Bg9Wi7nS23cijO9mkIKHxO28aGvPwxgnKq/M9dNc/PUWybj0sealzkkIlgf1auFQb4ESspWcj8tu5QkpEMRfWgEXUGQ3Z+cAsIYPq7KeKw3V6CMIsXtOgMm6Re8870o7KRFInZR7hjuuwAIvlDYhCKJboxcVjGCvnFTsHtCxJw0n4DE5IcUoqqdQ4c05pTygw9ERHn+6aT8g8AE9ve877s/YrZ5RQUbO/CAjVKnXUMV8wMfsYzhWB8jhxQf3g8KNAMlSAcsbE5zFwtLWP28cU411uJhJJEqpcAf4FEM+MqCFfMpKKzgjkdvm5K7p+lkRGaK06OzlHM+QHOspqzmxjlNRA3HYAHnbY3/reuyU9vVNsMLAj2CasfU0/Pkq8Z+W//1dNtdl0+JFjSFG3b8oUjAw0fzxdJG5NiJr258zu3GE07DDgNsPcsrdxLVEHevnSBCuonTSy820IeqmW1HhMShpsj7zBPbBCpYhCKPF9+VL/uJyeFAKV8BUeGNKbI0TTlAtfYrxwZLRm14mdmkKUK8ZWKeHIvtdWPzk1A+TU6zaBi6AygIFzgg7nKE4RyV7rs1yqe9DOscgOCzSewNbeQvfg1OfZ5nyWQTVQxU7ACbGTnht5rdw5UIn6R+aYGlvoJxp8Xs/AKHartJVEIRp9FOSQL4Yk9Ffh5RyUd7WpR54ttdn+K+hf6nHhvLRE1h4FyEniAkLtj2bohbuOyFfgGmxAKXxlCjpVORfyYHZfTjKDGyQd9H0zeha/0Sl4rh6m1w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b9fba98-0624-4136-2c7c-08daa1c5f663 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:44.2076 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CfkHAZ0BkKsKSzHnIkqLba8XpWvffm0Gzl9RXKXPKEGdz10fVzvQ8EJifdtXz3sxRBrnpeNzuEHDuo3xW19fT85P4UmF6PHXnMEqxPVy5yQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5872 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: 8p331qw957gvV4NYnAZVzbR90L3o_w4k X-Proofpoint-GUID: 8p331qw957gvV4NYnAZVzbR90L3o_w4k Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Description from: Martin Wilck : The SCSI mid layer doesn't retry commands after DID_TIME_OUT (see scsi_noretry_cmd()). Packet loss in the fabric can cause spurious timeouts during SCSI device probing, causing device probing to fail. This has been observed in FCoE uplink failover tests, for example. This patch fixes the issue by retrying the INQUIRY up to 3 times (in practice, we never observed more than a single retry), Signed-off-by: Mike Christie --- drivers/scsi/scsi_scan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 83f33b215e4c..4c2e8d1baf43 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -674,6 +674,10 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result, .allowed = 3, .result = SAM_STAT_CHECK_CONDITION, }, + { + .allowed = 3, + .result = DID_TIME_OUT << 16, + }, {}, }; From patchwork Thu Sep 29 02:53:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612198 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 379B7C32771 for ; Thu, 29 Sep 2022 02:55:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234801AbiI2Cz0 (ORCPT ); Wed, 28 Sep 2022 22:55:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234411AbiI2CzE (ORCPT ); Wed, 28 Sep 2022 22:55:04 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71AE23FA22 for ; Wed, 28 Sep 2022 19:54:58 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNiROU003466; Thu, 29 Sep 2022 02:54:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=3SeM4EOyoqhl6LIVj3aGwMMBHw7f6ZvB8Z0DENSb7jk=; b=IqmxI5l/RyqueNdPLOhuRSjIQfJP4RlJ2A/GqJcziYGgNqJ1DOrf+gplj2JBTZdmpCVi b8mVWC1U/NJD5BzQwXZjKkjd1VdE86wsSoedJMeozZ4t4Syi3r+sXk8FnlOVMERPgp5P k0pkiaE/KLnTQySBCmNp64a/Wpt96MTiX+Nglo0ybbcUBmat/sD+2mYlKfB/j5fPWfd8 jJnyG4q3prv0m0AGDsxJP/3JVAGCpNeCnkUgpapoYx/iyND8VoV3H7RlOyXL9NiJDof1 4E0u8FAYW0Q1yHFhCybgyha9xIlNP6Q+2abet91PpY7gwUj9SCNsxvbR08dOHssnd6o7 dQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jssrwkjcn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:48 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28T22VCT039393; Thu, 29 Sep 2022 02:54:48 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2103.outbound.protection.outlook.com [104.47.58.103]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtpq9jc94-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RKzToLfB4r6JMjuiqV5OzmROQcj9+YQ6Ohleq+2XU2UiOEesyGUJ/pty9MkNLmyl8Pe9E203ZIyZl+qMaR9+ROcrmW9F8OmVOquBUzxKUYI+gN2esaptoaOLLizFIBj1m860GoG0KQt5CTiF6BkYYPNdBPHlCSnyaI/XENUGdXSrTC0o9srGi9ImC5eB4J1G/e/Ut7VfWEjSi/y0zg7/MFRjlQcndt0d8JLMOOWu0mdjyWwKz9ytaJROnK412ehSKXvFxiAZtyblYOcPm0JhOOVe0s+F6FTTfqWoBYbu+tbCLcavAVfMqFV4jpKlKGlZV16NfV4/Sounsmv6yLtW/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3SeM4EOyoqhl6LIVj3aGwMMBHw7f6ZvB8Z0DENSb7jk=; b=YHGH5rL7L4dhZTvMHg/H0SVy/stAUSd/DrDSg6u0trv23hDfnsCxFGS1c+V7ggLPlFf5ZbglPKR6UjaKRnLXV1LQhWE8aI3roDTuqdUgQQrpAhlsGtdUkW5YWnAS1o1V4RMSkWoslhrQpW+aZQNsTkeQSkXnJIFm2OX4sR/xwTdq2Ky/KuN+JTqh8CyikT85uo8jrBDiMFXAgIm+Y7mC7ANwZ6yZCCAJOOaXF1Fcr8Jd0rQMO+2P8Fv/xek6XWOFmd4WwpH4adeFh42Ms40oGcfvmen6ppxGLkTpWARhkys0+stVG1g7PckJxO3W1syQVa+InyBqQ9RKrudrh5Ki4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3SeM4EOyoqhl6LIVj3aGwMMBHw7f6ZvB8Z0DENSb7jk=; b=fo6OQGlk/sxC6U6iXqlOt70mMXrPTl42EWAu/74MchnhK5Lk/6hv55aL3cNP2o4ZggLv/kTC3ODbfQ/1D07b3uMqGsc7hmMIYECinB9txvVBcNuK9ygeOAOQlOer3yQ62AVdckgWB0E4cqZ451TYArEvoMlYZzDGFxT4lcltKqc= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB5872.namprd10.prod.outlook.com (2603:10b6:510:146::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Thu, 29 Sep 2022 02:54:45 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:45 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 22/35] scsi: Have scsi-ml retry read_capacity_16 errors Date: Wed, 28 Sep 2022 21:53:54 -0500 Message-Id: <20220929025407.119804-23-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR11CA0015.namprd11.prod.outlook.com (2603:10b6:610:54::25) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH0PR10MB5872:EE_ X-MS-Office365-Filtering-Correlation-Id: 848f0fa9-11bc-4139-06c2-08daa1c5f767 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: My17MbKEpm0k20nmDR4X2S107nc0sTfh6Jyuf0mJMPcZUy9sT6jzCHO8jcwV6i5wYPSaYhvIjPEFqNLabDmWKlW09RDZLyF0CYmwFNs6Q85nxbv2O9H1LkYkG4f2dpA+4ANPVKdLDe2IGHaftBkskrSW3Pz5BsvT6tb8SXkAr5WBa13SLaWgkIgXm4ddarKrBq14lHSMnV/NJZyPwgNxlalCWDj/c4S5KxBHgYP01+ZNw4VTXfpg0mFqjI5KcOHGbBx+7I0oh2Hdpaist6uXP4rKt+cIenCUGNUrZzYtqqfHPczGs6ZfQ2QEtOFEBnG3UrYrSVfMWbl8SKYB/bzDvrkFIlLjtCmhFU/IbGuCz93HXec513zJOUALwf5EPkEs9e5PzVWrVTOdlgDGq2mX7WSEZB90Xjd7Oo9RFQh9DJlab266L+XGM8F0Jx/kOgzykvym7UbH32ZgY9J617TfgfqEzzxys930WUXlpn3bEpSIonMrgpdnrYozFXaVef0FyawT5u4xOJeZIf4Gfes0sNlwD7Bpzj3ZfkqubBgIQcE7JL6b2eYPwEeoDm9nCh0tPERr946Zcnr3PZMMNXS604QEXtp+d+p3TANqpU82Xymw7pml4AySj1wOnrGUjQYbiB3GnMnrXJnlLX6wuwysq2PBpwD7sUdTgkp0lxgl4BbDZBJsmPgUKq8v09dXv4/Zz82izfe9kszrlprAY7J+yw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(39860400002)(366004)(396003)(376002)(346002)(451199015)(2906002)(6666004)(41300700001)(83380400001)(66946007)(6506007)(107886003)(6512007)(478600001)(8936002)(36756003)(6486002)(38100700002)(26005)(186003)(1076003)(86362001)(4326008)(2616005)(66476007)(316002)(8676002)(5660300002)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YS0u0ipm+ToX0JeztYDHJUioWmyc82gZ+jXaE8GtYIWAqUvcrRBC6wAtPuO8a4WOjHf899txVprPTSNz7vCIqxpgMtSP8SdfC883WoPOAs0mBjtC+f32uAyqog0XmBqLfYp69tsgko2KCAYcuKko/5pFAHIC9Iz+d9iZu7UXucbk+gukORMCl9sQ5cx3gYvanFv6R2N6CHcc4APKS33qbT2Wil6WYomyjQdZv+U1gBJvLE/oJT/DuZmDXhQsmYwsHx+XXOi5AHBKpaQXh07jyXw11AhBhrgZZ3e+eZeWd7tVJsUlQ1L4Vb17cls5biLW/0zWMWrigtnCc+FuvejrSjDofJzkbRTyw6SdlH2lynDCe/5Yw+gX5tnQT5PInV/FHoVL3++GvbZdWp2TfPe8gdKxzQeJ/WwH7Rcal7UzNMRT7Oica7rYp3d9VRABVwsvsPF3A8KUe+UNE1lw4z9guexCzmO3A/UjJfe15etPAwy41z+3t9MafAB8X5VwJk2KlOVJ3NqufbGZVp5v09pfwOh980gret2zeeeCEn/Pn14A+8lINqTcLv5ZIcjTrN/uedpZj6WOCNRkGYfnrB3YwgI2f0aTLAN+OekEBY1KXdG2Y1/uLKz/frF/TK9sazDtvmWaUfWn6vIInSuZv4fkVv32POGjoc7Lag9pZRSoGVHdw1sIVLfT+QYQtYGcRjqAcixHSkFmLSzvZx5MIo+XWr8R04D7D22Cq4b7SNkPMhj3mxqo8w2PYQoiCb1uLW7jWEd4VFSiZwuWQv1mhtu1vb6ONyzk85ilypjKsklm4SblY6S6rMHJsDhDQMz14ESXmVrOyqjKKGmaLLk+iQVFAUH29xYV4kosnkXaItS/CIXlkdmBkIekmuOIsKJ7zKT0Nnadzz0yw9+L2AHQh1itX/isH2eq/vvzR1MbxSBaX8GtuOb+TCx/ulLuYKGy5My3E5wSA0e2WuibWm6nQIpFis847c0Zv/uZs343YZqG0owhio3bJO+MChUPOFP6HUeGQTWqbDVlF1a5CZOO6iFKwRTBG1oNXdeuQKqYQktyOLEBXOGv7mffkx71E/bjXDDafzHlkYokvdCOKwxXkcDfD3iiro/+sGphOsUw2jl6xdIP7rQygJmyc/EX4HSQnII4Q+sJU4iNOjFDT3cpFNjtSySoMvEDCa6ClaM9YvyZ0qXK2Pb7YOSKOXneld3ZvkZM8QqPqtFGIfcl4BIHXJBgkR5QquL8kDrVRUWxpgCy7ZOvZTe0E7e1uk4L3LnVIV0pa2pyMXb26Li4fbBhfkLUuNZYutZTVi0dTvkB9tO01JRz1Da7vKuLtkn5NnV5emWCRevHXOcCEbGcPJOoe2TOkPpOcWwTOjxwaTCt1yzlCxxn3+5HS7wGhcYM2S13l4kQfNmNoPZ6NWG1AsyKFxAOHHz+X8taF15wczwCxW/nwKGpdTV0Fpz7zuf+HeoJy6oPHYyqqZ+lSQP2+utLibuU48qBnaFhxn6grv/WPr5K0T6CBCh0nGRb2pK9lQD3IaKF4omJyeIXoh7hHYqarwWnYlLNv8z9KnpkpKwN6BfGWJhDeyfDF3tmMeG5IelmZkcs4XX9HEQFNHfsslLnk5pLZA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 848f0fa9-11bc-4139-06c2-08daa1c5f767 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:45.8481 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1Ca+mhbaRU8oG7EPB4alze80XKjIeTilL7M1MN+rHjNmHQ5JePY5kGwyQ/P9j+/t6bOqavv6E3Un9D+L+yOusE2yPSaKYiFoEIb880+K8Ew= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5872 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 mlxscore=0 suspectscore=0 malwarescore=0 adultscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: 1Mn-rD6y8UNJdq-u_Bha2Q6lXNnIm0bU X-Proofpoint-GUID: 1Mn-rD6y8UNJdq-u_Bha2Q6lXNnIm0bU Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This has read_capacity_16 have scsi-ml retry errors instead of driving them itself. Signed-off-by: Mike Christie --- drivers/scsi/sd.c | 82 +++++++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 37eafa968116..a35c089c3097 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2283,55 +2283,59 @@ static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp, struct scsi_sense_hdr sshdr; int sense_valid = 0; int the_result; - int retries = 3, reset_retries = READ_CAPACITY_RETRIES_ON_RESET; unsigned int alignment; unsigned long long lba; unsigned sector_size; + struct scsi_failure failures[] = { + { + .sense = UNIT_ATTENTION, + .asc = 0x29, + .ascq = 0, + /* Device reset might occur several times */ + .allowed = READ_CAPACITY_RETRIES_ON_RESET, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .result = SCMD_FAILURE_ANY, + .allowed = 3, + }, + {}, + }; if (sdp->no_read_capacity_16) return -EINVAL; - do { - memset(cmd, 0, 16); - cmd[0] = SERVICE_ACTION_IN_16; - cmd[1] = SAI_READ_CAPACITY_16; - cmd[13] = RC16_LEN; - memset(buffer, 0, RC16_LEN); + memset(cmd, 0, 16); + cmd[0] = SERVICE_ACTION_IN_16; + cmd[1] = SAI_READ_CAPACITY_16; + cmd[13] = RC16_LEN; + memset(buffer, 0, RC16_LEN); - the_result = scsi_exec_req(((struct scsi_exec_args) { - .sdev = sdp, - .cmd = cmd, - .data_dir = DMA_FROM_DEVICE, - .buf = buffer, - .buf_len = RC16_LEN, - .sshdr = &sshdr, - .timeout = SD_TIMEOUT, - .retries = sdkp->max_retries })); - - if (media_not_present(sdkp, &sshdr)) - return -ENODEV; + the_result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdp, + .cmd = cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = buffer, + .buf_len = RC16_LEN, + .sshdr = &sshdr, + .timeout = SD_TIMEOUT, + .retries = sdkp->max_retries, + .failures = failures })); - if (the_result > 0) { - sense_valid = scsi_sense_valid(&sshdr); - if (sense_valid && - sshdr.sense_key == ILLEGAL_REQUEST && - (sshdr.asc == 0x20 || sshdr.asc == 0x24) && - sshdr.ascq == 0x00) - /* Invalid Command Operation Code or - * Invalid Field in CDB, just retry - * silently with RC10 */ - return -EINVAL; - if (sense_valid && - sshdr.sense_key == UNIT_ATTENTION && - sshdr.asc == 0x29 && sshdr.ascq == 0x00) - /* Device reset might occur several times, - * give it one more chance */ - if (--reset_retries > 0) - continue; - } - retries--; + if (media_not_present(sdkp, &sshdr)) + return -ENODEV; - } while (the_result && retries); + if (the_result > 0) { + sense_valid = scsi_sense_valid(&sshdr); + if (sense_valid && sshdr.sense_key == ILLEGAL_REQUEST && + (sshdr.asc == 0x20 || sshdr.asc == 0x24) && + sshdr.ascq == 0x00) + /* + * Invalid Command Operation Code or Invalid Field in + * CDB, just retry silently with RC10 + */ + return -EINVAL; + } if (the_result) { sd_print_result(sdkp, "Read Capacity(16) failed", the_result); From patchwork Thu Sep 29 02:53:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612191 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CFFBC32771 for ; Thu, 29 Sep 2022 02:57:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234819AbiI2C5J (ORCPT ); Wed, 28 Sep 2022 22:57:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234797AbiI2C5B (ORCPT ); Wed, 28 Sep 2022 22:57:01 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADC3311E0DE for ; Wed, 28 Sep 2022 19:56:58 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28T1TdN2004390; Thu, 29 Sep 2022 02:54:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=N/lAKYMc7FVaq31yjlZqvr6REsuHt/Rf+DE4RL0B5nU=; b=fjaGX4qR544m6GwTrvYSAuuHgAD3VxbpquMj8r1641nzfUknomZcJx27JyQX9lqNbIVE NENjiq2oI6szLPgVa8lppRAcp4dFeQq4EDTVlju6iMEdCWDSkf3gnEkovRqPdEL+ZUh7 ZD3zY0hXAT8KTfRbkrRHX4JQr7gaIIps/AlLU8QcTwGizrriTGgUVfMOZOticDCmXr1y XseGrAEH1mWBWWNbbXA664A+BRNe5CQlvuMSRbdIrS2PJcPRY35JDAn77v8fvS9tw902 t9DIbaXFnzj9lfa4RlTaN4ixQ0Gt6yzzxPoe/VBhHfJd1mCyQ2XI6wcX2ECFjian4GQ/ iQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jssubkhj5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:50 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28T215Oh002239; Thu, 29 Sep 2022 02:54:49 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jtps6v7jh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TiLfFjz0Mh8fOWFqjo+vC81o/SLHQ5mkmxWhT45vAOM6kwyublUCfnlCVBgaR/EUbXR2QBAyOPq1XDZMCMUj7lzyRCDbXdJMyCgDOvUlf/o9Yq7Qut3Hhfpuko197S6r3j1El43/vf1ojOzUpTRSaQ6k/BaIu/kSjhMuQTulArcR4qUvOdVVHgM4mJppDzIDRarLpL4/s83slvWatMAq918QagvF8GS0ubJAwNZ0s9Vwo/YH2v/dGNkN76w0W0cLR1bz46ul2P8j1QmUUU/SiCS490sRHPOg+bDJ4c2DMBpMbJexpozyaiYJPxl0e4tdtH1Lzh9IL/g8MERD6TBKYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=N/lAKYMc7FVaq31yjlZqvr6REsuHt/Rf+DE4RL0B5nU=; b=IqnKJ8nzNX+XmtPqfvzd5Hp8mdITaomV5veWeiYP+FaohdApXYOKzYCG8a76ZSoygmKO4WgUPUQT2JYwf2DmaDbhkHOOx0V9TEAD0oUu06hL/8NMigpiZkfie7evEWdRPboTOvF4pXy/QJcLqLaVCpPKxDG0rprWg+hypLz4yP5uBLd1b3W+WFUuQk02CkScYmXxsXIgNcSI9E/5XxJFC00ihzt8v+2V+CaIzcqq5BClpc/RoQLNONvD37z4DC4PSxJKlB9RpAykFpDL67tfsTpku2jNTyXLEk2A8GqEG0Q7om3J1tqdw5q91pbfaovAtWQFeTLWiYZMcPNvX7Nv1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N/lAKYMc7FVaq31yjlZqvr6REsuHt/Rf+DE4RL0B5nU=; b=pof6BX1sYZcwlkMUBDq6HOvClD4cSf8/3d2Lzl+z4RQwswznIHBamshkqrx47lbK/4njNddCW1IdUr1JL6J6+5mmiCopx6U/ehirqhHSvHvMgesduwKvrzIx83ULwjDwyWRM9A+m681UdMaf9DKOXe4eQm/efkM5JZhSoIOa0EA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB5872.namprd10.prod.outlook.com (2603:10b6:510:146::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Thu, 29 Sep 2022 02:54:47 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:47 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 23/35] scsi: Have scsi-ml retry sd_spinup_disk errors Date: Wed, 28 Sep 2022 21:53:55 -0500 Message-Id: <20220929025407.119804-24-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0007.namprd20.prod.outlook.com (2603:10b6:610:58::17) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH0PR10MB5872:EE_ X-MS-Office365-Filtering-Correlation-Id: d23545b0-aa54-4b6e-5c28-08daa1c5f823 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DN3kSrQHFDDSoI6eG/59D0Ec64l3mdUDzkxXFQaetF0lV2ExmsZMyWj9rKqtyE4U7VxIDbyk1c+9RmPN0Xr+g3vC64XYGsoI/13t30Dr+VewjkkAGPi3c3juwcmIZyrdWG5JcMyGJpvFuzcZVNZV1CibOFKlqNz+/VIwZ8WKExHCG3RhzrWbG2PkYhy3uRKsu2PdrvP3jtOSOg1xZIu6dIiIZE+rRW/dA4F31CHpFinTygTRtg7RDgGjX+KK+cgb6aq+D9g6HzWV7x0aU3G1g4ztxCC7pgDHUpGpYyjKY2oCmgV6t9xxKwL/NN2WxMNoelNsNPfaX7u2Vs4YjyW59pUB6BxN3/7JA1OL0F0kXNwTquo22yGiK1ha+Sx1VdgLUb9im9Gu+kr8VvmbKklCMoeATAPNFoaeAMgLdAc3XMwVERACgP1XsJ6JHF0V8ptHs96lA1EpAaz8XHroP6PgmNuYNyPLexAfLidn0e63w9e4fhRP1CanEZAb4KzrzudSRjNQPCJH+8fhaqVu415jkyMwls2QwLteH8pEcTMByrukX1E5scKgmLcxSOTPTVqmt9/NnIvJtWH7ypTi3oe0TYDN0z0Z+O0wxRA7xgO5VgmGnM2yew/QxIhW9Tnn8icjm9GHuaeZEUQQToQr3Q1O4kNWumFZNmB0ZaMiCoGdpJcMslY1zrzeBwDsTs84rbhKU8rsO17PR0egzGU7h+Xh7Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(39860400002)(366004)(396003)(376002)(346002)(451199015)(2906002)(6666004)(41300700001)(83380400001)(66946007)(6506007)(107886003)(6512007)(478600001)(8936002)(36756003)(6486002)(38100700002)(26005)(186003)(1076003)(86362001)(4326008)(2616005)(66476007)(316002)(8676002)(5660300002)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QKwNa7xVp8TRvcQJ9ydYDZuq4u/Lk1HvhdllRt0uotd4ZpZUURkv//FfPW9q3tmAo+iMuiWSvlm+FaIsSmv1uJ844uF18QdX2C9viAzWi7BGnJVypOYRhdnrcTij78ImoHtvaaIN4yeADHiBIEV9hfBF9L60AQD6409EBzwBJd2W4ronRvbRdPdwn1jw2YpKuaIG890CdCRb5zkwWLwAvdpslnPTEiAe/P4VGYhddpVrKOQu8pRVNVnXF94wLbi0BhVlnqudJv9QNQab9Sqo5lErEn9wZSVHJEcVZ4eJxVLAW73skuUfsPmT5sKENdVCR3es5UMR+dumKLuT1yzMMebST+QM6brQ4dSx/L+0Vurn5UlLi3gjsJ55UAAL+4SljC/Gz75nfW18DthBDad6fQzOC6C0fIeKmZW1eTx6NqbTQhHCQeTK9fDmQMITlRznD4yUDgPqvOnv7GpEDMwaDt+ednpkIXU+pTSLpPkzIh4y4stRIof8FE+0JEwYoEchB2cZYktGkMSu9ZeubxTEI5lVeUEOnyV9n1mMDnUE2VC2SS05d+Lt/sMWh/fvG7rfc9ala/fZkG0f20cWMvIuX60G6K3L9sQ1nrQVmbThORXP851Tgasb82vMyi2rJrhd/YtQ/tA906toYGwItApRCLr9Gm8h1wbuQYIl7mzL1WpB5eMY0DJZ2yNr897l54n7D6r9Mr1LPRrqva5ShxyPWcRbrQjRrEZ3KKdjoQocatvW8cACcm7xaugrUGc5o0euETOVWqgYj/G5VPcK1G3sfRRQ5/dJDixFT5lci6GvfexaCLGdWfdMMy8Th581dY4xTOa/rk3C11MdtwtfNoL8nGcXPZVnKZEInU5YFAbcsZGuIRJ5UgsDRK6myR/AbM5SLqDIJePlx1BCJuJtw7TVGkYRAxnkVNpVhezMyZBGOpWfXwNb8/oM84PqJ4mT1KCNLZGG8o/bZEycLqzxT3ZYMCKlg5REiPCH29Q1l7Oh8QvFP6Qt2ooWgJhsBPfyptaMwr3BoAp5QM4cnzlP8vr+nJB2rIimwKFYV8bSKAEWpUwZBC7fiuUT9uPk5QvgK+n1Grgl37rQM/ZQgdG7selIyV8cljxx8bMtQaO7B00f5myRYNgznHP3/ODHxK8ImX5YUcJ4DJ+2swmFcswGtDS0moOcCsh+GZhCpYRwFkXIe1rBY69dapi2So651vZIaiuifwPkyMqGig6wOanYa2+rlBmZXH4Uj2xb29svlYse2TUMEc4DtJslZm8s4qaL1pVAsg92z2kOLP3Mm/u60PGOo+cs4avPY3FSMMM4ydl3qGg6rRgkw9YZgiXYGbB52i5i5+RAiCGqb5EH06N28hv7c8KlQWpsPGZ3zAIBZc7C7s/eTIS8pkiSxE3I9Qan6nYmdK7IddWJl+DIr/yJIp8y9Ta/TuBPOw03MMxqFZgygdwFAlkIp48h78/6R8VyWIl1wacZ8+Lsql4GIRs3/J+VgeX2M+Ja/6kDk1YlPS/N4n+SlB/keGXxgNzApx/4GV3myH/5T6ng88DpG4WuqQGMnzONiVMveIv42PMwrxBmtZiDPvOOClP6wQZBJFKxmp0q52b43Dpyr0FyTxRc7nC07A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d23545b0-aa54-4b6e-5c28-08daa1c5f823 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:47.1136 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TuMy6ygydtHpjIq45S6WLW9hhZMsDAy+poZG2/nBgvU2c+0I056G8+EIEcbvy53JTB90sYoRmbdfK/28ehSPkvC4kh9kn9h+0dSvBpNWhok= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5872 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 suspectscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-GUID: LUJfJHJit79LlgUSTyJMp4beLZPHB6nf X-Proofpoint-ORIG-GUID: LUJfJHJit79LlgUSTyJMp4beLZPHB6nf Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This simplifies sd_spinup_disk so scsi-ml retries errors for it. Note that we retried specifically on a UA and also if scsi_status_is_good returned failed which could happen for all check conditions, so in this patch we don't check for only UAs. We do not handle the outside loop's retries because we want to sleep between tried and we don't support that yet. Signed-off-by: Mike Christie --- drivers/scsi/sd.c | 76 ++++++++++++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 31 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index a35c089c3097..716e0c8ffa57 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2064,50 +2064,64 @@ sd_spinup_disk(struct scsi_disk *sdkp) { unsigned char cmd[10]; unsigned long spintime_expire = 0; - int retries, spintime; + int spintime; unsigned int the_result; struct scsi_sense_hdr sshdr; int sense_valid = 0; + struct scsi_failure failures[] = { + { + .sense = SCMD_FAILURE_SENSE_ANY, + .asc = SCMD_FAILURE_ASC_ANY, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = 3, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + /* + * Retry scsi status and host errors that return + * failure in scsi_status_is_good. + */ + .result = SAM_STAT_BUSY | + SAM_STAT_RESERVATION_CONFLICT | + SAM_STAT_TASK_SET_FULL | + SAM_STAT_ACA_ACTIVE | + SAM_STAT_TASK_ABORTED | + DID_NO_CONNECT << 16, + }, + {}, + }; spintime = 0; /* Spin up drives, as required. Only do this at boot time */ /* Spinup needs to be done for module loads too. */ do { - retries = 0; - - do { - bool media_was_present = sdkp->media_present; + bool media_was_present = sdkp->media_present; - cmd[0] = TEST_UNIT_READY; - memset((void *) &cmd[1], 0, 9); + cmd[0] = TEST_UNIT_READY; + memset((void *) &cmd[1], 0, 9); - the_result = scsi_exec_req(((struct scsi_exec_args) { - .sdev = sdkp->device, - .cmd = cmd, - .data_dir = DMA_NONE, - .sshdr = &sshdr, - .timeout = SD_TIMEOUT, - .retries = sdkp->max_retries })); + the_result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdkp->device, + .cmd = cmd, + .data_dir = DMA_NONE, + .sshdr = &sshdr, + .timeout = SD_TIMEOUT, + .retries = sdkp->max_retries, + .failures = failures })); - /* - * If the drive has indicated to us that it - * doesn't have any media in it, don't bother - * with any more polling. - */ - if (media_not_present(sdkp, &sshdr)) { - if (media_was_present) - sd_printk(KERN_NOTICE, sdkp, "Media removed, stopped polling\n"); - return; - } + /* + * If the drive has indicated to us that it doesn't have any + * media in it, don't bother with any more polling. + */ + if (media_not_present(sdkp, &sshdr)) { + if (media_was_present) + sd_printk(KERN_NOTICE, sdkp, "Media removed, stopped polling\n"); + return; + } - if (the_result) - sense_valid = scsi_sense_valid(&sshdr); - retries++; - } while (retries < 3 && - (!scsi_status_is_good(the_result) || - (scsi_status_is_check_condition(the_result) && - sense_valid && sshdr.sense_key == UNIT_ATTENTION))); + if (the_result) + sense_valid = scsi_sense_valid(&sshdr); if (!scsi_status_is_check_condition(the_result)) { /* no sense, TUR either succeeded or failed From patchwork Thu Sep 29 02:53:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 610824 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8951DC32771 for ; Thu, 29 Sep 2022 02:57:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234822AbiI2C5S (ORCPT ); Wed, 28 Sep 2022 22:57:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234842AbiI2C5B (ORCPT ); Wed, 28 Sep 2022 22:57:01 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B06C811DFEC for ; Wed, 28 Sep 2022 19:57:00 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28T1TN0l011051; Thu, 29 Sep 2022 02:54:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=7e+b7zRKR+31Pn0JUOo2sNJrVnTRN1/KpqjskzN3Dm4=; b=Pm2FATiphvr9oqro968SSclBQpXGeSzC8qcO8+Vp823e+wryn9vu/0O/nowUoFdzi/FS Dx4UC7G1u2sbjpe+WcC9ngCyORjo0MsUJr2xo5C0KN5HXmJygBFXRsCP0yPJ/jC1J+FN M/S9FaqNXTqacpyIvWW0b5kmPz4tJzdAv/ofqNgAoS/l3OcUr11K+DT6gD/iVgWeDjaD UaICCXZgE9PFgcMw5JTMnidaYFpqwh38rvhWsmvmHCtG99PABER8o/vsvDmJ3cvz1W9V gVo7Ejb+I14u6ZFnOgnIbzikyaMnJfNtcvwtNRh+x2/18q4J+lrHRglfmfykhQL+LDTz Cg== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jst0ku9mj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:51 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28T215Oi002239; Thu, 29 Sep 2022 02:54:50 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jtps6v7jh-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nfUoyPw856dkz3fdlehQmNqS6jZXsOotStRJ4euBG+D3xhb744bYGdVOosM5qh1ceCmplQfjoP0Ph1LBXxkSudAbFrmoUwoZambaCbvLfFLESX1axl9J/jMuP/DywnzrZA0/w8Bno7V50KC81gDacMMdmcsjs2+VXznGMyrK9sdeNwisyhNad5IsGmhk9KUw18DNoGOmqrSTsGPH+scimq9h1eFQy6fLA8qwBrlajLjEmPeHGb5G7XLKWyVoP+LZ7nlW9+xa2gEYgPjd1+Wt8hFHEgMvZ2n1Ed+cVC6L2P4ntK2KOBvjxt13SLudmuILeB31AHao5XMRfr5WV2T+yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7e+b7zRKR+31Pn0JUOo2sNJrVnTRN1/KpqjskzN3Dm4=; b=eL1Zc3Zgnx6l/8y66d2yFUn3GFN4JdKgMSeW9xfNmpxlb0rmwVpBjnZpWJ9Dpwoh4eXF5yUBIKaWPX94aXeE8l+MHRcv5v8baU5X87GDOTzQtBi0ceLbgl9N6ml/ZYQBWNO3suLTB4gPzpjFVqFX8psf4G0KZdVFpZE+rf5uwkTFiyUO0oIKzmleOsSGW+faLzOcgv722SmPbKXk8hSs3KfPJdY5sUCRZ4qA4TZD9qlqS3seKYGSGhr9gV8vSioQ8V9fvQCwYnOmngY+ICVQrmSYNFDCAwjS7WybL+A9pJ2pFPFNKCjW69erE0bxU1XS0Dhuvu5AGP4/WeAxB4cziQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7e+b7zRKR+31Pn0JUOo2sNJrVnTRN1/KpqjskzN3Dm4=; b=GJOXtc+y4gAbEktb6IWd6Qe3EV6y2sBHlVXFtPi+6Mm+wHj244NWk9AgB6wDyvzTiY0lMXkuuL4JN3aNxZQx1VyCAwBCBRJiG+MvIE3EESwEuRYSf3OUplBaEEg8Oij5afPuwDa5ddzQfPLkj51zxYCLWG3ecR5E8BDwR+8ZCNQ= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB5872.namprd10.prod.outlook.com (2603:10b6:510:146::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Thu, 29 Sep 2022 02:54:48 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:48 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 24/35] scsi: hp_sw: Have scsi-ml retry scsi_exec_req errors Date: Wed, 28 Sep 2022 21:53:56 -0500 Message-Id: <20220929025407.119804-25-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR19CA0029.namprd19.prod.outlook.com (2603:10b6:610:4d::39) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH0PR10MB5872:EE_ X-MS-Office365-Filtering-Correlation-Id: 67807988-b1dd-4037-9ad8-08daa1c5f90a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dB2iaEhPrEaNj88rZfwAVPcXQY2JTRdPa05J4o/IvPqnAzJhLdNJegmKh41xnDDwQfNse5+lCLHksicc2zH2nk1IHbhDmbClNESEgkw71TfcvzSBXqXYF/4DSi1y6cGcYTHLafZwn2kUn7LPiB6TyGhQkOtKJaakLzhbvZWhHn1nbRHA5Xeag+p4EA9Q0cLGkTN9T0SJB3RlMuHFAmrtx8cfuTSxNJFWmgls3ogjwWQCAYC73THRmpuyAtRzyUh2veYp1Civ/l9emgR4J/kLrSxEwQL/lAMzl6Zt+yBpZCD+h30somqgVmiWWDrUe1Gd9WNXfDsRMEmJtad1JMgodLjwRCWV8ByxFUdabTvm/JY02z429BYYre1SlYVOIJ7XuddHqx5O6a4NymtBioKr33hKZRJ4N3mGaxY74wWj3x06S3lVCilUrZPiv9ZNSOUh+MTwCN2QnhV+z8hIahS5G+jUDdiR+Zs13EUUoYXgjlwwk4eMvBYw++2nycvMwUvAEglgyROGYeggc0On22FL31uMjXQwMk4KPxkW7r8amS13vjFGy1b4h6IDBYM33keUCI3J7Fif84M291xMQHprS6Ii4Oj2IWvY5q9CqvkQrDM+aPZibSz+KJlB6iGdgZgq/bNkyA7fXjhSOlaFgHOKdSrecRT1yeb9toIb2FfY9UV+9aV8sJq3uKdV8lC2jEOtuct4R9Zpcg/zkXNzEHFpHQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(39860400002)(366004)(396003)(376002)(346002)(451199015)(2906002)(6666004)(41300700001)(83380400001)(66946007)(6506007)(107886003)(6512007)(478600001)(8936002)(36756003)(6486002)(38100700002)(26005)(186003)(1076003)(86362001)(4326008)(2616005)(66476007)(316002)(8676002)(5660300002)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8MkEnHKuJ4nR2GAwJq8oYNX43G1kF/2Kj3Vzjg96zC4FMymyVixq5USbbPOx4c6saucStVoBsdfjnfvg/cPYKVamezdLlee68G4VNtY4Qy+YYpyAtjK8bu5DPoGLMaQ0rfq4CHxN+UjDIckeTi3jJ16PEc4afdxf71W9aM5UEJVTH2nxzVXYZDQF2YluFhlq3lkvKleGG9jM0OCT/ykEZuEyU5VpK7wPc9eQYsuhSl7ZzyAzMZLboS4S+Z3Dg2/un2Mc0Mx94WnZXhppemMKVrf53aexSnQDzGyETtsmt0S1cbnUSnI3KzuAip3xeLUNPwkAzHdppo4MhK0chpu/f80zEifrBhRppDN3BsC7KjrNZK1EU8Zgjep1IwlrpRrKAMfGzGeVn2T446ok3nNgHJjDvWeLDOXPAympNEs4UlJTH3I42SOMmfAcPTIP6XFKsJC+DxioCBrmspN0EltHoc5X3SBJIv3qFoH9DSL4BtKV/qrWTCszaVxCEFIMbKKZCay70RL2k/dtPLPncuOgu9Q1Y4yw3UKTb6VzX0kfbN0g8pMDzzU9zWj5rDMwZSxXdFJ/Foipusrzz2WNP2uazXUAuyj0qjt6tqsmTj++IGMGOKxlQNxnh3QI6W3W8SDRHzczcFuHcdW6jTbTfI1wIVMBSeQISUzOaa7eVhXRZxKi1u+awEmcRvgt44WfFxM3ftVKfbprn37VVdXFP+KZ3c23r8+yPc7SM11oU+7BSKXxUfdfeRKMqToy6QDeB0QiBDpL3J1Ml316qsXNpV7QoKXkWCDNUqt0ECVH2N90ZKwWLBZvS02S0zNSLP/MSy6Zcqb8JAZm7QfEPV6Yy28YzCqPxhCE+yOIy8hvV4+UzBBi3bKimoykBOTOgSUZNq1iz+vn8M6nGNZJ5u62nuOYvj3R/SJ1fK/iD+GDOMIlg0RDpYqZ790y0pQvgV/I/W+P8h3k7G8s7bbamj41zodltKNLiPDxyxx3zezdJPNN4G4XtTqQkGCcLabK6sDGm8TUQ/NAHdtqcWhMdi7RAdAFc0QC4lku8XflT/1USNiwcPBJkLj5A/+Zzz7HPkI7HcnDLi4u8T2kVAIfW0o23hyKnA+Cm6+xqcLoxDUquQZLMUcJne8wAFJJesAsIoA0D1k+inQE1apSKNukDDpMDbgJfoGo4KUIodoTKlYjskuN/R52K1qKgenl+hIq4pyuFma3ojYl3dLPW/+KE3DP9vdKysP0W5fuS4m9eU8LY1NSg4zFclKBV7uVbL9VDoAaa04x/ynMXNWeLGbE6cj15/PQzfiqwhTOk+zbxSS0SR1X5d3Abb2dmcXTg+6LUot5ldD+gndFZGS/5Cffwp1fg4lqcjMzyOmJwildDXIBgvh2WYcbfgNzMcdC1gwByTTvz6dt5ywXhu/g4YHgpwi1yOX8VOq92fup3bvxbzcS4TSliHYsxkWxSLwZAsnvpBJOINjOOTGSZuvW3re3kP6hNKK6syrIH1bYbmS/pQvLLh7kzu8cyJGcFLbEJ8w5NsLKWNnS8YFcND1qed7XHAMD1KbzbBd6LYH1+Z5wUgH3okKSxMTNRUq4bo/v7nrdVVVG/5l02ccal9ql3pEH9lWXD1ttrA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 67807988-b1dd-4037-9ad8-08daa1c5f90a X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:48.6603 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 18S4ESuYQoJpvOaNmd0KL9M8YPLVVPM7DYN9oKo08ukVmEpV3DecUhG16t4mCN4qYhSbM9XmN5jfTLd9Ore2HafAf7Lb5OEkNQtd9mJT9u0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5872 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 suspectscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-GUID: V27FFHwsVc1YZpwPc8kDNDAb7t9OPQrc X-Proofpoint-ORIG-GUID: V27FFHwsVc1YZpwPc8kDNDAb7t9OPQrc Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This has hp_sw have scsi-ml retry scsi_exec_req errors instead of driving them itself. Signed-off-by: Mike Christie --- drivers/scsi/device_handler/scsi_dh_hp_sw.c | 58 +++++++++++++-------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/drivers/scsi/device_handler/scsi_dh_hp_sw.c b/drivers/scsi/device_handler/scsi_dh_hp_sw.c index adcbe3b883b7..c186809f2e17 100644 --- a/drivers/scsi/device_handler/scsi_dh_hp_sw.c +++ b/drivers/scsi/device_handler/scsi_dh_hp_sw.c @@ -46,9 +46,6 @@ static int tur_done(struct scsi_device *sdev, struct hp_sw_dh_data *h, int ret = SCSI_DH_IO; switch (sshdr->sense_key) { - case UNIT_ATTENTION: - ret = SCSI_DH_IMM_RETRY; - break; case NOT_READY: if (sshdr->asc == 0x04 && sshdr->ascq == 2) { /* @@ -85,8 +82,17 @@ static int hp_sw_tur(struct scsi_device *sdev, struct hp_sw_dh_data *h) int ret = SCSI_DH_OK, res; blk_opf_t req_flags = REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER; + struct scsi_failure failures[] = { + { + .sense = UNIT_ATTENTION, + .asc = SCMD_FAILURE_ASC_ANY, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = SCMD_FAILURE_NO_LIMIT, + .result = SAM_STAT_CHECK_CONDITION, + }, + {}, + }; -retry: res = scsi_exec_req(((struct scsi_exec_args) { .sdev = sdev, .cmd = cmd, @@ -94,7 +100,8 @@ static int hp_sw_tur(struct scsi_device *sdev, struct hp_sw_dh_data *h) .sshdr = &sshdr, .timeout = HP_SW_TIMEOUT, .retries = HP_SW_RETRIES, - .op_flags = req_flags })); + .op_flags = req_flags, + .failures = failures })); if (res) { if (scsi_sense_valid(&sshdr)) ret = tur_done(sdev, h, &sshdr); @@ -108,8 +115,6 @@ static int hp_sw_tur(struct scsi_device *sdev, struct hp_sw_dh_data *h) h->path_state = HP_SW_PATH_ACTIVE; ret = SCSI_DH_OK; } - if (ret == SCSI_DH_IMM_RETRY) - goto retry; return ret; } @@ -126,19 +131,33 @@ static int hp_sw_start_stop(struct hp_sw_dh_data *h) struct scsi_sense_hdr sshdr; struct scsi_device *sdev = h->sdev; int res, rc = SCSI_DH_OK; - int retry_cnt = HP_SW_RETRIES; blk_opf_t req_flags = REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER; + struct scsi_failure failures[] = { + { + /* + * LUN not ready - manual intervention required + * + * Switch-over in progress, retry. + */ + .sense = NOT_READY, + .asc = 0x04, + .ascq = 0x03, + .allowed = HP_SW_RETRIES, + .result = SAM_STAT_CHECK_CONDITION, + }, + {}, + }; -retry: res = scsi_exec_req(((struct scsi_exec_args) { - .sdev = sdev, - .cmd = cmd, - .data_dir = DMA_NONE, - .sshdr = &sshdr, - .timeout = HP_SW_TIMEOUT, - .retries = HP_SW_RETRIES, - .op_flags = req_flags })); + .sdev = sdev, + .cmd = cmd, + .data_dir = DMA_NONE, + .sshdr = &sshdr, + .timeout = HP_SW_TIMEOUT, + .retries = HP_SW_RETRIES, + .op_flags = req_flags, + .failures = failures })); if (res) { if (!scsi_sense_valid(&sshdr)) { sdev_printk(KERN_WARNING, sdev, @@ -149,13 +168,6 @@ static int hp_sw_start_stop(struct hp_sw_dh_data *h) switch (sshdr.sense_key) { case NOT_READY: if (sshdr.asc == 0x04 && sshdr.ascq == 3) { - /* - * LUN not ready - manual intervention required - * - * Switch-over in progress, retry. - */ - if (--retry_cnt) - goto retry; rc = SCSI_DH_RETRY; break; } From patchwork Thu Sep 29 02:53:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612187 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFAE3C04A95 for ; Thu, 29 Sep 2022 03:07:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234758AbiI2DHc (ORCPT ); Wed, 28 Sep 2022 23:07:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232666AbiI2DH1 (ORCPT ); Wed, 28 Sep 2022 23:07:27 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D261122068 for ; Wed, 28 Sep 2022 20:07:26 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNiRoP003459; Thu, 29 Sep 2022 03:07:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=7H0K2J3RBkHTQ9Wywq47pqi+uDpftumCY3x9sz85apU=; b=H8W4h+c4PqxoZ3rNGmuFOud0WQMuhSBeouNeAwkBh2Ul1RJx2jEMhujjBiGTX4rCM+mG 5wKd4C4dMDYTM+cEmTh06Co2ii7D5vkLSk+q4RgrXA6h0y8IsgEof0jvWhhS+vg+u1/R g+ttQWtCEXfrY/TXpfT1z+E0KyaRYth4uvvEn0h9wjU1I4kYsuzDQ93wKaKFwd3NNAN1 S1BNIpICEYufSWs2eHdVDJ+mK+dboz5rgHj/HxKd24rxZtm5khTX7/9dCP2MQMwXbrU3 vVzviYJESA0Ftr+03Jt3NcdGmrmgAAaAJ4z8Y78QMDZI0i1o2w24LCCLey8/cLZp/cGk kQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jssrwkjqu-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 03:07:18 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28SM7Zpk033772; Thu, 29 Sep 2022 02:54:52 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2106.outbound.protection.outlook.com [104.47.58.106]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtpv22qw5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hm29cRiBJZaqrz7kh7vIr6QfNkPvdcBpcD1GtB4BoBLFit1wJpjCRQdIWN/B4mfKwLoABf3Ru6GCsYTfSqYJD2p9zwFgAlAap6o1yVGtGy9tecANOP6v7lbqGaERL4W8AIZ0NXrwkk95WH7pi14ZUd5BvURcY6QQlRtZurKKIdWrCerXvpUCiOknF7UW7WvN+tgbyS8nYYTUN8QtudXbWVnOvZtGb3yUwWTVng0Xy0NaQaF+assL3wVSMlxjeZsWS3+VnFntL6DIxIUqiwUCYoco1pmK8G9yAfDCBcMyeGXMo6/VqempPRAb+Oywn84L8lnl5tUd29i1i3jXWJbtHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7H0K2J3RBkHTQ9Wywq47pqi+uDpftumCY3x9sz85apU=; b=DifS6zlRnZxyxbe6I89mFXHI5xptecr8yT8inN+b5Gf/OvEBgHiHyAV/m9QkCdfLlzA5ksd3Lbg/hPB7vpvaTlA2P3HWglfKQ7mFqfHGq8OF/bkhmLuhWBFgByS5FgqVqWnKDMUhp+EECiMojOzvwc1DRbG1DFo7r4eyvPNoTqAgOe2alljZ+gNfj+4ee5JXLgm/zFd0OIvRyHKX0gQa17eoglcN6614D5XYDUV34Z41qPK5PsH4tPe4rDwa7/RlIJKRz0S1HXTRWtJNS4zPAjWrseqY01+E5MaJ1cgRvlR+74/GilzND3dEDrdny6w000msxgVkWTAJuxt9f9dDQw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7H0K2J3RBkHTQ9Wywq47pqi+uDpftumCY3x9sz85apU=; b=lLgGft5lfoNvpAqwlBkoIp35eNMXa3DM01qxgcsw7E1PyEiUSYUw3nqGsu5PWNK/nJg6DGhn0uuu1JW5qg5Jlmyw6Zm8CPHyxzPDKKy06RhED5jVT/LmRkQQbCOq44wN8Ra8MoRnzTV2jaiDkXkjXuHKhCOgN17CqfzbM3PM3Hc= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB5872.namprd10.prod.outlook.com (2603:10b6:510:146::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Thu, 29 Sep 2022 02:54:50 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:50 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 25/35] scsi: rdac: Have scsi-ml retry send_mode_select errors Date: Wed, 28 Sep 2022 21:53:57 -0500 Message-Id: <20220929025407.119804-26-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0116.namprd03.prod.outlook.com (2603:10b6:610:cd::31) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH0PR10MB5872:EE_ X-MS-Office365-Filtering-Correlation-Id: 07da97e4-d571-46f0-ee23-08daa1c5f9e5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oOJF/r+rgEKkfqEmbnn/joCWiwGtMKL2cHjBhp6cQ8u4htCeLylpF43cHhBPR2T4m/eSX6CLxc0af6jbzRn2nSet2b3T904KCTImx5FR7CzML+u3SoimEP5speuQQbGSoje0gSjcZYISyYSsFD9xQsBzxlCMcHhxG7cNkDbAzqWhOzoc+dwN79d8ldDOtAybZeUooVDIcYfX1QFBD4DP6RQCuyU/eVFtK8Ta9aoRemG86n/tSRXZnJBkb8OhpiL1HY1cJipS7p5celq+7G9uY2uQIIqtNFVpp8HWJYyRyWJnKj4giX8HldtN4p5T9RfrB8qcWTvVR451zK0GlSczx1xaIoTK7DjL3gsaORPiCNJoQ/eEaWeBcmV6SfB05lknWQwJ7HKxH4caRa7N9N3LBtRujh+QP1k6wBD2yH3iQnvJebAFyt5GK5HORDyRqhsLj7x/M+lfGg6fDpAO/aCkKTGygIVbEfmBWC0C2oBAw3c+KYPIcPUi1LANkpHlfGkwK47qJXGv/MN6CldZMulNEwIx1j9uaTvirIwXK/rnBFq7/cEpoFV9lemxCWqaaUIA/jr4dnUk5A0eiLGdLH5ovNHMwMwTKcBj0CQueCDecdnY9NO4msnTZRtWgA/8LUzVVLTRXF4nsYCNspSYYQf4TZ8LWDPNH3g1zzL4lTuOODziL+dUCYnAv0STzgTqntecrlD//IP2PG5J0GrJlML50w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(39860400002)(366004)(396003)(376002)(346002)(451199015)(2906002)(41300700001)(83380400001)(66946007)(6506007)(107886003)(6512007)(478600001)(8936002)(36756003)(6486002)(38100700002)(26005)(186003)(1076003)(86362001)(4326008)(2616005)(66476007)(316002)(8676002)(5660300002)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: elTDgbcAuwzZ1S/Yu4MLiT/TCgOowK46PFNSBS4wIaG5Ez0PGI6h+T3X+d5/M27/zJmnsIL+grdhDHbwBqPWu1eOK215VmqUDY5F3OrNCuYiDI+WaaHUk0fSShMWE4BK0HrGEe/5hWb/z836xr+oGP9ufMI5AyHNWoPzjSXUXQ0NjPgRDj5t/FG95rOerukgLDxCjRPxemDQtogh1cu+zUUmzJjr7f101kJvsh1vBlxnnbJYiZN0R2xtpTdq7xrcF82MXTxQwEYiBlVauVaHEpQJv5/MBTwzpu88xYihHl42QSyqYFr1dMT8wZHnEOoRG94zD/EKKRfb4VhKHEhKFdceF01/5ouWEpFOiorsO35pSvuTniWvqUKkMf28Lea0lmOjSkLz0DcXarQDcSo2amiO/9qlExlmhd3uCJNgcaB6D5ZuUuuEo4Zrl6vpXMkdvbsev8pisQMaKRCztS+wsWwNnXwsW5qe6ZG3clUUB3CmytqihURn99IUQ7Y7YEZxJZg7/AGKWv4xtSLrnxk+JI1y3waOzH59VMEtIURit71YF4IwFwcHj8ccW4PlaPufxG8x82Qyf5JvdvO7/LJ2Dq4XAVRVdIU1QLeETb5wl3ApEmBGaie2T5F4c+mhfl/RZIqXR9jUF3T0xqrLEJbVOCzihro+QZbhXgirfMpITsrO5jA34RBvc0MzXBq/PvSuBfM2QcCTFh2qOh4RxOcdY8f3M9udNww66SIHi5VIfvAa5dA5yqdf5fUdqaT75sONU0AOKChbyKlDRSKWDt7hgyl+Cd3TKUdqUDOgCNWxf48yQdBsPFFL2Husn+QW/2LaimCgyqYriY7r4FID7rkUyDiBVka3ByrsHM4ky4VCybECZ9H9fxSkPtwROEpjaQXLIXkUleh66uYFNQ7nAJYVMxCjIPoqXvaK+aSiRj5nk0BNPwO478nplDk/RlU9oFNE9GH3gekvy3/qdej6NYsmpjq9677UEcCrCU2ww/KP6MmLYK3DlO2m+yakbr6ea9IxArpLsaGq9HkdQ+/CHTSffjuRkPxdZrEZmgM1w0SSdVv0wvJ9+Jhgz9aaXwPrPNf1klJTAF1WsWm1Uvb1EHPkXQLydNhggjQhXRAqwnmy8ap2fNCbN0pWeooeYkXNquV6Vbe5wbFvidX05T6S+VxZoiL7b7/p4ahETz/Y/4gF06k+7cdBOJ2cgZ8W/s309uJ5/5ASRddQ0lYgvwNUubAemLuzwnX7dK8uQUtYZoZ9rgU6fdsx3++D9k2tskBvmqa6IRuGgzcl8ndW7gWjxzYcPXMy0Jq98dzy6i7eYDv/cWUrKkAnB2/54BqCZdNnbKn1D7770BN7YQWHD7fItSh9EqH0HrDa/Z5oqm1/RdGm1IU/2lmjytC/OfEGG/+oD/NxMI9H1Gv00qfBD3/wcolJPRmL7Cq8A3mTQ6VqbWjHdOH7FewrKmtwcWFIO3Mz4t/DbPjlWvZQJXmty+AuTACwi7lj8ceVucD6Jq6gB2MuZXhu0shQEdpVZD90FY59uF2lfcihUM7f/xrQ5ksOJbzaYUHcXSr9vD78A5uOQOyhCTf5ILH9Mu7QTzdq2Lcmqp45o2UvZb9rrpUeRvKSkJDHKA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 07da97e4-d571-46f0-ee23-08daa1c5f9e5 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:50.0508 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QJ3pZHhp3bIO/x7Ef60uoyBNyFia9PVzPN1btnpCo2uw0bUxOK2HIfD5NdZL+/xkB3UKa6Q09XAMMImtzfmyPjaKzbX8RXeBC5iGLPh6rHI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5872 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: Zt-eI6eEP2uwzzn8gU7utJt2VzF9Gnhg X-Proofpoint-GUID: Zt-eI6eEP2uwzzn8gU7utJt2VzF9Gnhg Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This has rdac have scsi-ml retry errors instead of driving them itself. Signed-off-by: Mike Christie --- drivers/scsi/device_handler/scsi_dh_rdac.c | 109 ++++++++++++--------- 1 file changed, 60 insertions(+), 49 deletions(-) diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c index c4d1830512ca..480185d57071 100644 --- a/drivers/scsi/device_handler/scsi_dh_rdac.c +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c @@ -485,43 +485,17 @@ static int set_mode_select(struct scsi_device *sdev, struct rdac_dh_data *h) static int mode_select_handle_sense(struct scsi_device *sdev, struct scsi_sense_hdr *sense_hdr) { - int err = SCSI_DH_IO; struct rdac_dh_data *h = sdev->handler_data; if (!scsi_sense_valid(sense_hdr)) - goto done; - - switch (sense_hdr->sense_key) { - case NO_SENSE: - case ABORTED_COMMAND: - case UNIT_ATTENTION: - err = SCSI_DH_RETRY; - break; - case NOT_READY: - if (sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x01) - /* LUN Not Ready and is in the Process of Becoming - * Ready - */ - err = SCSI_DH_RETRY; - break; - case ILLEGAL_REQUEST: - if (sense_hdr->asc == 0x91 && sense_hdr->ascq == 0x36) - /* - * Command Lock contention - */ - err = SCSI_DH_IMM_RETRY; - break; - default: - break; - } + return SCSI_DH_IO; RDAC_LOG(RDAC_LOG_FAILOVER, sdev, "array %s, ctlr %d, " "MODE_SELECT returned with sense %02x/%02x/%02x", (char *) h->ctlr->array_name, h->ctlr->index, sense_hdr->sense_key, sense_hdr->asc, sense_hdr->ascq); -done: - return err; + return SCSI_DH_IO; } static void send_mode_select(struct work_struct *work) @@ -530,7 +504,7 @@ static void send_mode_select(struct work_struct *work) container_of(work, struct rdac_controller, ms_work); struct scsi_device *sdev = ctlr->ms_sdev; struct rdac_dh_data *h = sdev->handler_data; - int err = SCSI_DH_OK, retry_cnt = RDAC_RETRY_COUNT; + int err = SCSI_DH_OK, result; struct rdac_queue_data *tmp, *qdata; LIST_HEAD(list); unsigned char cdb[MAX_COMMAND_SIZE]; @@ -538,7 +512,49 @@ static void send_mode_select(struct work_struct *work) unsigned int data_size; blk_opf_t req_flags = REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER; - int result; + struct scsi_failure failures[] = { + { + /* Command Lock contention */ + .sense = ILLEGAL_REQUEST, + .asc = 0x91, + .ascq = 0x36, + .allowed = SCMD_FAILURE_NO_LIMIT, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = NO_SENSE, + .asc = SCMD_FAILURE_ASC_ANY, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = RDAC_RETRY_COUNT, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = ABORTED_COMMAND, + .asc = SCMD_FAILURE_ASC_ANY, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = RDAC_RETRY_COUNT, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = UNIT_ATTENTION, + .asc = SCMD_FAILURE_ASC_ANY, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = RDAC_RETRY_COUNT, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + /* + * LUN Not Ready and is in the Process of Becoming + * Ready + */ + .sense = NOT_READY, + .asc = 0x04, + .ascq = 0x01, + .allowed = RDAC_RETRY_COUNT, + .result = SAM_STAT_CHECK_CONDITION, + }, + {}, + }; spin_lock(&ctlr->ms_lock); list_splice_init(&ctlr->ms_head, &list); @@ -546,33 +562,28 @@ static void send_mode_select(struct work_struct *work) ctlr->ms_sdev = NULL; spin_unlock(&ctlr->ms_lock); - retry: memset(cdb, 0, sizeof(cdb)); data_size = rdac_failover_get(ctlr, &list, cdb); RDAC_LOG(RDAC_LOG_FAILOVER, sdev, "array %s, ctlr %d, " - "%s MODE_SELECT command", - (char *) h->ctlr->array_name, h->ctlr->index, - (retry_cnt == RDAC_RETRY_COUNT) ? "queueing" : "retrying"); + "MODE_SELECT command", + (char *) h->ctlr->array_name, h->ctlr->index); result = scsi_exec_req(((struct scsi_exec_args) { - .sdev = sdev, - .cmd = cdb, - .data_dir = DMA_TO_DEVICE, - .buf = &h->ctlr->mode_select, - .buf_len = data_size, - .sshdr = &sshdr, - .timeout = RDAC_TIMEOUT * HZ, - .retries = RDAC_RETRIES, - .op_flags = req_flags })); - if (result) { + .sdev = sdev, + .cmd = cdb, + .data_dir = DMA_TO_DEVICE, + .buf = &h->ctlr->mode_select, + .buf_len = data_size, + .sshdr = &sshdr, + .timeout = RDAC_TIMEOUT * HZ, + .retries = RDAC_RETRIES, + .op_flags = req_flags, + .failures = failures })); + if (result) err = mode_select_handle_sense(sdev, &sshdr); - if (err == SCSI_DH_RETRY && retry_cnt--) - goto retry; - if (err == SCSI_DH_IMM_RETRY) - goto retry; - } + if (err == SCSI_DH_OK) { h->state = RDAC_STATE_ACTIVE; RDAC_LOG(RDAC_LOG_FAILOVER, sdev, "array %s, ctlr %d, " From patchwork Thu Sep 29 02:53:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612186 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48649C32771 for ; Thu, 29 Sep 2022 03:08:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234411AbiI2DIQ (ORCPT ); Wed, 28 Sep 2022 23:08:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234850AbiI2DIE (ORCPT ); Wed, 28 Sep 2022 23:08:04 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4F6D1257B6 for ; Wed, 28 Sep 2022 20:08:01 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNiSHQ020728; Thu, 29 Sep 2022 03:05:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=i9ohR6VgXWqz2KMob+NzCYs0/N7uYohoU273/j3z6t8=; b=mAFM/j6wKuUe4BzFVX1CKlLCXIWKszWWLJ5kUg9iUfBfkmNGwgLn9ryfmqb3RpBqJ/fQ zmxqhVaSBZHV1RXDCvqjqdO/BfdcZJZImTJz+77TdZTFRy/MXKogWL/jG2v6IDB8+0r0 e+tWYWCaevRnFdPhJYJfxcsgLTKX/y1E/+s0rxdbWI9LzQghqvceXLoUMKrDiqM7HCr3 Drt22rHQh1TwaGC3Vxx6YZufsiSHOMMHWqOtDOlCEPNoWUOxwb6rcqEOqzy2SeXJYRDh zh//jiOZq/xM2e+TsRkCjw5yE6HwTxRDtkHtR3/rSsqxvD39MZfPTBaNmT7jNsm7ivyc og== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jst13kgpc-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 03:05:47 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28SM7Zpl033772; Thu, 29 Sep 2022 02:54:52 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2106.outbound.protection.outlook.com [104.47.58.106]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtpv22qw5-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZfLwkMHSHacPQsSIXmXfUoEQWg3Ht4RRjGLJoz7SdhoCBbzeyRzDcIjKEF1RRfS3qtrlwY23zz75ymFgFDtBP6bqPrGijFXy+jcprkoaMtBkqzmdiV+5WKXlc15KuajpFlTKYh7w3i+3QfuPiIAuNBvlKgXvb/vSVQ9wG7bdDiIFRiNgPX16AQMTGsSHTGA7eNSIo/7Eqp28QXObotcMcapv6fScsN0pAZtU9NFMW/b4qNCLxkO0k7MYEEznalYoAWgxMgUjb1keUExMYpEUQYUgTKvbSRFrh3Mx2w0QFJYISBxpwiTPoC64knzHAfOLlBTSh9If/eQhc6rRMjSwVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=i9ohR6VgXWqz2KMob+NzCYs0/N7uYohoU273/j3z6t8=; b=c3MSMM1yY9NF/7kcMpbPDBYOJs0IO/+syo8wgI8yUSV8d3ysgJ7IytGTijabK2c5AnyR/DeloUQwdB7z9CYliMgrgy6VPb+rSaoCDW9XdGJ2qODewKezv6i2mMEYVjrQn9mxdXgPkI404mdCaI0xW3AfQG6ZKFqKzzahXdgCZNcyUOxqiVIPNORJoFUQLX+kAT11i0jGxSUB0DuK366uNPootUfH/dAhI2fxAB6xh1ldM1jUmeMMaLn06FfMCc2njEvG3muCLl2CxFLBkjz1hRUc5x/44GSYxpiiPVrYNaeK/JJiIwcF/rgDeyRENg3qV/lxy4a2C2+cWyQ/qgVUMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=i9ohR6VgXWqz2KMob+NzCYs0/N7uYohoU273/j3z6t8=; b=TOqSL70UCxnabLQ5mMnfMX336rLjoOLBcB1ZRMxpzKDMQhNIQT0VD3EGly5QLYRNwcIguydioCozANMmCOGUgDWW3PDNi3qSjGEIqRxR03Vk6wmmwmAAOiS0SuwOUiN5uvyJ4mjG9Kr4BYlybUw53Dz59afAhc7gRf1f1uwoUTQ= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB5872.namprd10.prod.outlook.com (2603:10b6:510:146::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Thu, 29 Sep 2022 02:54:51 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:51 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 26/35] scsi: spi: Have scsi-ml retry spi_execute errors Date: Wed, 28 Sep 2022 21:53:58 -0500 Message-Id: <20220929025407.119804-27-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR11CA0006.namprd11.prod.outlook.com (2603:10b6:610:54::16) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH0PR10MB5872:EE_ X-MS-Office365-Filtering-Correlation-Id: 1f389efb-7281-48dc-0822-08daa1c5faa7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GYnOLA7qRt7CY1IjekJmoOxfUA98MfOIAhnT22Sfomeg7IAVMPME926PCHFbKkeTZSZyS14w3eJ1Z8HK+0z3dt7/R8mpDLJiOpLetn8toQrEGU911h/jbMHeLa0rP5jehXGnq0vLWEYBNONtD/TTEwCa/NcxarAQ9KmHJBSx0DxbQc94ss+kvakw6aNgb9JW24POVIJD/xySfuLvhWbbmksFTF5eGZm/rJdb/2fBtE7mPqgEBdeoN5EFHvODOCaQA7QtE/YtvQlKNFjhST2uSMdD77n0M5f08Jf/XTRB1uGYGfzaZhAJffkDaLN58EwGjv87hWAHDsFD84YTIGnKkzr2izj6BnUWmaaSRY6gODGralJOVMCkjq2pH8mnqc4UhxcxRUfQKhdXdt+2W+ZAjb/Os5gYREOlz+PwcjrceFw2cpLuN2HOEWX4nTPCI68l90EHPu7DnXe3zEEVgHtCMAwxD1Rl/ThkN1Qr2c+AHTTBVJz/+HHxS3xUwmHww/5mBbzn4tNv0UPmPX3qeeUtVAG/Tk6vBRo+BmNWkWkr6a628y9eF9u1jdgGwXlyrpqdcv//wt8WAdQZnDSR8hWNtofxZ23Y/QTm63VXgBpSenIi9L0av+oAYDKEoiye20iHEPfpVzlUtZNs60bJSCRrIUw9gqcPTEk5ezmAeJcMFXUV8Fx2DhYIGJqh8woRdMLtZoCCDG44n3y2jGl+nchHJQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(39860400002)(366004)(396003)(376002)(346002)(451199015)(2906002)(41300700001)(83380400001)(66946007)(6506007)(107886003)(6512007)(478600001)(8936002)(36756003)(6486002)(38100700002)(26005)(186003)(1076003)(86362001)(4326008)(2616005)(66476007)(316002)(8676002)(5660300002)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BLY1og3zgq8LZOSyX99t1JRs3I+ltgQXC/NFwSok1vTR6kw61wviMA2dpgdSxVtyjSJ+3DlDkgPrsrRSm7g0eICUkg+6W6jy+gq8GpAVGbj1bGK04pBmqQ8gyOIF+sCtYlasSKaZ0Ih40ZVLGVTxO5FKPqSV35S9QW3inpMFxFzkapXLTt1AnS50xWv5eajwERiCfFOU8AUIa1VVSZx9yU001a8Y9nsOhgVndWng6wojfPrpe7QOA3VnrJ4PDJxkzrDlPvZyWw5oB6lTkKj/rz6zCK4WELWuikEpVvyn2wUgCSmoQSLTNVZafwxxFtVuV4KhtE0LhWGUfBOmqpl+j9RP2MftKhnulq/QMX4b9Ent6TiZPCz7u0JaaEFzeHGAP4HNTZS0RA3YhlnNfHM+HSbPgKlveoyY6WoGrmgBKYzaBqyrl6IBWfFKqzoNxxysk9ommXx41LMahQtx6XeBf84MuwjQ7273NrUmppNLMJPV+yPJ6tdMquDPLcgaIZtwWeyJec4D/NMLFS8GqvL9YPReIyaZFyWbxp/KLUgBA8DmhYFRJ/p6F++w0DLXDFaWwpIHbq+cF/EX1koQnTtjDGc9VUHNPUZvGvcjx1F09RzaseNVp/uBDlXtETyMhuq+m+0LUMddMlxSskIJI7/GeMXWKbZ9BlSOmpWL/iTnmOTNp0e1AnVbCTQZwPeI7bwof5w/bNXERZr7zWGFlkGUTvQK/m771zAzgcVK79cgIm0g2yUEssT6K8Wv2/BhcVUgQqfwIrEhFKH1AE0TP9xMPVjMY1dxejs8hoTDeWig6oQTZwx29xPBBLsgoCbqu+xnqOYXWOq1yKvVZgZu/RipvXypCuJ/vVpHK8mZEFwuT6xp7ElSY3djfsqAgzOpOJlQbQXJaIAz52JNC+y28OyEIjquYrFdhnd+u1QErD99ojXxfQM2sgSPXNseDCNabkFuddenGcI+2coJL1vn0fE+/NjO/mnihP+h51XuPBafBj1EKF+IZpP4GDUi/zWARu5M1wNZWoZ+vZ+s4IPE/cJlkYoUWC1ROamHzcerIHXCtdT+7evxI4FTDcvPL1TK4vQSA0qp+GNSO0K8l3PnhSPZbILiLQAM3pPsiUY50RXppcwPA72FxjY3cQhS4zD3J68higOCY10QEiPJksAzY8Jas0X8hSVwTmNBI5G2TiU5gJD1jvS9Ck3jKljxno06Cms319DxBne7WYHhFSj9yuFE8Psvi863cqk4p/W1cqgU6JSGTX2Q2qPYG5frGMZ2ZYP2lMmImCganFpYNaEOIv6FRapOM1bD4v1b+dV0kG1NjBEQ/4KvR6uNS2w/WxNsduV6M+HzJ9bWTxowqjvGRozgfwACrcWslmC2YAt4gPy9yYQ9/t99fzByqG9I2SMbnSd25CDpo5jx72YLML7WEKz0f6gNRq18ZmgV1AE1D0FVfQ81TFpTRxAT/DejypqFVqyJpvdg91V5o3ZH5LERPuY3zY0aICv+kFvltxYNCEGB9Z+91dnVsZEw4ILGkWeG5yrDjYD+tzYsQPhLyQvsBRysv749iOXxw5cQX4w3dB/qoCbd9q9iloq9sWUsoPXYuNcTg3jvFjmkcTd9OjkGWA8/pA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f389efb-7281-48dc-0822-08daa1c5faa7 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:51.3319 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Mg9wqS2qR61R/YAwH/e5m/cw0kcotHPExbj6o9fDCm8mq/Oif13nb9fFVFqAKhLS24gqsGUeEyjxEfpytyTQoWWABPGDKQ/3/4IUJibUD50= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5872 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: Mo_YRMBSU3WUQRJhttvi_9Nk00UwyxDi X-Proofpoint-GUID: Mo_YRMBSU3WUQRJhttvi_9Nk00UwyxDi Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This has spi_execute have scsi-ml retry errors instead of driving them. Signed-off-by: Mike Christie --- drivers/scsi/scsi_transport_spi.c | 56 +++++++++++++++++-------------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index 55d9b13b2f8e..ec5b0f562cf2 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c @@ -109,38 +109,42 @@ static int spi_execute(struct scsi_device *sdev, const void *cmd, void *buffer, unsigned bufflen, struct scsi_sense_hdr *sshdr) { - int i, result; unsigned char sense[SCSI_SENSE_BUFFERSIZE]; struct scsi_sense_hdr sshdr_tmp; + struct scsi_failure failures[] = { + { + .sense = UNIT_ATTENTION, + .asc = SCMD_FAILURE_ASC_ANY, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = DV_RETRIES, + .result = SAM_STAT_CHECK_CONDITION, + }, + {}, + }; if (!sshdr) sshdr = &sshdr_tmp; - for(i = 0; i < DV_RETRIES; i++) { - /* - * The purpose of the RQF_PM flag below is to bypass the - * SDEV_QUIESCE state. - */ - result = scsi_exec_req(((struct scsi_exec_args) { - .sdev = sdev, - .cmd = cmd, - .data_dir = dir, - .buf = buffer, - .buf_len = bufflen, - .sense = sense, - .sense_len = sizeof(sense), - .sshdr = sshdr, - .timeout = DV_TIMEOUT, - .retries = 1, - .op_flags = REQ_FAILFAST_DEV | - REQ_FAILFAST_TRANSPORT | - REQ_FAILFAST_DRIVER, - .req_flags = RQF_PM })); - if (result < 0 || !scsi_sense_valid(sshdr) || - sshdr->sense_key != UNIT_ATTENTION) - break; - } - return result; + /* + * The purpose of the RQF_PM flag below is to bypass the + * SDEV_QUIESCE state. + */ + return scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = dir, + .buf = buffer, + .buf_len = bufflen, + .sense = sense, + .sense_len = sizeof(sense), + .sshdr = sshdr, + .timeout = DV_TIMEOUT, + .retries = 1, + .op_flags = REQ_FAILFAST_DEV | + REQ_FAILFAST_TRANSPORT | + REQ_FAILFAST_DRIVER, + .req_flags = RQF_PM, + .failures = failures })); } static struct { From patchwork Thu Sep 29 02:53:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612196 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5342EC32771 for ; Thu, 29 Sep 2022 02:55:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234839AbiI2Czn (ORCPT ); Wed, 28 Sep 2022 22:55:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234819AbiI2CzM (ORCPT ); Wed, 28 Sep 2022 22:55:12 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F20F74DF01 for ; Wed, 28 Sep 2022 19:55:09 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNiSq2020738; Thu, 29 Sep 2022 02:54:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=cUtDsNMaSNLvfZ7McXC+iMhKitg4ItEn6sfOiTcSQA0=; b=FScY3fvTWjRhk3lrGOdeRrY4zSs667BNLfC0L7c73fGqJLnDyafOqIdey62o3AnYHttK x+gkzsR1gt0UmPWrGulek1Y1VyoKOIZTHfnY9x6Zk3yZC5aEFLOJ0t34LhsTRXJYAwlQ bZiNU8VKXf6/vvfa4fuEo4Lr40JDzTjTCXTZu0j7BQkYp3r9NAUK9qCHg9Pt1hpdDqNK GxXkJgDL4/6T29bmWlCn9xg2VZDp59EGRaXgWH+04YYfSuZvtvajv8Zvbs/54LMBOoRz +lD689S3HoNzyYBQ/HZUKTB7QSxO7QwQf5Ho7X7a1t6AW1D2EFGIniXaPN0z6GXatXC9 LA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jst13kgb9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:55 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28SN2DnV039536; Thu, 29 Sep 2022 02:54:54 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2103.outbound.protection.outlook.com [104.47.58.103]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtprvtcwj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nRKfU/wXzD22Mtn8vhpRb20mFs2d4CcryqXf/tj5nxKCSy/MjtkacjAiKqA/DIGuIa/IE6ecnU7/YsG6FwhJfnL9snMUbswjWFqc/Ixk1KLn5RBVurMj7a5xhJSp0kaKE++sMOBylFkjxPrWjP4CclrdvRkvsqOzWBG9XX5hYdQD3uvpKksfYOesYzFt86WCaSn+ihEft55CJI6ezMGi2A1TcoJaP8wEDbvZjmgmomfaNhoG5ZbuvTBP1C4mYmdUo9g2PNjml1UgrO3uW5O3IfZMVkBxVns1LRFbhNk2NJsrJnCWYFTl0+ponWYdVgp7b7ysMw0WPRSUTpjhW+xLgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cUtDsNMaSNLvfZ7McXC+iMhKitg4ItEn6sfOiTcSQA0=; b=ekUzXFYmHW6bB11tSi3Rg7qY4pzKtBDQ2tOs7TP2Y3fWMEH1STWyLsdfC8vFOrOKfJlIyns2sTFpK0vw/wQ4XC+CSdnD/l0rYuyQk5SiW1NlHPVEo5efPk6wLUdP/HiPVxG48rVJhfqpYVVS6GBGO8lwG4plQ59NKlI4CppuO16xGHSGRB7hTnR/JobvX3KIjAtO+/XqqIni1bLWzQNi3wPh2FC+cgf2lDbLmY+f+r3slAVd7AJGiPi+eaBQ0qPs0Q1Kf8zrzS3To0kS0M2G076ahIyR0cIM9qr6uM9XYV1h3hQw5DdI/4223BZDYn2DC9QXoZLVsii284MMIqAnfA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cUtDsNMaSNLvfZ7McXC+iMhKitg4ItEn6sfOiTcSQA0=; b=a2erT56J6OcaAOCJj2ZWGVcf8dV5nhD3DLAFTptRZDfybfbKS1yM+Q8XrCWmbeqwVr5q7mHqWdqbVhLQiYPhhaOgaQz+67TVojY32caNpu8bZydnedgmg3XuF1+ma/N4EjttmAWWh6sLm24V1hXaF+EiFt7QiBpY4h2wF7If54M= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB5872.namprd10.prod.outlook.com (2603:10b6:510:146::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Thu, 29 Sep 2022 02:54:53 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:52 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 27/35] scsi: sd: Have scsi-ml retry sd_sync_cache errors Date: Wed, 28 Sep 2022 21:53:59 -0500 Message-Id: <20220929025407.119804-28-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR11CA0006.namprd11.prod.outlook.com (2603:10b6:610:54::16) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH0PR10MB5872:EE_ X-MS-Office365-Filtering-Correlation-Id: ea8dd0e8-e6a1-48df-f915-08daa1c5fb7f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a4s+EljFVKdNjwu4Zbra0k/sdfAjWgbzyyLD97O+pCbu7iJiTr0k71oPnaNyEL0eRV4drdzVBDXOb0ToaqOsKtdjdEaSI9uADKMjIDBFlZAnznBiWT3ATB5TIN16fPoIWVvImfK8T1FwXFaEzLPAco+9DtpSMImgM4d6faFPYrLqJnIZSwbNHnnu3n4Qqizb1u2F4v/PdURpfTH5vKkcGL/vei6Rg/U66K7LsXHNQuWYr/Xt6m1GvFqh5W/rFiM9aCkAacc7RUuw9RizMtMYrqUxB2zdvvh2IpVwT5TrdyLM4VJXABFgKvA67PK2ko/aNgD+9g3hNd8DPeHLPFQMCoTr68HJQ4T1CTJfQZ7S+IqqymnFLpDTwPkJTHblS6cVwoOlVsnjLeyYZYHTjck0gbU/5i2kIfb0375xDC9mTCmKu1uZoSwDRtRCfJ3bnGhzgGceonSUJAMWvaBaCJz/l0h+ej/uJpWEYFqzdosi33xiTQ1368r0lMiY/XUQ4zf5cHU/QX1ippdWK19FnqTO56ocSJUNNgqZEYQ7OyfRabo6wcYDWV/fQTB15BI8uCXV30jPoMJXp/iTAdlc0LLkHXpOnt/aOupbLmwlpc5U80EsOlxrx+LwiqRY12HWuI++P8JVvshy+pYVj2/deGWwUDAFhbwMthCl4S/AyQe2U9jtxqe59UJXfB5tzWZ4PksBPbWW/6X7NYlctOhMvXphkA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(39860400002)(366004)(396003)(376002)(346002)(451199015)(2906002)(41300700001)(83380400001)(66946007)(6506007)(107886003)(6512007)(478600001)(8936002)(36756003)(6486002)(38100700002)(26005)(186003)(1076003)(86362001)(4326008)(2616005)(66476007)(316002)(8676002)(5660300002)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Gnx7hxxu0t855qrrs33luDil3RMYa40MCSSsm5ne/s60a3Oy/flFiy02880M7m0LXhgbjwJjRW9GJi/TXJpwPkE1MZMbcV4Lg5T7onx8RQDA1Aoq8ghPYY05v6sw0Tiay1F7ZdLExzY1FyxwVPVw5YrHuefj5UQYUKd4HGOVa5W6h0fhpRhj+xR3DAsniRQdsXoSeXuD9wZ1MB4zJlSwPpmvTrq/E5SoJjilVEbHmypiLOcJlOfXDMwsTML0zTTRBPJwYWi7DE73nKM9BDLWU31986IFdjnpUJQjplSS70iYhk5v877dARuUVGZCDfGBN4vs43fx/9Lue3lSBBlPMlc3STQhjEw/d0YdMeaBf1NAfqVaca+hkm2qmtkjdUA6L0yya7KgF2aEG4YPRHG8sUadpLJA1KaVYWu6/pNrDVzQbW7WWeypDiSW9BuMB2OAspoMlXRyQeRNwqe8YI6038QrO9iievXYJuw35kedPDxXHkkW8a1uakRe/Gt9b9DWMMqnSvMCCE9L8wYEIulHbSyYymhWBYIpdD4OwH6lHY/ndVn5xcCSHXwsrqq/Uu2UZsfFQpqWi/WLGlHSXyklZxWhyLvvXE0EjJXzepoziblFp7b1nGPDxxazjCajWO/EKAOzT6TnRuo5XwHhdZWjZ/dpFRDdx/ylPJgYZDybzXLn/SwhkGB6JeUoWM5ivUKzYTjMQzOLFyHUARBX16U+k2okJ+e3gGiFUGQBhT69P45rZvNNiybQc2Q89thKxPD8ryo8yCr4PZoVg691VKhIgXN4/t5ZTQywY791cnja7aoSVRCtojxM7IuZcY5ALHbGBn9WEvS08UWXiEmZM7TL4R1x14ZOb1/scjyAtQXu7YDie7BPXurGcNBTPBOOc5a6leA8dflQaE3iFNqJtMq1zyy2f/bOuMr6uGYqkUFpsMM4lTmCDLmDnaDppcKUfFvoz2p/YuMrTJ2OHyID1uvpyWxv3ZfY+1uEsmCqjgkEYotRw07Y4fiZJ+ROsCjUYOu/6U87nsIUyaBg7AdWfGtlt03alUqTblSslK8l4oPBBcvnlagbtBkzcRjcXbTaipafoXdGsYyOoAJfbyar+4hjoftfZhvnzmPRgYaKc+r2wHVKT7hD5G82wezq/ky5DItzulSvDe5z7NlxxcTNx47PVmhWJvG6PzozGFdSabOkwAw7C7nzX+6xO+n69c5oLVpg6QaU2CXU4L/PQgEueduxtY4T9LiodgM4i/lzmo+c6dVdPLv3Jsvr2+OQ9JKIKdr/uXpTO3Al+f2A5bDtj7XYp5CUd46B0isRuOFxO4C3AZo28lpDFZwtUvhxgwQIayHfk5za2iuXF8iFMffRWLaz2hgo6/eFNitK637YwX0sQ95k8FmL9qv+VsMzcEw8o1JJm/u3T3ew9qIKZp8xuAQGkunwcVfx+UGvce3NbVO4AtUXNkEDBTOdT+QdyBKbqWFb9wVv0YfgbnmN2bYrPlki3Z7sQzZJBhItJ+6Sinr52MDTpB3BK5IQb4DQTYRtZqgXHjRxMu+hNWH2TFRCUikMlBVlylM4lsLtB5q1DsuojfNY1z7POvitHwvwYM6fD/4Q67yeG+k4FlqHsS+C0IKXgA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea8dd0e8-e6a1-48df-f915-08daa1c5fb7f X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:52.7537 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mLUzH6modX/TTkSPJNA9HicpbtSEnqzH2RFXU8AY5NglwNElaCXtT1zqIZappSj4jnx+UBF1QmbRUyNkmC0wJY36VFrNysMVfEOqscNki18= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5872 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: yOre60d_rZH_9LL6P3WvugSLYilR7EPK X-Proofpoint-GUID: yOre60d_rZH_9LL6P3WvugSLYilR7EPK Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This has sd_sync_cache have scsi-ml retry errors instead of driving them itself. Signed-off-by: Mike Christie --- drivers/scsi/sd.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 716e0c8ffa57..cacfdde545f3 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -1580,11 +1580,19 @@ static unsigned int sd_check_events(struct gendisk *disk, unsigned int clearing) static int sd_sync_cache(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr) { - int retries, res; struct scsi_device *sdp = sdkp->device; const int timeout = sdp->request_queue->rq_timeout * SD_FLUSH_TIMEOUT_MULTIPLIER; struct scsi_sense_hdr my_sshdr; + struct scsi_failure failures[] = { + { + .allowed = 3, + .result = SCMD_FAILURE_ANY, + }, + {}, + }; + unsigned char cmd[10] = { SYNCHRONIZE_CACHE }; + int res; if (!scsi_device_online(sdp)) return -ENODEV; @@ -1593,26 +1601,18 @@ static int sd_sync_cache(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr) if (!sshdr) sshdr = &my_sshdr; - for (retries = 3; retries > 0; --retries) { - unsigned char cmd[10] = { 0 }; - - cmd[0] = SYNCHRONIZE_CACHE; - /* - * Leave the rest of the command zero to indicate - * flush everything. - */ - res = scsi_exec_req(((struct scsi_exec_args) { - .sdev = sdp, - .cmd = cmd, - .data_dir = DMA_NONE, - .sshdr = sshdr, - .timeout = timeout, - .retries = sdkp->max_retries, - .req_flags = RQF_PM })); - if (res == 0) - break; - } - + /* + * Leave the rest of the command zero to indicate flush everything. + */ + res = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdp, + .cmd = cmd, + .data_dir = DMA_NONE, + .sshdr = sshdr, + .timeout = timeout, + .retries = sdkp->max_retries, + .req_flags = RQF_PM, + .failures = failures })); if (res) { sd_print_result(sdkp, "Synchronize Cache(10) failed", res); From patchwork Thu Sep 29 02:54:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612190 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0A9DC04A95 for ; Thu, 29 Sep 2022 02:57:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233713AbiI2C5a (ORCPT ); Wed, 28 Sep 2022 22:57:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234844AbiI2C5M (ORCPT ); Wed, 28 Sep 2022 22:57:12 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C138311F112 for ; Wed, 28 Sep 2022 19:57:11 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28T1TRoF011074; Thu, 29 Sep 2022 02:54:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=A/xvSpK4Im7k0WYeCwfj3rNU2d9AWE8FTbCSFu4vjLs=; b=NKw7EGPlJiAhxt1K4pJpIKKXPrKy3D8quKDhXBm/ZTHFhUQZO9oKW8zsshJmVrbYnd5u x3HUiu7JYt7pTas+B1kKGyyUilJMLEekEw/8WuTpjYv44mgZTAtlkllJK/LD7VrVgw3P sTQn4EcuEYU87Q+C8tgnP4TVbHPJEdBompa3ELieorlvUS4tAzSGgEef83nytRRXisWa TsDFLXy39NvUrBDysTltXtYUSQaSRc2eWirb536R+ZHfHs4jMtyTJe0MBhFQze8pTh5q e2fiH7as4qQTmdqlFnK8uzXrk1JFZvcifdouNvalfOkpanA9h1fn6kA8wA2pjOvjoYyE ZQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jst0ku9mr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:58 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28T2SjAG040236; Thu, 29 Sep 2022 02:54:56 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2109.outbound.protection.outlook.com [104.47.58.109]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jtpubbphh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UdQdF9PGe7Vo4q+j6MYLQdHUwPcYesLYje4GfJOrIsY4mT4xXkRZUwnBcDWgXYk6/qQTSC7u83ApirPM2p3+INVMc4fG7l66jxTiQYgBfMZoc68WoMXA+pBw0078YP0iqP0d51LWcXS3asoR6aAArlkfW5eTUOWy1BxnUzQ5qC8iEYUuzk3ybCnZ/luSU2QZpMakh/NImq7kKERslM2Q4OB2EbYP7LcC/folgGyKjgGLo+WdrWHPiP8HJMu1L6wYFXK5xvzhsgSY/VGXcEbxE39krV7ssE7Gm2eVAOHrz4GaYNEgFR2SSSHDTGhI90FhX7cK4sSELC4cbSx5NMRQXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=A/xvSpK4Im7k0WYeCwfj3rNU2d9AWE8FTbCSFu4vjLs=; b=Lma/aHtCUuwdRL6AflcWoV+slDA5jZCiQDgniVI/Fti7+xVFr0u9YQIS9BNgMuFsjoLCZSJpUSgEUvT4cMM+WsmrVxLXnEjAEm0VF0NuVXBq3Fy2rK5hJp4k8605znxHvRwTsiyshK/CXjtWdw2uOGT9kIAC3xH06o08fhl1gFsBIRdyEtvvRNYh7gf88zKrqehVK1FedXB85HBwc8zTBZwWIFj/J0VLltTyWMMPYwCG8HVXw9M9zpS6pqflfkX+0dnrZcBVqgibhvyuRmlFkma/R6SlN2bCxkQuoZ1F5lWObF0K61AH6nzsrtsijurvXAmHqA75R6GS6OzTgDJhTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A/xvSpK4Im7k0WYeCwfj3rNU2d9AWE8FTbCSFu4vjLs=; b=cnO2yFfYt1WTvogIjgPgHsAUgRWLTfP652eOwa2UVQUTzsRgCvu/p8Ccpsjgs+RfVwk2v4eYNQseU7mLEKl8bxK+CtG+hY+COn0S9252mkVvbELH3v9o4xGMSi6NS7Yyl3b4w+E9MHSJ3iYshmE4JfHeCNpBZJMd5EtjbKWmq9Q= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB5872.namprd10.prod.outlook.com (2603:10b6:510:146::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Thu, 29 Sep 2022 02:54:54 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:54 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 28/35] scsi: ch: Have scsi-ml retry ch_do_scsi errors Date: Wed, 28 Sep 2022 21:54:00 -0500 Message-Id: <20220929025407.119804-29-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR04CA0062.namprd04.prod.outlook.com (2603:10b6:610:74::7) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH0PR10MB5872:EE_ X-MS-Office365-Filtering-Correlation-Id: f2a079d3-d983-425c-bed6-08daa1c5fc8f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DyYHet8b9AuHyKetDAQ4EykfRdKab35AIoLJyUUJ64Puxb9R15mcp0ys5gDEmkntMDp5j1QHLl1EPhwT+SGfeFFNFhuHTtWgAiCiLHnAglvjJKgaRi/iOxvLQ9Hs3GuZ+rho3vlj/LTe8GS31XADKksTeVqf5hZUl5P6hHQdEpkiYDcRYmttj8sJ8ZoqG88+8f+OqBOopFWNlFZ1LV9UQAZTa7xyWEbBq8Segfw4aigCT9PJGGlAhSJTq8DVMpbeBoVz5fDLcSXr1HipJSENYHocI+RmsoalcPD5OqxUX+xGBNHrBsBil2KhiaXgWz7e38fN61gVwG/ky//QldAr+VY/qXJPYqHORe9G/iDRbfOdBXCcevaEFAi7+KanxT1srD70aFGs0EX3NZCmpT8E9fAZYLc+U6FE21X6raeXuvHojcR0LNp1asCZD5xV8Bpxz2DMy4FfxOmjmfZKBbBdhzJWUDM4e3au99okK4KftyQezZjNKGWQFguwjmztTacZW/1EhuRPcqch3gl1hzMDA6t2LESsrt/eg//X0cPvHiZvn87GcNWuNmwDo0JfPEiuz8ONwl0PjRz5UXRpHZYGesEfgipXQyuyAQZAvmfZ5b+YWlq+Vk+8l6Dlc5uOU5CvqSPbJn3a8zNZFQxLrfeqfjCt/PaM1Z7JRjf8o7b8dVpQIlMQTSvDB1UlJcoQmGHVPez0nIyFahUNRyBGOyvoog== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(39860400002)(366004)(396003)(376002)(346002)(451199015)(2906002)(6666004)(41300700001)(83380400001)(66946007)(6506007)(107886003)(6512007)(478600001)(8936002)(36756003)(6486002)(38100700002)(26005)(186003)(1076003)(86362001)(4326008)(2616005)(66476007)(316002)(8676002)(5660300002)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rFMOnMTawCuONWW3AAue2s18pZ0KO7PIkPuquCe+E4W5NsG8W/ZCy+KeUuWzNZ6KO9xhSSeY0063Iy08Wxyn5JgrHV7MzEoZ+epD2pmtudP7iYIdMT/eViiR/5T4GRLlYLZURm3DoZ8J5Ip6h1szjyfC+1IpJFQgJFuIMnWll/Xt05StGwq+Mn1mYLICtPWVl3IEAl2p3lH+4/bSZXCWNQq8hkhFPFRvcniG3LhfTXS+T+JoF6M6Nf67dC+QDl6/CajduE5odj/g8YSqQM8ojJKbRzpzN7FbTJuljXljHaN7a/qeXxzBdZFCNMDDIlXXpCik3y2b2/1YO5Rfy3TuwxmmJzADxuM1BmADIDt6GeQcfyz47gsJDE8lTANyf4DD6wxIEHhh61yTi4JUBoZZ/l6HHBdgUaIMlyMdbQoEAi66JTTw6x4U/jaU8kIEZIEC5bAgSNV07uaawa7JCupAs6Vt+ltsuiDImpQ0Qgyv07lVwPoiSgioTLr9VxF08ZSMS1RzDEcCoillFUmzohNd10iNPWjYnkiGd01keTP1M9Gbu/bzNzGV4O2Qx1vOQ/0FQfFu5AoFgYy7opmzD79tsWJcULorq/gK9m6MI87UQHbckf2za3bKPj/l/ml0aiWy+ZvXAS2ukkZnRKtCZkvK2NJCBTFfRa/qWRT4VOfOLIafczBCF5a4hbG6g5IVq4X0G2hxc8yh6xvhJO/Ke5BHKFouq5WesPPoBhExjmwd0m1CJmNuJHeNrDXZdRLlXOjh17me/VTDOWESvuankX4gW0oB6bPoDyusAbvHWjtDRP9DGEapbaeFRl7sF/fmX3oBZFzzwIdBan/T97g5acb2LMcE8aQ/gFB7sPc3ahC1886WJv+0R1KEEYNQhII4YRbjn6P0d1Pax1gdZawDSOg6rkFV6TP7+VUy+B3q3SoFXjwup2fhM+IfjzNseP8OJ/LwErPqhWc5UxMdKxptBB5uJMp/87ghHVReHccbjDepY5mH1ucwexGqzlAC+pJBcRqnQm/R4mvBjNxGvdXy1qAak46A7LTErSOPhvG60nRcYbdnyA7eIK69A+6TAIJMX28DKwtptMjtFa53nsBHWAAYu2wgMWhPxmZOy6DNHXGremlcoJNL2VQPo9wyvVoV03jYcwrw/2bvYwJ3crw7Fb1q5CTylNCYCHcTqNiWH2BSAnV+87ReGo8hWOmi/5kh8rHD1LZg3iXnHcnFwuUUdct30sleJ70d9TseO7V5FAa7DmpuJRkKK5xjzX5fVb1GAXSW6C+8MmVKIGNaejBtr98HScDwpxiRxXB7alOpPTFJXL7QtbyMwg1nsEq+Mcd6KKulW61lGtL249eZPfjqBk5eQHgDjWb/010JCKYNmydgxx2hltGr+2WMRfmxZe2gSsvPN4ew9vA3pkdPUwZxWrpSD7SleiinZ/TTOgI7xYsfwW83G+kqfLQOS8tGVpBf72GrWpcdJVLkCVHUn0+e7+6DiD6lrnef39+3meRqeZtLUH0QmPQ/ovLmzYMTYSISKEN+Q3uzkQUAT4k6UwTIazOuanjebFHRQRRKC2rt/QMJutLTKkG3DuzrjPIm5HdjEMZU66SMokr0lb4/GIs+YXa9Tw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2a079d3-d983-425c-bed6-08daa1c5fc8f X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:54.5348 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JOxa7TtSsAkYuBAl9k3wQaZaVbyB/hC7+AR595TfhUHW8eUdGOIZHOdE4gu0h+vVOP1rg3mtABRgR07ZnUt2wrVsYMoJ9Y+o91FWt26G2oQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5872 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 mlxlogscore=999 phishscore=0 mlxscore=0 suspectscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-GUID: xP4PmUtzahh0KB3sN6Z1nkNJ1ohS9bWV X-Proofpoint-ORIG-GUID: xP4PmUtzahh0KB3sN6Z1nkNJ1ohS9bWV Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This has ch_do_scsi have scsi-ml retry errors instead of driving them itself. Signed-off-by: Mike Christie --- drivers/scsi/ch.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index 511df7a64a74..015cdc0ab575 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c @@ -113,7 +113,6 @@ typedef struct { struct scsi_device **dt; /* ptrs to data transfer elements */ u_int firsts[CH_TYPES]; u_int counts[CH_TYPES]; - u_int unit_attention; u_int voltags; struct mutex lock; } scsi_changer; @@ -187,13 +186,22 @@ ch_do_scsi(scsi_changer *ch, unsigned char *cmd, int cmd_len, void *buffer, unsigned buflength, enum dma_data_direction direction) { - int errno, retries = 0, timeout, result; + int errno, timeout, result; struct scsi_sense_hdr sshdr; + struct scsi_failure failures[] = { + { + .sense = UNIT_ATTENTION, + .asc = SCMD_FAILURE_ASC_ANY, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = 3, + .result = SAM_STAT_CHECK_CONDITION, + }, + {}, + }; timeout = (cmd[0] == INITIALIZE_ELEMENT_STATUS) ? timeout_init : timeout_move; - retry: errno = 0; result = scsi_exec_req(((struct scsi_exec_args) { .sdev = ch->device, @@ -203,21 +211,14 @@ ch_do_scsi(scsi_changer *ch, unsigned char *cmd, int cmd_len, .buf_len = buflength, .sshdr = &sshdr, .timeout = timeout * HZ, - .retries = MAX_RETRIES })); + .retries = MAX_RETRIES, + .failures = failures })); if (result < 0) return result; if (scsi_sense_valid(&sshdr)) { if (debug) scsi_print_sense_hdr(ch->device, ch->name, &sshdr); errno = ch_find_errno(&sshdr); - - switch(sshdr.sense_key) { - case UNIT_ATTENTION: - ch->unit_attention = 1; - if (retries++ < 3) - goto retry; - break; - } } return errno; } From patchwork Thu Sep 29 02:54:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 610823 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD95FC04A95 for ; Thu, 29 Sep 2022 02:57:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234797AbiI2C5b (ORCPT ); Wed, 28 Sep 2022 22:57:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234851AbiI2C5O (ORCPT ); Wed, 28 Sep 2022 22:57:14 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41436123DB8 for ; Wed, 28 Sep 2022 19:57:13 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28T1TQTu011065; Thu, 29 Sep 2022 02:55:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=oY80lP+f+rOpJKW7MrFJVux+5vWAlNasEHgSPvA0EaQ=; b=tk/bzibDGDYyjflcOvQ+qUo1u07jo6Xp5rD1z7cGj0100Q1WDt9aTIJLVo+qU+jnPTFp av7WigmcEW0UNoZGzM0ePJd9ng6EPn5tZrCfsR+M6rWgYYWcXfQKdpdIY4xSDk7z4eNc xwd2E1xTLDJXIdbtwkFUYlNreQp94/G/QMs1A7Ry6ATKn5uUN1yM7bvA3pN/sSLmzBrX nuyoI7ODVcSJSw2CdSORNrjssA+Cbrs0moO0NP0GgcNxe/mQEm2LdKh1huEXeuN/mR/O vCahMUw0ymYYFAxuNJqGExIDK/gBRHsLbkx39jYrWeUU2/5nJ5Bxqy9mdy1NLp8H1S8i jQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jst0ku9mt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:59 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28T0kSR8002257; Thu, 29 Sep 2022 02:54:57 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2168.outbound.protection.outlook.com [104.47.58.168]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jtps6v7m2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HAm/WE1hMToLncucNSE4L709mYC8bjuXYTPnZwprXYUHrmX+iyWdX/scP3/RcgHjeh7S6OGz4bBnNy7IggFGSBNUkCroB6eZnV+ARDBf7MZKP1FNa79VFSUfoGULlME3gKcsAu9c9NOC442Mg1IIuUDYmEAbc8rUIJnqskucihjm+SmKC9tZ1WMuuBaBQ+RDTNHMSChqr63HFJgvQXscJFglRqVrrWrp4pko5licUu+FDbnUUOOfMyB9io9LHnh0nEta8ZMoQHiSpLdfZVBIbOGpHaIT/nMKNlNf/UA+ZSS6TpCM9kjeXF5oeAiaTRvXwEe6ns0/B0TJzqiMWuZ70g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oY80lP+f+rOpJKW7MrFJVux+5vWAlNasEHgSPvA0EaQ=; b=k7wAZ4eYQf4byLY/fGWcyRnC9LhP7kFnMi+SmrBzrrTx1a9hUPRgh9hAQtKYOr0bwIdibyN927+02x5sK6SCjufwRqFcfH4XgNuz5AZixDpjomDUC9VmOiimZBhhED0g/fGOQ+R2UDq59Y0LWpa/1xtlDTE8thlIZDX6RDV3R+T1DGoBk/fSx+dwskASn271EiUI8LkcdvWQwYNuIcvT+d8dHp8JioKwOnCYjYuHWON382SZBZXlswY6Q/s8pYHfk30XcxSbqgqkyeCCpNdGEGP2yn2PbFwLF6lw/rU5qTQzf4kKJ2chnHdTd1Ygrwj0nBr+lR4U9VT3draQSQgpFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oY80lP+f+rOpJKW7MrFJVux+5vWAlNasEHgSPvA0EaQ=; b=RFGym/v+ar7CD7S/bpZk8MUrJe1zgXGjXsXlv4tlOAUI5Cn/alXVffX9GRk44Sn5Y9p1TY19OrKgxjUCqHHGrX3tFzaxPMYerFoLNYOJyKFuB7wxMGpxnJbCn/2MMHifmZBIx47T81Fc+dz9vtEBSgXqNhSgaTeri7zsQnIRMJ0= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB5872.namprd10.prod.outlook.com (2603:10b6:510:146::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Thu, 29 Sep 2022 02:54:56 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:56 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 29/35] scsi: Have scsi-ml retry scsi_mode_sense errors Date: Wed, 28 Sep 2022 21:54:01 -0500 Message-Id: <20220929025407.119804-30-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR19CA0015.namprd19.prod.outlook.com (2603:10b6:610:4d::25) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH0PR10MB5872:EE_ X-MS-Office365-Filtering-Correlation-Id: 043689cf-7423-41e6-86b9-08daa1c5fd80 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KnsknwN8R1TohEUZT6ibHlD9CP98/UhpX7OMRjKzVn1/+lFVPDDS/ziR8hfZl2ZXBIA9lDIig6l97idV2Weq4am8kVYyIo8go8zbcSwXwSqBslpU7D++a89/XpDGK+tcMYldkHEhYI2nCLB3u8Ky4JS9YSRsfCQCBMjYwz0Sd9KfYwf5PQpA+kJfl8V0QgY8ZGtDzo0bqgsGSOlO42b1sY1qvzbrMc0oW/4OZFz0VHQo2LbZojh3QEIWlweFi2+G1hiynv0wr1GinZBL7RQe63HAT+Wloo8eoqYSBkEyoTcxPAhZSWnSDRGDO3EvP43WR5o5sw5FVBErn85pltTnsge6hsxJRUo8TFhFWr+fXjm3E2mMvbJK8SPLVR9R9N8K44hRQE6i4htMHDnslGdZPGzRKiemEnwf8MF3ORjXIGsqxSXY/fkYYHFion3QAXlN08Ce3tYxuurVBhbE8nr/+2qlQBRZYU1sk1Db1vBVwyeKXzaqV6WKQRkgmJK3Wq1C/lL/cmH23pp7Q4Kba5+Nwl4TmerTYrIAIhjEBLWSD1VJI+wQvmGhFA1vM4P0l9TeLWvePprYTIXNdtcdm5zhYIpInku5AFjzoUgPDwufK+ogsWnjDOqc613DD43O0MdZVR2ZwyHqx2GqpuMd/pKfnPS4ederV+C+UvcBmYJ1UeEfy5B4aHI+M6rWE0YYUB/NtKoIRdyD3kOx/uiSPKFa5w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(39860400002)(366004)(396003)(376002)(346002)(451199015)(2906002)(6666004)(41300700001)(83380400001)(66946007)(6506007)(107886003)(6512007)(478600001)(8936002)(36756003)(6486002)(38100700002)(26005)(186003)(1076003)(86362001)(4326008)(2616005)(66476007)(316002)(8676002)(5660300002)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: I7x/H8MBhYXsM2nAZJ4uHBYaHTdQwxfAMdfPeo8SZFCHbTFbkhnU9oVfBjWMosAbqjPI8G2TkXPdhUYEXTthhCyRlM3xO64AnW2CG+h7rDtQdBmFoShPFTS67InQFTPPjnNC2fWJbSNCleUrUMXqFrCDhCp/4dN62GMjHOvumAu5KSQw1bkn03AbwR5ivvGqoFx6dMzpOUFoWVsjb5aooGfV55z0o/O0jBiyQR+WCnmOk42FKr+PgZg0w1v0u1lJaBjOQzeVTYQeAavG9kRtAHrOZs5u74tGmOvE6kcH9j7rd7P6HLDdSvQkxnKiiYWRgWzdVtngk83DCJ67R7dIfc/MBe6OjEim9WKOZXREARi7bfq+KIlftbCFXP+iconW3aF3ek9x8t0Nu6DhphTebGP21f6UymSZ6sVfN72UHhcxDWIgYImtzBcnASVJzaASikLTnfwLX8JI1qesRWm6+qSOLVcoTrSFxjRnwMCIaxnXeB9xnZV9yWCwhEz849mv3dv3U+4onda7ap0a0md+NK14Ko6bLcheNkhXSOTomhPBV3AqLTgIvBVNAxgDwi7m5Xug9ueIqqYZH0SyG1AypA67DzJtHVdaHzL9V2FHGFd1cx4bdzRHG03L/rZu8ry2U5joOZKTbuMnP0KWNDiTKh/0nkd0ZtNhBRhBQf8ACebhvId6gYFqsvtyDnKv4hj/+nRWg6/3a7jF5iKR14VU0C3nNYnidbtgZcxWBR2MAn14XzPZblVoSqBMt8wuthc7zD/E/S6e9gKKM/GPn23c3xi41xn7e6VlnxIXipGrBF9qkP9xWBWE4z9s0usEPnvGwCsuPBjTn+Uy2cKP/unSx/buOhXYHx6T3epJtWkEM+aS41/tTNr43c8xF6vf+kY2sNctYTPSxQD+TEInOXEqV1f+/EXKqD48q11QtgsSTFTflIPCgkoLiy5TNdFNBRNWuZLY24HVL2WPTDY94WWPYRQX4NyelCTLzBunnH01uOibbc0/spvhnDnOxt9gFFYrRrv+9YtAjqycwC7OvORUZPTxCnFYlK1GlD6RcXbqkcQsAV3n91wX0bNaUAOOIAs1V+uWM2Y5vvfhWFi5aztGip8iJVfIjqTOYLX8z8l4dALJnLrBJKTlO4SP9LTSANmimWU6Z8h5PU9zPk15XjrBruN5v2JPSwnswq3+dzSKAV9XDQJPjsW+iL2EWsi6KNaDCcIQ6PZ70PVdavoUUWlP84CFHs42G6V16f2srXUOHLisKVzbsi/ssPkvOwyulr5J+p5o/3fSwqdjKYwoQmbdJHQGNti1sWB/uenKRJ5t25/oGJuvmBovxF9VWD7/9h12eRJrotdTEOgS+MEAEF0vp3NhU/+esGjt4cAqGONVdo+ZqelQvxQOiIXQ0Vmuk05/f1345lubRVvYm0PDa8jtl5apWIn6hjhXtiRZcCP3FBKgqkx7Dvo9SYm9Rgxun0mfL0mCEcytnvm15ZTMNGqis7qFj0PHxymzqiuCwUtAu2NP6BLyzRYMn8BrdxAE0k/xfzP8Zq3hXk8fnKkUYpwF+5SkcE/a4LD1ZKibP0Lo66Mk3yp8EYxowpoCNDrAtzBWar+ZeZzRXCAqv4BJts8Vig== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 043689cf-7423-41e6-86b9-08daa1c5fd80 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:56.0971 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2IihaR08LmH8m6bS92X9NMiCQTm9PpPKaR7QIJPIUkzLCLzAOV8QmHTuKo83L9Z4B2rJpQ+xD/zudMMyZS31WzBNgtco22sf++iZsXRLvCE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5872 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 suspectscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-GUID: 6iHk8Q2PVm404PBAg0aiCsgw2IXesyeC X-Proofpoint-ORIG-GUID: 6iHk8Q2PVm404PBAg0aiCsgw2IXesyeC Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This has scsi_mode_sense have scsi-ml retry errors instead of driving them itself. Signed-off-by: Mike Christie --- drivers/scsi/scsi_lib.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 9136a3dfcd67..c7efdb00baa4 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -2160,8 +2160,18 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, unsigned char cmd[12]; int use_10_for_ms; int header_length; - int result, retry_count = retries; + int result; struct scsi_sense_hdr my_sshdr; + struct scsi_failure failures[] = { + { + .sense = UNIT_ATTENTION, + .asc = SCMD_FAILURE_ASC_ANY, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = retries, + .result = SAM_STAT_CHECK_CONDITION, + }, + {}, + }; memset(data, 0, sizeof(*data)); memset(&cmd[0], 0, 12); @@ -2203,7 +2213,8 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, .buf_len = len, .sshdr = sshdr, .timeout = timeout, - .retries = retries })); + .retries = retries, + .failures = failures })); if (result < 0) return result; @@ -2230,12 +2241,6 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, goto retry; } } - if (scsi_status_is_check_condition(result) && - sshdr->sense_key == UNIT_ATTENTION && - retry_count) { - retry_count--; - goto retry; - } } return -EIO; } From patchwork Thu Sep 29 02:54:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 610828 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1A59C32771 for ; Thu, 29 Sep 2022 02:56:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234816AbiI2C4h (ORCPT ); Wed, 28 Sep 2022 22:56:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234929AbiI2C4U (ORCPT ); Wed, 28 Sep 2022 22:56:20 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4210FDF05A for ; Wed, 28 Sep 2022 19:56:13 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNiRnI003459; Thu, 29 Sep 2022 02:55:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=zFn8foNjeDxfl5X2fIKbSUnmirBJ9dDysJY2YUIKjAE=; b=PZoBi+OtcA78L21bJSNyjNjhEtimt4PIx0+IVRCnGgsEnJlkw95b6Cq2fV3uz/tItTQO BVTQl7g/numlctMfDp2oHdR7SB/IvusUUr7Ii5jvhDm2X25p6xTreVtXxtgWaR+ezfrq TJ0EIuqv5SyD9CwebM/KDsZCSfuDpigsGLlPhpjkE4XFoRDrqY31tdeVa3vvU8ELP2BR eHDb/pZQ0nIL4dguybmBtc4YI8fTCuwcVnmil/lqLpdNvSGiQhADYEHVYx70dp67asca CxZSiCgFkgzIXkgV3Unj0eZjQQnWZYnqeZBAeR5Vmi/BhHYrmd2UiTJgJULypZQnoDj2 nw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jssrwkjct-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:59 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28SM5fAo040308; Thu, 29 Sep 2022 02:54:59 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2168.outbound.protection.outlook.com [104.47.58.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jtpubbpjj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:54:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a/cie8V2lZ3D8oGGJLSzvftclumPsvTI94zLY/6ZvBaEHbzPmor6DoVJyGUSPrlQiq/pp0uK1a+nZV9Zwp13IBFNLBfNuc/NhkSRpdcdawHf36DZxjTnUtG8+gVs2MHGDrfY3t7xZz77r5QFlgd+YtjlamjTlitE83HAnrpht+ttuDVbUXMhnSYdjZ59Ww2jaNP7e6EX6FIV7ZcwvgAFIVEUGN1i9xz94hOuTw4gIkv0ZDcVLyroPkV7rQceQtswEdu07cr2YoT2EdocUewkrcKzC+YN4rMQs1emHSsLEg2NSkow8FodmqpwCpDSOaINfRIlLMWsW5ZqUEyCwMj/eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zFn8foNjeDxfl5X2fIKbSUnmirBJ9dDysJY2YUIKjAE=; b=n0zrZ3elTO6aCk1hzRBU61QZ/z2Dsp/sU5e/vv70TLrin9yebXAk0zRba/ypa41ns+sNzfg5kFWzfwuIommA+OYZrB3b2MFnLdiEBMrGFghnb2gkTCOhjvKTb21e5IllBaEulS7N+XdFXxdE9Kt6eqXmuRM4nirYYzdH9EibX3xQASoTatKEiqPMyNPQt5CyXaHAb0p3Zwv149SyckdpQiii+XUhcr2BzqXtuYtQ+eqVA0qH8RdqGmChVv5GMI0KYP6qdtp4T5p9KwL+TdcKyjbtK1uJ+zdgQqIgHOTGkYuHUIDjb0NWOfDuQcr3Xlxi957HyB9dhOoIi4e6lJHcdg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zFn8foNjeDxfl5X2fIKbSUnmirBJ9dDysJY2YUIKjAE=; b=ebRuGxkHiYcExgxxgLPvPL7XZZ+8/WiAGxM4BevUE1y6oVF2ERHzcEapJwL71LJrBPrzLl0y9txmgFPJwx1IozxIJladnPUQiiwd/ynIEJVKUUK+K6jmoJjolJ/Z9Fbqq3kCVOskOF/Bhocv8MBxv3XzAGlDD/yZIvDoxSMHLow= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB5872.namprd10.prod.outlook.com (2603:10b6:510:146::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Thu, 29 Sep 2022 02:54:57 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:57 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 30/35] scsi: Have scsi-ml retry scsi_report_lun_scan errors Date: Wed, 28 Sep 2022 21:54:02 -0500 Message-Id: <20220929025407.119804-31-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR07CA0048.namprd07.prod.outlook.com (2603:10b6:610:5b::22) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH0PR10MB5872:EE_ X-MS-Office365-Filtering-Correlation-Id: 0694b26e-f4f5-486f-c576-08daa1c5fe67 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xKaAZowMFcwEYNgMzXZQXSpr1xWX5/jn8x6idTev5yWFz/sPJEbLp7K9K3ElGXZsvENcmV8iGhZXJ5huPLfzvJ6rYyNn68kWdc6G6Kfkn8JdeKohrpBQb7rxDPSgXAzSaqz0N3tBXreFAb8R1IuU7C7OQnUnAcpJ2l0ofsvGL/LjnBwLwdqMyv4AkgHaG7e/rP5Ws+uPMJvrWHch5BAqdZg7dxAUZ8OAILUIwJsNBsud+UzgPPH98YzZKBwf0EEKC64suQtbBoJBBYxMwFx+sJl3eQV2qg+y7NcvWGBvxuNy779NokU10OlerZ4LNO7In1CIjP/o7AzdSW5GT8jaqxW/Wkz/nY6O8qrt5HyJP20n3xETr3sB9SLo9FeoqsiZ/QIwtz9CRa9cW6vuNi7wugMdWuMlQJ1aU87Ow8nL3zlIZbnJGE7IjH+LWy/iuW+QAgoou0So5OzNJ5y4eF1yt688u8blQ2+Gw+0sKPb1qYQ8RNxNXSDlUJQMhoj6RGIEZqZGp1FAs7gndj/yl5UQgwL8XK4gJg6DD+sCCQlWaqfNYaQ3r2f53GxKb0WZgckDCYVGO9ZGBq0McUCabSy2LprSLYGe8ou7KdalK8S190lK0c+/2FE3UVHZCvvetXbnM8G8laINzTRA129PM+RbBuOzIR5K/Jp6YZBssNKKeSnxUmBgO8l7HQW7DmEQ0aRcoUO46IElEyveNLn3yYkupg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(39860400002)(366004)(396003)(376002)(346002)(451199015)(2906002)(6666004)(41300700001)(83380400001)(66946007)(6506007)(107886003)(6512007)(478600001)(8936002)(36756003)(6486002)(38100700002)(26005)(186003)(1076003)(86362001)(4326008)(2616005)(66476007)(316002)(8676002)(5660300002)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: R+VQ7bFftG9x29c59iVfaUE8oY93LLfolgnLjusrzBVpQiirQJbx55KkZLCbgQf9ftaXN55DDxJdEok1KpP0qLltICaFBBI9Hlu8HbSCDCdHX+4vmzpWT087+EClIQStK2o4exgkk4WVuncInyHDvajPZ746J1X2QKjrqaQ98hrhb7LjcPuTPAIrn1HKpzIyKE9gdBYwqIrQiJ6tg3Zombqx9vkmCAJ9OOURhIJYteKZuKkVdHKzoDHJ+t1T6JhgcZZVJKd5y1WAkpf9puo7Fix5gfGAaGQKE93gdo7xhWJEhCKLwgZzIRx1AUFbNZ+5jdLZCUc5V1X/eym6E5jUhjAPZk0jkJ6AaMhK0zYPtvCoNEx+cDs9eFKX2zUy1cYWNFcpylgPhhGa6fZouRChf4tqgIaDMPExmBmZS/DAx6/7E3mUIQikI8b/o7GO9L/OYORKjo7ofzi88cqW3FA9yEzzq8rumEczrgvqf3oRMeeEe69Lg1SdEwgX/gKdcJj6YzN1tNFLAU7ErxipoWR5VyXz1nU/rH+3UUNNkSoyoWya+8jbJUXdrvLOtOUMkuZ2svELUYOObWeVZfQTWqZZMIBblm4h5YKGIFgdNSSi48YDczrBd/Fn8bDflDH9vrltWdN3Zy6deg1d5sY90WQVoFjYXPqQR0hFNLaVm9oYkyjTBJxN/q/YXAIcRcVN4C0wEdANl3FW+880sO4uSb/r8lVq/KgrgHve+5ucK6jc9vboYueCeBmwVld/fdN3+98aG5i3f+6uF3qcgjxxm1EFxEpof7oCnGhrkZs/HRkgTDCWeHFGB/Xj4geqK3Z3O/uPU8p/p/hf1jm+EYqPW5wdwA99ZT7ZfsE4T9UiHObF9Nwil1t6nYNq4LxhLtBatOs/8b1KQ+daPTAIh3P2BaiD3XOy3ghYEDtGJ+O8a7M5MhmNOSW9NHsGsWj+OFE94PFO+wLfS4961p6jsd9CH8ZWPqZO4HQ7qZMFYafckbUo0fyF6popPTV8Ave5fI2SnnTp8Msp7LsPfOZwpMpEgCg8LNzF3nDRDH3SOEk7CaPi6FLUnMEtarC0FkDbQ1XQ0NL/9gN+jloomYoKTNMxXN6l5PLtg/Pqgy8GaeGqzFUwe+q9QMheT3T2iUmw5Endf4CYuTwCNDz9dlHwfkarb4JZrYD/W1lKe571FulJvIe7N32axDPg24qw9lJt9DIZrPqI4Bf7GYnJWPM2RCir9R98PJzzb0RC/GcuTW+Tjv50wbfHC8stt474OFDr6wrsoR4Bq9wvmSNSr4UxW5nE7ehlkCfyghwi0kvZm4nIugKv7F2mFm2M7Vr3/4Hv33Rel34hc9GAQOMgtjNobLnA1KHHZhzHrRIfehzYnz+ZelmXA28/JMzpPPvYxLV7ypad9QA2LM4oplJttDAUD1iKpb/KeUgb+E9x0rkwHhZIFJ1eydyP1gDk8V7w5EM9fYl2ypMAS+NZQuGGd9naRnBGIxi84rEvzYC4ncbd83WE+AMkmyxopFEkdQ2qwsX7p3rdlJTTF7UQ1NjGazSvtUA1qKwEwK9c1SdUDmL1/rk7hmOf9ZhwqgRifNf4DqurJcS5kXC+TW1lpSxNUOLuwmKr5/Edwg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0694b26e-f4f5-486f-c576-08daa1c5fe67 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:57.6283 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ETbaka4wHvcJBZkZkfmze1IyQcErZUkALgo5Z7F2Ely2yaZmHq88L2SMTjzHGKGhNOG9wohvWb9Za6skpgO/hCVQt3/AiBeFekjDpPzjFYU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5872 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 mlxlogscore=999 phishscore=0 mlxscore=0 suspectscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: mc0rXSaLYkMyk2xVy0VP-68U7OdFdXvJ X-Proofpoint-GUID: mc0rXSaLYkMyk2xVy0VP-68U7OdFdXvJ Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This has scsi_report_lun_scan have scsi-ml retry errors instead of driving them itself. Signed-off-by: Mike Christie --- drivers/scsi/scsi_scan.c | 54 +++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 4c2e8d1baf43..b783360c38cc 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -1420,13 +1420,21 @@ static int scsi_report_lun_scan(struct scsi_target *starget, blist_flags_t bflag unsigned int length; u64 lun; unsigned int num_luns; - unsigned int retries; int result; struct scsi_lun *lunp, *lun_data; - struct scsi_sense_hdr sshdr; struct scsi_device *sdev; struct Scsi_Host *shost = dev_to_shost(&starget->dev); int ret = 0; + struct scsi_failure failures[] = { + { + .sense = UNIT_ATTENTION, + .asc = SCMD_FAILURE_ASC_ANY, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = 3, + .result = SAM_STAT_CHECK_CONDITION, + }, + {}, + }; /* * Only support SCSI-3 and up devices if BLIST_NOREPORTLUN is not set. @@ -1495,34 +1503,22 @@ static int scsi_report_lun_scan(struct scsi_target *starget, blist_flags_t bflag * should come through as a check condition, and will not generate * a retry. */ - for (retries = 0; retries < 3; retries++) { - SCSI_LOG_SCAN_BUS(3, sdev_printk (KERN_INFO, sdev, - "scsi scan: Sending REPORT LUNS to (try %d)\n", - retries)); - - result = scsi_exec_req(((struct scsi_exec_args) { - .sdev = sdev, - .cmd = scsi_cmd, - .data_dir = DMA_FROM_DEVICE, - .buf = lun_data, - .buf_len = length, - .sshdr = &sshdr, - .timeout = SCSI_REPORT_LUNS_TIMEOUT, - .retries = 3 })); - - SCSI_LOG_SCAN_BUS(3, sdev_printk (KERN_INFO, sdev, - "scsi scan: REPORT LUNS" - " %s (try %d) result 0x%x\n", - result ? "failed" : "successful", - retries, result)); - if (result == 0) - break; - else if (scsi_sense_valid(&sshdr)) { - if (sshdr.sense_key != UNIT_ATTENTION) - break; - } - } + SCSI_LOG_SCAN_BUS(3, sdev_printk (KERN_INFO, sdev, + "scsi scan: Sending REPORT LUNS\n")); + + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = scsi_cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = lun_data, + .buf_len = length, + .timeout = SCSI_REPORT_LUNS_TIMEOUT, + .retries = 3, + .failures = failures })); + SCSI_LOG_SCAN_BUS(3, sdev_printk (KERN_INFO, sdev, + "scsi scan: REPORT LUNS %s result 0x%x\n", + result ? "failed" : "successful", result)); if (result) { /* * The device probably does not support a REPORT LUN command From patchwork Thu Sep 29 02:54:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 610829 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DCA9C32771 for ; Thu, 29 Sep 2022 02:55:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234858AbiI2Czp (ORCPT ); Wed, 28 Sep 2022 22:55:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234822AbiI2CzM (ORCPT ); Wed, 28 Sep 2022 22:55:12 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F295F4DF0B for ; Wed, 28 Sep 2022 19:55:09 -0700 (PDT) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNiIqD023211; Thu, 29 Sep 2022 02:55:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=YsXyBxN2QX4CpdNlv+A8zrvQdzppqIMxQuQmrC+ofQk=; b=OItsXW1igKdhALeHSBj4gJ4O+I5k2r7jvvovksaRtkFMcy/Ede58PvnxvtAnT3WgQW4k F+4ZCbgooLc6qdVPKTzpbkQVIEs19+W0Cr+yQx/zkaWakl5r3zN2uJ1t14aAT9dX0a4G DCNTLX43+Z3Mo+WW0P7mbx1mb6BmMqV0uDrxlke5pscHsvMUdI4/fS2TLVdrWazNIEux K4A9yCsAWpU3ZyRnLvVC986Qb/Klglt1mp3IkoOCtjRSu/HhbfqWnBWNGr6CIBR41tRE qqBkwwRTi2n6FDrcHAwbZfrx701IvRO3uke/ox0twpbjU7iY9ma6ScyekSTUee75cvH+ Yg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jsstpu2xe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:55:02 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28SM9Skn039489; Thu, 29 Sep 2022 02:55:01 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2106.outbound.protection.outlook.com [104.47.58.106]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtprvtcy6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:55:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V3zNh/NVXb0e4gJvrOJSVeS7LK2u4+OL7jXQ3GNLrFz0hym8Dalb2oqloMQZOxbuCksDGxw0BezA3iz9uHXY5ye2SvgzA48RKay8XvQpTsnDxLZmyJXyMZsbDQz1KLtmX+mBFWESBDPljh4VsZ6SzsoLzVuh15mkWODhD35KC716UXEJlC02HpEv6UK5pOtQZ+7fSsLJtpcEF528YZeBtIVefL/9JsVV4Sm3vBaMJZapRVwrLHAynPgNfP7pj2W8RJNovOZ38KfvkKow7ZdMuRouF7N/TqAmlMneFpikND8XmDBWvJsu9WNyA/pPbSMRz8Qsyzj0zrYccd8YbID03Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YsXyBxN2QX4CpdNlv+A8zrvQdzppqIMxQuQmrC+ofQk=; b=heXTjBYqC8NJgCNjPDwaWvPdHD4s2Ry0rte+bU3E3w0AYyTRJ7qp0Ola//aCEKZBkRvK1I2V5Ka1LqrkiNbkhNKcapDg0EMva+j50uApcyHxyI24HQ1ad2AcG+ZR9haHjM/nFQ9mWGL+fVSoSkk9co7jt/5oIkj5nP/qiNsr+oJGr7doNDoFR+p/xUYE/Xrq4HIN8Q1fdDbJhDsvBn+GVKn/520wphX9XS7r664DXB401+1ZR6rhGiiyKgx7iYkqD6Xd8Rz6JJj90pTrvNuO5aUCVlVBug670//HF/uQmd281iv9Vf1KZ9sguTTPTnzYSAvf+Ft99Vew36r3oyIs4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YsXyBxN2QX4CpdNlv+A8zrvQdzppqIMxQuQmrC+ofQk=; b=qz8nrj4acuhG3unHAn8w9WNrtapzuIiyT6DjwjUshrhqGSaYhLRKrEVsYWFGmysoqbKpjbE2zM8HDXPa18VCUtFtQKn6eRiOF13tHvOp/pZBY4N/dCRyveY7zcexTFQgrAjlsWAbeY72d1J8kdG55dPMnEoLRCB4qLKyw/XIGmM= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB5872.namprd10.prod.outlook.com (2603:10b6:510:146::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Thu, 29 Sep 2022 02:54:59 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:54:59 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 31/35] scsi: sd: Have sd_pr_command retry UAs Date: Wed, 28 Sep 2022 21:54:03 -0500 Message-Id: <20220929025407.119804-32-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0021.namprd20.prod.outlook.com (2603:10b6:610:58::31) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH0PR10MB5872:EE_ X-MS-Office365-Filtering-Correlation-Id: 3936483d-05dc-4ba6-7b04-08daa1c5ff45 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 04DqsCB8TMdsljWEyy49YRA69X8bi/ddnL1LuhGeOfKWv0gA35n7El7wMX8OC3+Ny9O/96+d5PvoUgO9DEAM71W5fyCdiQEzHPrD6fpuU9GWpjduCUcT7mqdEK0+GoDSxm2f4Ga6/YoI6knoprJVvEkyOHEDIrR6mzPUBxDtCZ6DnR7DPI3I8TxR6QEn8VjzKRQcRL6UzeVNfqyyzdyQbPl9Hfwd7RMipJSUWt20VqNiFCKwQpUKhA2nArc+jx35B7hEVJ10/LtwAZFW9DJMCAHoc+TUyvN2Yi7annla99YRtZS15P1W5qStw+xMUzs5GPXgmqTNWbBCx8tE7rgD/bEKh644kL1RjEIqhC3FiK/HQnbYdJKc02Kg6pU+Ke8AcIf+667TIkvJdOFXc9o9Cqzj7QpvqHBJnBudr2f85P/OizI3Me2rFKiyWfFpI2x8nuClMIke9tmYTnVy4Uokdch8/0pWI1JVrQwvBvuLxyF9tdE6Ksdm3w7qhK5Temymg0nJ9PavoAzEt/mF5gokg0eQgszvfzErWVuInhawLOQRNtHh60qgtD/JH1bDkaZfzydJXcD9Nz5P/Whr6WmQ22VRr1m3jZlCXyGllpJwGFodr4XQGctO5IhMWOAlAHNKGk4pS24u5gfZz6viwRUCit1/Sl9wxcY7de4fpBVXQGg85o+eNVxozXimrj7WZvtYe4t5EXEgEVdgulAc76dixA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(39860400002)(366004)(396003)(376002)(346002)(451199015)(2906002)(6666004)(41300700001)(83380400001)(66946007)(6506007)(107886003)(6512007)(478600001)(8936002)(36756003)(6486002)(38100700002)(26005)(186003)(1076003)(86362001)(4326008)(2616005)(66476007)(316002)(8676002)(5660300002)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VAbgtq0IQuNWojEl3htPtrtCXBwQmNxLD8wWsvs1Pi9BX5E/SnFQQIJsVCzr7T8k/ElO0TLNtSMHQGpJMBQB0Pfi3EcyxoyvmIqWSCgD8LUG1eyVI3ZP990t+GMwExk5lVJdB0EV5jOxrXoG923wM0kPDWbUJmmk/9GFzDPdFrwokYDYj+JRexDT60rD9qx8UNeii/4AWnKZywNFRt7Jn8J8p+tz5aciXxILfBg0kiluPnMCrR4eX4T8u9r4rx8RZbPXo+hEsvaby/JbU7hcEPo4Z9QqaPhbIT5WaF0jCFj7sNDCLnyXIBUC9fEISDuDzt8W8QADCdJ97RlbvptqPI/3uE7nLcBWPyT84qQBi/ERi3Ofjq/3Uwp2qdWNvdXtgBwaWtrN6wDtE1mtRWBPTJBr7YJLUIS+igzCfCC/Zh4OEr4s2O/CFiI+UCR8STn0s5bpDZZ1ZU9TKYp+Vr3BH8lJMelcFpDn1rzZxmKWHYfbtdnqSPqJd2j4vR7VjtCsi4bcufhSumfbbL0Qvr/NSQjOKVSMFotgMvi4GQ3QNcvabZeVPblU9asFYtjnaYCaCePk9x9YP2qvp1gy/ZHup1094IxivkSuwJIXeGBrTDEArllp5lz9HCAxdYcvF1+jhIrzC8XQxn/WGQ6IhQfI4FAsGCyvfcQODbi6aQcB0nA9IXv5gmETfIVgPE+Ls74yfzvdgia2dSle9M0cquSIGKixZNxHNhL9FqkDqr7ttyCgCFI70D4g1mMI+cd/Q7kVr8FTlmiTosVnvC7UxX5ef0q/CVO8xUWu7taeIZZ4F7wEBdNJi2gIRrBTJ65jLN+y1b6I/Zu/rtZ7XvOE63HLociZGkjYCH9OcbRJ55UA4cX33spf5M2PKwzxYiQ+6GSrbL6wynwNlFrMVK9Irf9p7jk/9ZJd4lOJLfi9bvVvQtnzvRLWHdceM/YxjMRiTuQ5Mdk2wAan9QjE+lsBxEezhw0AOIlFTQE6VwaTrgGKjXy8fjgE8JUuu6ZNHlmJksHw3hC6qzHWxV+P9U9pcoWsDlSkamG95B2AOrXTjrjIdUENB6RcppF8e6Bz1bQuYhFnTvhJyxqJZeYsnwpBv+CfYIUOqIgPxBDSzpUN/3lhxx5fVP/ewkFf3jLI/H/oS6tvRUvDtakVdaEFWIgnT+O+X7fR74EWUYwW+DmqQtd6lTBMCI2dS/plQ86iMWqUZNu9hIWrblvaLkSK+oqNeP8ZwSu0kNvFZksj2VHGs4qrAtaiw3Ehk+2bhaTKf7cdOWxIzqpwvdziDRIBAf5M0IOWKkIXdgUIgO0pqmBAEjXQgW5cKVDcqY6SIW8OIjGUxuwaeYIyigFxgUpAeA509vJVRttziKNhwFElwoGCpXhN2JGDDjfgMcaLNs1DLsap7fVfbeiJ6eoBQjRgafuH8vVmyoCdwmPi8xgmrHYE6CjTvouulwPEc+4BPqJUWrYRiqd5rNTOEECtXWIhBSnJW33IxOwTYyE3fsy2Mqhj7SVMSGEOcRW3/2lL/RyeUCHqDtQSovZ27viIAtHndrIIS6lgfdY6qVatUqoNJZi7LhV3wP2ICaRfqP3MUX74uWctUiWmuAy24S3bHJWVqufe0DBBvw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3936483d-05dc-4ba6-7b04-08daa1c5ff45 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:54:59.0500 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1V19a63YT7secfANP4i1j4p1kM5MqzZ3RmblTHJyYtR2k+g/5/0Jf5ht5u+SbJY2mJLmtmlsCjVJC/Bh299DpJ6D85dMwD4DfYRjhE5pUFs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5872 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: XKmecgVkDHl8mCFci55_F8Q4NfZed10w X-Proofpoint-GUID: XKmecgVkDHl8mCFci55_F8Q4NfZed10w Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org It's common to get a UA when doing PR commands. It could be due to a target restarting, transport level relogin or other PR commands like a release causing it. The upper layers don't get the sense and in some cases have no idea if it's a SCSI device, so this has the sd layer retry. Signed-off-by: Mike Christie --- drivers/scsi/sd.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index cacfdde545f3..e7c7992b7bf3 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -1723,6 +1723,16 @@ static int sd_pr_command(struct block_device *bdev, u8 sa, int result; u8 cmd[16] = { 0, }; u8 data[24] = { 0, }; + struct scsi_failure failures[] = { + { + .sense = UNIT_ATTENTION, + .asc = SCMD_FAILURE_ASC_ANY, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = 5, + .result = SAM_STAT_CHECK_CONDITION, + }, + {}, + }; cmd[0] = PERSISTENT_RESERVE_OUT; cmd[1] = sa; @@ -1741,7 +1751,8 @@ static int sd_pr_command(struct block_device *bdev, u8 sa, .buf_len = sizeof(data), .sshdr = &sshdr, .timeout = SD_TIMEOUT, - .retries = sdkp->max_retries })); + .retries = sdkp->max_retries, + .failures = failures })); if (scsi_status_is_check_condition(result) && scsi_sense_valid(&sshdr)) { From patchwork Thu Sep 29 02:54:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612195 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EEF6AC04A95 for ; Thu, 29 Sep 2022 02:55:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234885AbiI2Czu (ORCPT ); Wed, 28 Sep 2022 22:55:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234863AbiI2CzM (ORCPT ); Wed, 28 Sep 2022 22:55:12 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19B174F191 for ; Wed, 28 Sep 2022 19:55:10 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNif6f020801; Thu, 29 Sep 2022 02:55:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=jaChMzsQ2AqofL5QV7lsV6jKWLsgLD3SnH1sOXW49vw=; b=HvomWAhzVT+ImSeSp63/91wJK7HcNayKi0eNqzniXy0ckIkF6Cf6ynF0wODJ0jKBmitI KE7sXHjgFcPEhLm52/+j4+lJmKusrs2C8HrDdVHNuvGgpeWDpOe3J8PRcqGsQcubl8aH 8V3cJEiHfRjO2abNbWVEe6ahDOly809oinEwxoRahKsuNeImPBnZgIO0i4kl+a80qYs/ sOu+a29TnDD/UoULW50Vb/Fc8I9EzA1qfYQURTaR5oUHzOp8U9JLGtHD4InAktDNtjFZ kAPJr7ii75Mh8u4FX48lXIMkbuCOg4IpYwRuMQmU+kXV9Sy9CH9A15hbFR8K+HM6IEw2 Sg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jst13kgbf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:55:02 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28SM9Skp039489; Thu, 29 Sep 2022 02:55:01 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2106.outbound.protection.outlook.com [104.47.58.106]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtprvtcy6-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:55:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EKJz4qv2z9IRMOSqF7sGRxrZqUa1Vk9xvwiLC4IWxUQIMoUlNtmp2qdEEArCGXh6M40yNYQ/lWBipA5qXZhlsrjdue+a3/VlZLch/HNgBNLzPqrVoGR0xUQ6RIuemO0L+fWMoGUzNUcjm173GJZkTacnrXkMcAkUM+Iu90ggxitDegXqM9QaU4T/WPNQeMKNA06EWGmSUR2i89JTplye0RbAmqhc70emMUcnXgcwIC3wg9wW13J2h3kXUDfWCarXgKWyUAlsW9v1h6DkzWNm5ueg7yHdQHOlox5/gp00z8mBH5dchO85m3B4thIzwPmaACV83kIApqehjfNq351NEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jaChMzsQ2AqofL5QV7lsV6jKWLsgLD3SnH1sOXW49vw=; b=XS8kKRLpZYD5zoL4nKBieAjQ7nRtFHMgf4nCmWyxPwL2R1fiCX81hIsblK/B4tYdDBk2ZxNvs5GiYp+CSDIblaKJFSUZ4ozlebhDFJvBgryy2udMslUyVB4AV+FRBIVXT51kQYajfx1KP1WLhzOUtHH1JZnDGNNtCl6XhaqxG7iGj34iIWecJT8iXqr4aBtvlkqhn8lyKcJo2AozbBN9EVnb105Imvb73hwGgcu6JTJDoCvT+tlN24XbjxP0HlKJtY6r5iz4wF1F6hJTd0fmO9hhpZKYm/Bh/g77ugwxk3FnUwEtt4S2tsfDJY3ocnwkLmtvSPgI0VmWCJi3FTHcgw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jaChMzsQ2AqofL5QV7lsV6jKWLsgLD3SnH1sOXW49vw=; b=DONdZ04fW4DJ+sw3cpDlCEg0J1LE3vJ2Bvn5sf0DXf7iNMckYgme+fbAe+i4M0iSiWP1VjL+yuRBERfALSZtLKhTgpEOIQvKNMD8Q+A3mN6dB/ErUeKhFpp/md2jNZQN5aG0JLcmfMGLWmVqXPUPUysWGLOBm9P0fOE/RyBGVUA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB5872.namprd10.prod.outlook.com (2603:10b6:510:146::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Thu, 29 Sep 2022 02:55:00 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:55:00 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 32/35] scsi: sd: Have scsi-ml retry read_capacity_10 errors Date: Wed, 28 Sep 2022 21:54:04 -0500 Message-Id: <20220929025407.119804-33-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0018.namprd20.prod.outlook.com (2603:10b6:610:58::28) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH0PR10MB5872:EE_ X-MS-Office365-Filtering-Correlation-Id: a1335a67-13ee-4a69-e59a-08daa1c60014 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Telqv7jyO7ybeLISmreDjEIbWIspEtYvTMVDFYjlhpSV1zVe/XZLwbsiZ9VZj7lOpzn6DD8gR7vrzr7zvIQehy1e1oM2PmL4k3WU6+b/asdgl2qfN8u9QrYbZzAKSB8Vq6F8qq+JT2jgAgLLDCpKiXIG79Vleb5XSTLYS4JE38jxRwNndvpDumZbG7LBAaVcdd1yWPu1rcwU0WPzDbqAPRzxngZX97sWTIb+eTUT69M7AU+KvPaycGRsuZSw/VB6X/0HDtFBncPrMab9q5QURc/jKA/PG5nr8Q344P5u2NeDlqqQdv/cAL4SMoVMRF9e4QbazL5tgq4k8dghG873y1PaA/oGz3yVKXRvYNCe7aWwG8qJIYAl6/+WNNfuylrxxbaDyWb37EVPjyplovSqifaUY83oeo5nrszy7ErRb9fPVU+g4DMecS4uXdgYsjw9B63sBsqLy0kE9O2T6Y+eqPZuwCN9tGvq5Jc3+uUcWgSgzIQzpDSM2x5/2eX1yMO1Um9xxF1Eed9jJoFUJax/psVYoEZe8r19fvxOAvqRkULFzcqIhibXaxLqmEsxl5T1pSUk+yuNyGaDrkkBIMjGyRqovmOIwJRPuEVXEShtw0cYIqNBTdUnJ2E5ciMMqht2xOaUWsCpK+ufh66QntTuau0U8YQ02IoWGnTy3oXB7zyVeLVFiQue+be/UDoEA9L7+oTPWkdrPZt5LUvGvpVYjQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(39860400002)(366004)(396003)(376002)(346002)(451199015)(2906002)(41300700001)(83380400001)(66946007)(6506007)(107886003)(6512007)(478600001)(8936002)(36756003)(6486002)(38100700002)(26005)(186003)(1076003)(86362001)(4326008)(2616005)(66476007)(316002)(8676002)(5660300002)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zzXvE3WbywBssZ/8z8tyiT47W8vStR8H8g4XAFpHLt/ZpzmZaUc1VVqF7r5yVAXBZb9Ch2y6JZ0SOoTu8xpUevEVkSRO0upQhR4hIcHVXisWO6//tPGYBLNd9jWyWLP6mMT6j9ZxMPfK2MRcRo45TkHPhYvB5EOnTDPEZICXHWeRLOmSnx5izP6Y2aj3R7MoZ+p93/NeZDMbYxYr0vTxtGuRU/Cp7vvn9KqrR7TS6z4K3jejBGElMuq5G5RY6XyCbq/49KD/TZBK8dOWBfQCIy5vWIwtxD4pA/RiHYZP9Kp2U7NraroYArxj2X7GzmDXT/+hl41/1E4iao/N8yvbxJKHlCTDgadkDIgplK5bAvyNopujAY6M/D3aUBBozmj3spGgXErsQgaYWTwjeG8IG6KGiL+ihKYTfHOpd+5yYCnzuvmmpFMXAm8n5O/bBgyiC8nfQ7fSV8h35qYRBTC2UJiQuiBgqqjv3OYWwipO3FzgjSQjH/FE1Ee76x1lp/wOhmEc3TMXJUs9m28rQFHj/b04o0jz2uyAezn6nJ8x27hlYUVW5W2buMWoZH718WB3g7c1mmNsG9M0ngt0RMD9cgsOi5iXxLNg6RiLa7ma0w+DUaxHFx/5s19PF+A9nrhAXGEfiS5D2ns1cr6PGHlGwEyPDBqM+kB/fynNperHBfUeiDZwnLiwJwdjVS5FpnqPqmDD3wzJnlauYPD/seO1T4bL4tzg24WeXBaEjvLEoPndZ9SiLovAM5Cfncqx26ozXbok/v39geZFLgpLXqhxgE2BtLdFXXPvUczWUWHGLK7eiSvF9bT0zbbeTLro2X/5OVbzRQ2wAIM95ofRE0Lp+IxnK91oNDdxDRWq1vzlHoqKX4Z38UIBhgiWZ7npDOwGiExiIDNxyLuhHRiqNbCDl1sp+YActkVg9vIpp15bDksJ78coxyGoBM2tsEMBMc+mHjc03rm7vq24gzBU+WjKFyRFQULZNYFKZzN9JtF9syptTso4n3fnCG+EJSlFwm5WV6OrIMxMkTZGOOGVmp6bt+2ju2HPRo6xnxguaugSo9hX1he6zdeY5SLqe+q1yrrrlmYDvPoauY7sG/R6uXHeQRZ9mooI55e0cykBhQpykGTg+3io6Iy5kgNQYgAnaIymw8wT4oQ/VR/rdBDG2PkGsKoBn9jx7aZZWOrABqYDGuslYwQVZdAUAGfBUtRxI5LYU0dzNsGNX7F0X8z6Daw9V/MMCQObjI6wmhX2A839CYD4XV99dk80Yb1vI73KAVEMVXtp8zZs+wWWw1PJ7Jz8WF90Gq2PSikjLeE3m49hnRfvH21WNBUPd32stHOSy4mD0JkywqGorh9WVGQK3omHzYwFM11slsEn7zbLWwlwrylu2MahWic3IO7GyYllPgnx/GFOJddSBRtwacCAQCagCl6I9oy8kqMAbh7YMbQ4pCXoScTvTmJh3fAUbN9jX07JaB8T1n/9/ffDmuKPVVM+2gq+fLLTduMzV5EqlOyxf5w/sIM+WaZKpqKsFBdaFOjEocD2xplBMYR4kCNG/go3zP+izUJVFuk/m0v+/I1yIO8wcXaGTuFSZifmAr76XjjS2PYhvPwKwCrcJl4IA4zzdA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1335a67-13ee-4a69-e59a-08daa1c60014 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:55:00.4717 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qh7uPde3iKFIJPHTkY4hn1eVjzoYpQcmS59ooxbNn6ZfNn6/OalC3c8KgWxwbfVj+JUD893BzZ2/qBVqM6vrtDkD6Ul69DLeUcRbIA2mCU4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5872 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 suspectscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: IMsrQpLqNJmqaAuir76s25r1BcBZt0P8 X-Proofpoint-GUID: IMsrQpLqNJmqaAuir76s25r1BcBZt0P8 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This has read_capacity_10 have scsi-ml retry errors instead of driving them itself. Signed-off-by: Mike Christie --- drivers/scsi/sd.c | 60 +++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index e7c7992b7bf3..0b6beda2a039 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2409,41 +2409,41 @@ static int read_capacity_10(struct scsi_disk *sdkp, struct scsi_device *sdp, struct scsi_sense_hdr sshdr; int sense_valid = 0; int the_result; - int retries = 3, reset_retries = READ_CAPACITY_RETRIES_ON_RESET; sector_t lba; unsigned sector_size; + struct scsi_failure failures[] = { + { + .sense = UNIT_ATTENTION, + .asc = 0x29, + .ascq = 0, + /* Device reset might occur several times */ + .allowed = READ_CAPACITY_RETRIES_ON_RESET, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .result = SCMD_FAILURE_ANY, + .allowed = 3, + }, + {}, + }; - do { - cmd[0] = READ_CAPACITY; - memset(&cmd[1], 0, 9); - memset(buffer, 0, 8); - - the_result = scsi_exec_req(((struct scsi_exec_args) { - .sdev = sdp, - .cmd = cmd, - .data_dir = DMA_FROM_DEVICE, - .buf = buffer, - .buf_len = 8, - .sshdr = &sshdr, - .timeout = SD_TIMEOUT, - .retries = sdkp->max_retries })); - - if (media_not_present(sdkp, &sshdr)) - return -ENODEV; + cmd[0] = READ_CAPACITY; + memset(&cmd[1], 0, 9); + memset(buffer, 0, 8); - if (the_result > 0) { - sense_valid = scsi_sense_valid(&sshdr); - if (sense_valid && - sshdr.sense_key == UNIT_ATTENTION && - sshdr.asc == 0x29 && sshdr.ascq == 0x00) - /* Device reset might occur several times, - * give it one more chance */ - if (--reset_retries > 0) - continue; - } - retries--; + the_result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdp, + .cmd = cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = buffer, + .buf_len = 8, + .sshdr = &sshdr, + .timeout = SD_TIMEOUT, + .retries = sdkp->max_retries, + .failures = failures })); - } while (the_result && retries); + if (media_not_present(sdkp, &sshdr)) + return -ENODEV; if (the_result) { sd_print_result(sdkp, "Read Capacity(10) failed", the_result); From patchwork Thu Sep 29 02:54:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 610820 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1AC03C32771 for ; Thu, 29 Sep 2022 03:07:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232959AbiI2DHj (ORCPT ); Wed, 28 Sep 2022 23:07:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234151AbiI2DHb (ORCPT ); Wed, 28 Sep 2022 23:07:31 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB3C51257B6 for ; Wed, 28 Sep 2022 20:07:30 -0700 (PDT) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28SNiJbw023231; Thu, 29 Sep 2022 03:05:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=HZwk+uqr5JjRoOW/mBTKBGTe+n3k5sgsMwGLsngr8B8=; b=qO/s9zojS1+s7aGPoTNxa2jV9+LQ7A9z/diaKFC3EnFKXq/nqYvdw+4JtyVwfbkbgR6G LaWM3/mWcGiYP7A5RAWiUExWJsoJUZZIMHynlvl6RWhxI7TXwhJ6WzmGomIHu/Z0OIvF sYCvrxXCp/x5RtF/ZST842Hkcn9R7ml0GvkUDeCEYP2mBjzLm5QV6Z4WH2W2D973ENSi 0oswto0HxxLn9A4KIiSHeq+i+Cd84ujsJP5EbZoVsi6m9dW++rB9A/+qyiYNuJtC6qC1 0ZrqqSiwLJ7OB1Naxcuc6xZd+WOjTp8MUE6YD61JLUVqHt7h3ZeKsQGTbnjAFAAY0r8N KA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jsstpu394-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 03:05:48 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28SML3Vk033548; Thu, 29 Sep 2022 02:55:19 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2103.outbound.protection.outlook.com [104.47.58.103]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtpv22r08-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:55:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ggwXiTuxTWFVyYYAxI9Qz8ms6BFguKvEYYxAyxWL4wHT4pnS54EHjGAqQObMcz3SjXtjmygNFXrPa4PX33HSqAm1sWFY9LmgO6KZhATEwBDmw0/UMcQizjF90xye5ajB2dS6+EX76nwxVaIleM1x5PUbD8YixsP2aqjiMqSRPLWvzMSkeMhk7ItdAARIpqcztnU4+RcDsXUZbjo1jiKKZ+zzmZFOL0M48HpK1zXK+MBM4o/lhX9K0Csthk81ixDYGdclH/tRjB2LxOUoNF6fA5m93cyhRrq6lYOCJh8IV2r8ofqigqHyOeAhDV+Hwnkm1ETm4jaJFeRJC2iJt9lBhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HZwk+uqr5JjRoOW/mBTKBGTe+n3k5sgsMwGLsngr8B8=; b=fV09jvAwg3wn+RAIn+Y9ZgdbJyi/YAsvl7BWoxDUwYkdtKUUuMz6DDnbH9XtNvWG3vAnwS23k7JqGynRGRhsJ7jJ+9f6+SfUTkrNgBbQm7Hki9wJSHpi18ufyZUKWNytr09+0tl8MoJaMmTn7wwLJzy0IIr0gG+vfgepA+YbMu/c8b8gjs6ycQX0CSbQDifkp4idIp5qazQrvsqNoZK2yHLHEKwCSdU7P0jgzgIREProOXobJaVv3TIETwrFlGfZAwiaehemdauPQFyfJwj9TFFjaL0ZESCZXrnQvLtFI1WVcMN9hEODqDggsZag6m/5eUGgJcgE+awychy3EiqLcA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HZwk+uqr5JjRoOW/mBTKBGTe+n3k5sgsMwGLsngr8B8=; b=fWe8FYsYd22EesLEqMAo19fQW0u3gwKWdxoHY7/vDnwmWzT/A/cbjNcqLKYxDpH8xSeYoKVwTWco8boyWILeB1BaCO2XjJfhN/FwX/SP8BnS5Dl2lwO8TVRCm+CKHUVvcIFXUl8kbejK6uW90BcjbOFwnVMVYKCk+wIOaeknCik= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB5872.namprd10.prod.outlook.com (2603:10b6:510:146::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Thu, 29 Sep 2022 02:55:02 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:55:02 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 33/35] scsi: ses: Have scsi-ml retry scsi_exec_req errors Date: Wed, 28 Sep 2022 21:54:05 -0500 Message-Id: <20220929025407.119804-34-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR19CA0002.namprd19.prod.outlook.com (2603:10b6:610:4d::12) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH0PR10MB5872:EE_ X-MS-Office365-Filtering-Correlation-Id: df6cafd5-6876-4a35-33ee-08daa1c6010f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NzjBA9kx5FRwlGLP9AByFNofSl/pgVrWnuV1CwPyKKrjESAD9FDHscmesyNydlANx7WFGjZSDyCqze692W/uTxrOwn3qPcv17D25oz1jBLAIVeVSA82+F8e93PHza3GZhbAWGsID7Zl5uY6yBsL8Uqf/QzR5ERfFwglLHYuEe+qqEeS02LScwjw3TljyGP1GBCY31V9+ElWR+zcLlXSj5gy44lhVTEFL/J2j4Nvr2X93CiZjvMzJNG+ly3yzoRBPxjUHdOFih9SHWZGZysBJSw67LZu2Bnx1BoRCFRjR5cngIZE/8smuY8sVbxJIAeTWWdZtWdr9qCrOVNQvN1DNbq+XAIhq3UUQlIT9l8DbqVZdHLhO36bsoy8ClQ62KZTnkQOS8DnyX7hD5jLmstgTo2mwEg6WrXFkth7GFTklva/EZ1TDEWaH5oqOCN64DabG2/XVP2enGoyGbvHjiH+fgTRLU4RFNzkgnPCaJKVamkLlPpNMuXON2t+LOb2+As7nTpXNXAsI0Z3OmqmLECLP66PZwtqLqGkuvBS8eif4+xjDScyFQsgYpqdOi+QRgFvl7C5khh2jpck+Z3tiZhxvS4IOnhmFoAReDmuh+i5mnxP6It1fDsiocDb6EiDbSlzCOUowm7QnPrpdjpTYSzbI+m46sL6opnOeTRk5FSv/d0xcGc+NvfdNauSJzZ1I4VV6T7YJCNelH5W3cSp1w3XQ6w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(39860400002)(366004)(396003)(376002)(346002)(451199015)(2906002)(41300700001)(83380400001)(66946007)(6506007)(107886003)(6512007)(478600001)(8936002)(36756003)(6486002)(38100700002)(26005)(186003)(1076003)(86362001)(4326008)(2616005)(66476007)(316002)(8676002)(5660300002)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PvWE1q469hLMkLxrEHEu5AZKbuqwO3hCx65MCot1xeSk52z1BSqpD9uBdL7ygf7XH869MFOnU1Ng8cjS0vL6VN/yBlJVZlNudIAk4DTOrQl71ItMYaZ6V6zrdMYjD1HhkgahqBY9+cU7CflONK/Z93q4ldW+9N2rR9c2j27Rv64I6JUEA358jfOdXUvFrJjqZ8kzWT+IkXIkmr9VYc7aMoqsJJ8/xgN9mERsftlwUJKz1esxWU/7jXDfI4zeysGy/DGDDTLNvQEdk7XcbONzsiGU7s2pM3IvYk2vIMMsMeVFWiv0Qx5xvRz53oaosrEJUHbdl109/6iCpXx+SeYORZErOLMQxHwIVtnQWAZG0Uo3SHhpnccVYkMkYoAqaZBD4i4YeQXNmwJkMnCbujl4+HHyI6E0Hn/dr6jR2+0sEyGmQm7ddlw6pn6dnONjTdZSfpbQ/JOy9qiBlLpVLU6Pz0TJE/GE5xtJQ55mrT3cOMzykrujz3JsB00GP/52wVZy9iQQsjiVpLTIlhm53xZtHxbpj37hpLAq0ImiQHj22TuhSEPg9gyMF4BSU7x/1KgOSYkZ2UjNM4NHRGBCsadIofjB9Z00UB05HPnVmjlxLDYRYUPH5gKil5HJcf/8RXjyl3g4HH/CS4nB7dWf88Xslz92CFFVEeKQ8IeF9TvAawiqglEAJ/9W24gSrhi/C64J2T/R9gTNcz4hbuh7d/CxJYqabBmw6NswW2LqVpUC1Q+k6gcl9EvTkDEWAkvMzK5p6kosfpX5Wql1Yakune35FCqOxM0enAXuhJ2rXCWqT4Xp2jMV6g61HfjLgSjWy0oZgRpnUJDce35dS23wzh5NHjXzizYAVsnXHXu5XeL0tYAF07E78KgW34eXTQOID+M2zEzrVB81vb3BfkyyGQcPs6W93R+aHfgupFXL2Z0mTphY6sdxSjfbeS5L9Imo6YeAG50pVMMfrN8qO4AeH+Rbhjld3R473piE0gPa0GGnTQMzX4HdvJT1G2aAaxVs+IgHaY6+yU28XFA7+UCZEWbdz5ZQFYI/u/A4G+JLMXSMBZI0d1BFpyEGL17a0ayvTTZOP1NVf9UZyZxe0cr3zhjkAQRtXAzugIkOPW+ZJC4b6Je5CUM55s6xxReYO8pWrsnJLp5LbipX3Lt7vXiLyG2Ds+hLfHeJWgkulE3pJpqr+o9YuhguJu31PHzBfr1F/QpQK57w7KcfOZXh3lidYbQKL4czH2CjI21qhVfd67JMeFdnrSpNtImVxavyCd0y8z+F1TlSMymm4rsBUbhkwBhoPhIGxil+Z3O53Fe8jpMIxJdT4LLg7Nhy54RLZAfhK28ryfKxk7mE+l7dxzeZAfEr648Sl1qagAjzzSEJCNRemZpTtM1xzwhKnD8cjr4klSPzXXulTH17wU36nS5siYSZeVGaRzmKRKUnwpzX6sLdyISpkfv5ze8H5+GEDR3DyJSjhHdraAOZJheJF17cspVtvGMX+BAvW5LDdjLTwVF+wxh88zqbLsFdAykiR+Ae2zSzskA/4GFr/yQ9mhGcA4xEQ+brFb484dRoRyJMlt8Ldj3ocv6RE9Nr7z/VcJu2vT6lVVI/blNYiHhDNfA8srUoLQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: df6cafd5-6876-4a35-33ee-08daa1c6010f X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:55:02.0654 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 83v80bHLSHj0PuQU1FPie4zFYx5WDao7W/z3oNRDpTypNTjYvJEeysqujX5FCiGvkGzYr/btDptd/iHVaaHB43ExMYvb6zwTTifbWskoVnY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5872 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-ORIG-GUID: 1eYTPHECECFurpN38Rwp0kcmk-5Ed29Q X-Proofpoint-GUID: 1eYTPHECECFurpN38Rwp0kcmk-5Ed29Q Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This has ses have scsi-ml retry scsi_exec_req errors instead of driving them itself. Signed-off-by: Mike Christie --- drivers/scsi/ses.c | 84 ++++++++++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 32 deletions(-) diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c index c90722aa552c..d8b31c0b0125 100644 --- a/drivers/scsi/ses.c +++ b/drivers/scsi/ses.c @@ -87,23 +87,33 @@ static int ses_recv_diag(struct scsi_device *sdev, int page_code, 0 }; unsigned char recv_page_code; - unsigned int retries = SES_RETRIES; - struct scsi_sense_hdr sshdr; - - do { - ret = scsi_exec_req(((struct scsi_exec_args) { - .sdev = sdev, - .cmd = cmd, - .data_dir = DMA_FROM_DEVICE, - .buf = buf, - .buf_len = bufflen, - .sshdr = &sshdr, - .timeout = SES_TIMEOUT, - .retries = 1 })); - } while (ret > 0 && --retries && scsi_sense_valid(&sshdr) && - (sshdr.sense_key == NOT_READY || - (sshdr.sense_key == UNIT_ATTENTION && sshdr.asc == 0x29))); + struct scsi_failure failures[] = { + { + .sense = UNIT_ATTENTION, + .asc = 0x29, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = SES_RETRIES, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = NOT_READY, + .asc = SCMD_FAILURE_ASC_ANY, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = SES_RETRIES, + .result = SAM_STAT_CHECK_CONDITION, + }, + {}, + }; + ret = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = buf, + .buf_len = bufflen, + .timeout = SES_TIMEOUT, + .retries = 1, + .failures = failures })); if (unlikely(ret)) return ret; @@ -135,23 +145,33 @@ static int ses_send_diag(struct scsi_device *sdev, int page_code, bufflen & 0xff, 0 }; - struct scsi_sense_hdr sshdr; - unsigned int retries = SES_RETRIES; - - do { - result = scsi_exec_req(((struct scsi_exec_args) { - .sdev = sdev, - .cmd = cmd, - .data_dir = DMA_TO_DEVICE, - .buf = buf, - .buf_len = bufflen, - .sshdr = &sshdr, - .timeout = SES_TIMEOUT, - .retries = 1 })); - } while (result > 0 && --retries && scsi_sense_valid(&sshdr) && - (sshdr.sense_key == NOT_READY || - (sshdr.sense_key == UNIT_ATTENTION && sshdr.asc == 0x29))); + struct scsi_failure failures[] = { + { + .sense = UNIT_ATTENTION, + .asc = 0x29, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = SES_RETRIES, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = NOT_READY, + .asc = SCMD_FAILURE_ASC_ANY, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = SES_RETRIES, + .result = SAM_STAT_CHECK_CONDITION, + }, + {}, + }; + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = DMA_TO_DEVICE, + .buf = buf, + .buf_len = bufflen, + .timeout = SES_TIMEOUT, + .retries = 1, + .failures = failures })); if (result) sdev_printk(KERN_ERR, sdev, "SEND DIAGNOSTIC result: %8x\n", result); From patchwork Thu Sep 29 02:54:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612189 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D20BFC54EE9 for ; Thu, 29 Sep 2022 02:57:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230015AbiI2C5j (ORCPT ); Wed, 28 Sep 2022 22:57:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234875AbiI2C50 (ORCPT ); Wed, 28 Sep 2022 22:57:26 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA09F125798 for ; Wed, 28 Sep 2022 19:57:20 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28T1TT90018659; Thu, 29 Sep 2022 02:55:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=+e9bJFssgi6lrawWAgSMW4DaCjba/rx08W5jLa+YOMg=; b=Pcb9p8PcdWynPPY9Lk4n0gSmobMVuPlFSpmt9lYCdLYYU05gnDMvEf3FZq5E7X+IGcA4 YgwIUQRFKylDnytfpm1pZsg3q/xxNCL677C2eyuTYFcsbpnM4xDPjWDE/B/wRHRMn/Na rcx+iWmoE09/BIdZpl5C2MwgKYQTjj+sRylSaqbRUTGbRIN+ELfLCRbnFdB5olStmE1e rDKXhpLohUjWGmEmw/QICPz8YFiBwAR+/4qajTs+4L53cu6GrY+xMyUa42Hob74Jmggw eT+AlPk+dD243aisl8tPMGfU/4vA1XxLw3aLkczAbKNxMTQQQXT4GQNR4hMkjDaMVBnC 7A== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jstet3uew-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:55:07 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28T2kQji002299; Thu, 29 Sep 2022 02:55:06 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2103.outbound.protection.outlook.com [104.47.55.103]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jtps6v7q5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:55:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ANtVhZwmoAc3CVbVmbdw1STPb4vQOYrq8P0zPnhNPXaCbWb3y6MUUpgzUwzWfDZIoCvoZ5+W+y19LmeHCVNVAhtJWTpBunfAs7Ji9zCflO48WiG0VomJCpLLaJ5yM5Z2nOFeI05JsB2PrPo/58EXCsKFzem2uAVDcerXvdIwo0Qx4iLpLqGdUdu/QuxEX8Aq8AgxSG61t4igC8FaJLRTY+BP2OhySW/O4RKvVY4E3eiZA4MRCcHOTUeVkKDizAeVtJIu4Q8EfQ33oupHtZ+hymfYmQAMFSWMTHqc1UqYKPGi2vUlWbju6tXZsg0ifs6l4cAyZNM6rdWJ2uJpaL9wOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+e9bJFssgi6lrawWAgSMW4DaCjba/rx08W5jLa+YOMg=; b=UMSw0IymzFujbbq7QA+Yvp6/jJWaPz992/QIqQHI+dxQbM+lDGB7+w/3S0nfK1HPIC/s557v5Sw97DrnJ1QRjhbYDCK1x1FVQG6MWfnSo3uNnxgacai4XAutArtisuelWlGyUrVIkR3cp2DEd+nh9Y/KqeaKNi5AYOJdlzWJYWmbcFeitBst873F6rdkjRQbFmQCkDSzkgC3PEJ0lmAgs+/IgvUQ+OQ3qpLFQzUZKc/4NPhG2AatJr3fPdaLzp+H0nH84AbzPKjBk22y+XCLlI4gHiWBHqsEeBYUOcDuQTLxkaTmQk8UDfE4SE7h0H3L3+RXg3K2804KQUP34MR1rA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+e9bJFssgi6lrawWAgSMW4DaCjba/rx08W5jLa+YOMg=; b=arU/pY5fHVZR9lh/5hSRonnQHWGeQFPi/9OGH+kH6SBuIBEiuy4dXKh7bn8r2izxRPjNobVci54hKo/5pBizhYznbAYmo9sm2fgtoioArXYqNWyjAGc2EXYucUi+YXlrduoDFLVelfAj0GicW2R33fHMArex1YfXWE1h9zk7ffY= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DM6PR10MB4346.namprd10.prod.outlook.com (2603:10b6:5:223::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Thu, 29 Sep 2022 02:55:03 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:55:03 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 34/35] scsi: sr: Have scsi-ml retry get_sectorsize errors Date: Wed, 28 Sep 2022 21:54:06 -0500 Message-Id: <20220929025407.119804-35-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR18CA0019.namprd18.prod.outlook.com (2603:10b6:610:4f::29) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DM6PR10MB4346:EE_ X-MS-Office365-Filtering-Correlation-Id: bbf8b5cf-ba7f-41f9-e75a-08daa1c6020b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KtM9DJXUUb9Vijdr3U67PRqD/y289veQ+5Br8LvHTsBK6Rbh83Pedh1qFoA68bdKdkqqSU5bk/nm0FlZQgBlKQz8cebljqBWd8+bPugN34iv+F/SW9xfsP2Tz7FDErwy0kgMoJbxtmTvdwi5RUkgQHm0IJcjNpVUv5Yp2bu6CScLqF0hligfWzxLjIXsmjry5tfCtuAi1xJOyOHTXYO7cxEA9FS/XSvl1QBuIUfuhg8s5lPbCUVh4ASeDOxJHWZuGKgjzBePeQxkAV6iGomsOPAzdPNnpaLbj8GepOrQwLaOWG9Z+JAQqPdGKRCIHA9OyTsD1YngSj+y523M7Dxrzu0YE5Jq+1o791cmFEIPcNvEgWcme6mLHca5+e+LPCMFXWB9X+q9yQ2Wxy7jmgeWz/ixmvo07pFvgoWgMDoIBFhPn6mAK3uCntWaSD+8vEfCwaXj1aSt9NB5dU8Rd7BjLhXaBdHFdT4DgDDNi8mOHQUAWvva8aiUXkOSGT2grOV3o+3vWjzttgDqHADLjw2heVVAcFkd3SETLDL2FpBvZgPskaCnu7us0TWutF3x3DtwKPrTZvV/DPLFnPxjSzEdffy6zUm3P+0VzULVegrelGbuJLqrmDctKPtj8IiutNUnvbt48hwaZAGI3gh3TkKUlrY9YcS9aFLHQaXZ8RtteLZTV1LnjCvbyVxFsNyqzj3qqs0VIkkr/1AbzH5XvGREww== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(376002)(39860400002)(396003)(346002)(451199015)(6486002)(41300700001)(2616005)(186003)(83380400001)(36756003)(1076003)(38100700002)(86362001)(66946007)(107886003)(8676002)(478600001)(6512007)(6506007)(316002)(26005)(8936002)(66476007)(66556008)(5660300002)(4326008)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Wmwa1VylW6cOJRNQB0eNVh6Z1XT2bvpdsknG5m4y/ZEKc6MscffxeQ8glRrxyfjqK9d8J78XCUSy4sK0mFVaZP7uGIvcpdnRBJxqyDDT9bKrL39JwfX+DhL+CfRLWKshLMEiV1atKj0/5WgDrusyGjEUPsoO5sTSk/rqA5q/xbbzrGDCD92Y2zX8irqyuRDBkd6Kq2p17pe0XlF9QBiSG27h4pm1b0WTSNVB9zivfvdFDE6QnUbZ7aMPbdecOG098qr2bw0kSmaG2EdqLnWyQxCd+bB1oC9ixAVK8kMWUbS+ORD6gPQs1Be/9DM3ocbna/mFNc7cxK7K+Tm/4tX2rcGnaVWJ007mrq6NmoXnaC6xj2W9oMZeUDkF1qELOx7Wuc9RB27TMSBcWn/yoWZ+Pr0/g0qW+CranTrFpSX3XlDaPFRmzxXeD7bDZ+f/Ba/HqiM9GQZq/Am6xXLLP/J7sCNIr7/Ie55HHhHENQXKfTYPQpPkfg5EuFpvoLmsK+JILOnBn7lZYMMy5ugLkC/lEaTLD/SScA0WZBfdxgIozGn1LUAQMtZLLIPdaUFaP5GHTgTMr0zkdmbN9hN+eBgBd4GMk/sh6oJCARtwcuvXJxIyLTFYPckJwzwDIBeUfzke5n6ugi+i7gQqmYuLwrl1F9TK8Cw/lKdB0B+K6jh4ACeXUJuq8yRkToT6MrKd0s1oBn3zyhjqZqYNlfd5FjmDdEjVusBMBMeTuEEsjqb3B17rDUnShB9F86QuZSp9viweKtOLWzKv90j5s2WYs8OSxHMUvPhJ//fG2Eq1Q1jMR5vjqyRKf/aX8FSvizvsTrfR8Tu87ZCZRRcXszwpGT68il1veXOmByh4IWqWo2T7rL+eO3IcMjWMZ6guVVhh2o+SxxYAOaapF89hBKnLS/gL8mhG5cu4SdtxBLN68Q/sTh9NJM7HClDLOGMuTx7MZ2p2qOMR/5zYDHQJYIuL4tKhHt3q/Agfq1rZtsZxOBjkQ5ibGqVlDfDIDma4yzee020icCkPQauyJdJBihhKwn9pC0zvzjsXqpkic+Pc6fbubYaF4NTfLiWI6t6DNB5p6N4h8bbcr1hLyl8LZsj3pxcf4FVGFZc+wXaJvm9SI2yYLD7/Y+7sI+1CjFQRd6yat/9YfuBlwHFxHCmBMNDvGIuTBaOSyMpNoy1eZboDsErWX9+Yj1R8l3YouoZazxHbnVgk141APELatVEKrQk9ljdXnw+aXlVn6oQngw+jCaRY8PyY6TGHOqrjJZtKF+qHUixFU2vLJoYt3aeHRRhj4W+pzQw0PYiWB6ujsLk0WA46HbUVklZdzkDT/3bspNieiR+f3xMYzyw6QHolX9iUmaaAFSa/dplFEctvKd3zgKZnMZRbWDf6EM1RAzPcGqvsbIMYyxpwqitM+DStZ6m/zHv2L25zEdhkJ3YzUlM2eYkoqbqn3TL4x3P2SCO2/9ROkcjh4sX7ccSWsedbWGSa6bK0USgedasuqv4KC1KozaMrPAWIPwMeaBQNhmtUY0332f9v6gZYLvtgZdCs0+UmJcpyVWUQg7udfLNQZaMmLARYDTAxQaV/P0SU6YESv0gUliYUAZj00Nw9HlcdlCDiCzZ11w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: bbf8b5cf-ba7f-41f9-e75a-08daa1c6020b X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:55:03.7215 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oG1SXrZJjyMfLRM4L2tKeKhe0tPXyXmzRRREwA5CniMglKVKog8ULjOfvDcu45P+GDLHsZeNawXgN8J/sk8RobRaQAAhARBNEyz6p1Hx6Wo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4346 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 suspectscore=0 adultscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-GUID: 9vWZKhg68kWI47neroAbHu3k3bxUfJXn X-Proofpoint-ORIG-GUID: 9vWZKhg68kWI47neroAbHu3k3bxUfJXn Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This has get_sectorsize have scsi-ml retry errors instead of driving them itself. Signed-off-by: Mike Christie --- drivers/scsi/sr.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index e3171f040fe1..8e21ad83e938 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -727,30 +727,31 @@ static void get_sectorsize(struct scsi_cd *cd) { unsigned char cmd[10]; unsigned char buffer[8]; - int the_result, retries = 3; + int the_result; int sector_size; struct request_queue *queue; + struct scsi_failure failures[] = { + { + .result = SCMD_FAILURE_ANY, + .allowed = 3, + }, + {}, + }; - do { - cmd[0] = READ_CAPACITY; - memset((void *) &cmd[1], 0, 9); - memset(buffer, 0, sizeof(buffer)); - - /* Do the command and wait.. */ - the_result = scsi_exec_req(((struct scsi_exec_args) { - .sdev = cd->device, - .cmd = cmd, - .data_dir = DMA_FROM_DEVICE, - .buf = buffer, - .buf_len = sizeof(buffer), - .timeout = SR_TIMEOUT, - .retries = MAX_RETRIES })); - - retries--; - - } while (the_result && retries); - + cmd[0] = READ_CAPACITY; + memset((void *) &cmd[1], 0, 9); + memset(buffer, 0, sizeof(buffer)); + /* Do the command and wait.. */ + the_result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = cd->device, + .cmd = cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = buffer, + .buf_len = sizeof(buffer), + .timeout = SR_TIMEOUT, + .retries = MAX_RETRIES, + .failures = failures })); if (the_result) { cd->capacity = 0x1fffff; sector_size = 2048; /* A guess, just in case */ From patchwork Thu Sep 29 02:54:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 610819 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03A06C32771 for ; Thu, 29 Sep 2022 03:09:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234844AbiI2DJA (ORCPT ); Wed, 28 Sep 2022 23:09:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234851AbiI2DIz (ORCPT ); Wed, 28 Sep 2022 23:08:55 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C293126458 for ; Wed, 28 Sep 2022 20:08:53 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28T1PvsP032602; Thu, 29 Sep 2022 03:08:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=uTH/yBfi2dN2Gzmf4fEr9WdYA89sSvyAUe6ES5Siqe0=; b=Y0xoQ9d5WUIkhaDDGQd33Nq7TBI0WZRfVRCieqoQ9PKBHExBhbZGaWV9ofqznN7e+OPh eQ9VAu4+rEzsw/0x6IM53KBb9X+soVzcFpf0cN4I32a89XEGFcevRPsNOhA6CA+5Vg/V eIhGXBvDyYewMlst/IeRnq2xPL1soMmrzP69RwS/UXPX2lqA8dOSBmOQCllIFZubNprS pd1GiC5CwXqASgvf3a/8AMnatN9Woxu8dt2KPfrejiD++Q9OJgpKYhwhyMxgng0I5uou zqlv7youtS+m3V2w1ArpgjemgWeNEZvAQr02aSbbj1FQ2ow0gg7mAQvco8KmXmW/Ibib 7Q== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jssubkj1v-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 03:08:43 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 28SML3Vl033548; Thu, 29 Sep 2022 02:55:19 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2103.outbound.protection.outlook.com [104.47.58.103]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jtpv22r08-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Sep 2022 02:55:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D0SbYKplMzHLjRYuAm4oJGlc5UwiAPzptL+h4mOVWhsCSM9dpLum0tVlXxX2iVDTy1KL57UAsC4IBlUgaFLACATsRBj8oGX1qmtJ93e43NkNJvqR1elcXUtijM30fuka+zTNAmFJNESUlaUNtSlplq59cT2ywxUTPEPGML/KW0B+dPXupDfpZDANiE0lZvx2SdOSfk3LhjaPEGI5FkqMGrAjMpHj+yt2uLAT6N+1+HqYzEwNOj99VtQmOEukX7FZHRxRMeJyDAy8bsrmqHegqhXWlt8CHgJagZBVmEJUfyV+qwn+DDEqzn4TXHEX538Xem5ms2pNE+dV4t86zgE24Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uTH/yBfi2dN2Gzmf4fEr9WdYA89sSvyAUe6ES5Siqe0=; b=Cn2w1OOVezMnDTWJp8pMN6EOfbL1mqFaY2o5YNo97/CZT41X8RvXYgIJ2Yq5QAsQPGSVG8BaoHyKefCjpaozWTDYv7jo3GJbIlIdPb7NaUP04+3J1Q/9XNNIADa1sTqYdO7Y+m7lmMJuOUS3+TIQI0eeBOd5Ln8cHqBAatVE/murHOlOPfcoAH5Pdd6/77u51mK8uBiA6Kl4WWvxIUhQP7fSBy+suHQW/755yImHs6Z9GBuBhODy5bOnFFgj6aEi8vw7fdjL5u9YH180kAyCeXzIIonEXUkkg0JjoWX8sW0ovFoh2N/JlrXnYwLUSoDnYt8sWeJclVnFexVdjodGjQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uTH/yBfi2dN2Gzmf4fEr9WdYA89sSvyAUe6ES5Siqe0=; b=EtL4mvD7SOr6WDskjglvo44GY9vC6KOx4GDmoo8O0+F93DIXVAaIXtbVh4qhyq5bkpNhd4kyQcrMSecJ75i7u0Z0nFlHRIUMVQX6pUpyNxlzks/Ukrv8u6S8H5HT9gLYnMV4yyV7nnRbsfqF/flboJzI4vn4zdt8gIM68BRB7Xk= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB5872.namprd10.prod.outlook.com (2603:10b6:510:146::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Thu, 29 Sep 2022 02:55:05 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%8]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 02:55:05 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 35/35] scsi: cxlflash: Have scsi-ml retry read_cap16 errors Date: Wed, 28 Sep 2022 21:54:07 -0500 Message-Id: <20220929025407.119804-36-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220929025407.119804-1-michael.christie@oracle.com> References: <20220929025407.119804-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR19CA0010.namprd19.prod.outlook.com (2603:10b6:610:4d::20) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH0PR10MB5872:EE_ X-MS-Office365-Filtering-Correlation-Id: 15a7791e-e8d7-4814-8a87-08daa1c602d6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CAYzdyS1gDE+Kp/rP9LDJKWi4CFpYBdTzZEsE3Ia/gF9Eowu2hJbVuZjQ1IB7jaO2gOqcA5AmkHBAL7+1dHHWhZxsJDTImJ4JEHUrn4JRBlrfYz72SeAhqSv50smIJFp873OtTfUMFYwxDtDWFlN6ME8h6gf2cml+h5SOBSX8Sa3V8OTQ60Tfvw35s66uWJyc450nr/grOIJS08FPSTjW5j0nIXikc/BaWATPMRHaLP/pMQbpiiOOQTaMQxruUHMaENySlD9TnbbgMCmjlK0lLcP+InXiCSkvAzxsxKNs854sMFS4nBf4Vs1Ld51TUYCJaDC+5P5MHBVZBmNRMZVRUW2eZGOrmvUmTrzdnTZme+FhDZJLmjZ+vRnQnGK+Ct2Djt7NHnu/OuQwpFfsHTt79zrc+S7TK6fJ8V9/bxcb8o3jNzPDPMNf0cEtgY+6TbJ+l9GgAjmJhgcCgIFk3vwCuKHoPeGyKcEHJ2js2vpKXhVUlv64VRuZmKTqItAk/FCWax4aI0+ilcwUulddaGuPe+i+Xnhpl5B2IvvQXagujHDKqUxhQcoep6z8Uo1w/PCaJgqyFZJXqhhrbn668mZU3XP4c9kc6Qbp10F0y5LxJawEp+/KHWSBjIt2OxJMMJGIJJDAsHAJdJFJNLOZ+AC436DVfFhd05GAyfYaMFL2OXwKtgVaa7cyKgDOy1Gt1n472NmfcZ3cfzUIhAZAIXT9Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(39860400002)(366004)(396003)(376002)(346002)(451199015)(2906002)(41300700001)(83380400001)(66946007)(6506007)(107886003)(6512007)(478600001)(8936002)(36756003)(6486002)(38100700002)(26005)(186003)(1076003)(86362001)(4326008)(2616005)(66476007)(316002)(8676002)(5660300002)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wAb0kdH3mKdT5qkj6vW9bg4x10FzBSfdU+r5dKKWqGf3f1tgw46cUk4uoLasF9LsMlad+XpO/FpjKrSNex3LO9CUwi3A1eOvbPUdi6ijnw5hxURPjLllpiqKiGIbMAiQjbkadj/+zlglhYI0rgX11wvs7wykBNmXKRMvQbrk6I8aBZhqOMP2TL5agTOFSo++eWTxnw26qgk8XW/T9BLRHtbt5rl/SkqQrwtPVsuocTuJJqKNMmc3eJkV3tfX/YstcKdhG9Fmtjpwg2/GYuWR349Intzaq0uoOR3YQjAjy6nd4DwWN6rrW20Bs3QxBaPSSd95uXXU5/dkFJJgSBwezHJTsG4N9AqTAPsh5jvtxDHfdj+aPkQpePKXRV2WdZjMaZsQI4kc24sKfWccsm/k3OWwtjI2sgAtec8smEaourvrC9a001cvg14oRgRQlket8D2T6vnfmyK453nVDSGP7LpvNKpwM3X53yeXR8gVXyxb2TSp1hTtyqC9hNjLyT/yc03LTKj+o8cWtzVG6Bu9KwQqoGwfsfT9wgzuXcmlDrRMg/v9oTqmZovcfi90E2PFzWKx6TqZaOeC4bjoNk4dcafkZL0BpyFBzVkf2FNTQHLqUxVTZeZXsFyA9ZL0dOqKK4LuAzmolnFhqaAlHlK35AIx3VKXm9b99W+xV5qE6Ffi7WHxcjDEgqSVLjwfGZUMUik3RkrE1Xs2WDyEj3YQSFj7sMwSr8zgErodtZu0Dc030WcuPxvSN2GH4xX2UbuJoRqrvmNZPnE29QGHVGrKVax/cZeBeb3tELarlITGcfR5ZnWcx/+fp6NNctfxTVNAv/XSaxIhOfPWL+DUItCsqWgDr4i1Vl4V+TBHjtOn+Mdt5StjaMaCALLFvygZRDFI7/fOb9cS1Rm+vIVXydmn6hJPNKaFeIRTXd/Wv7uv0rVqfnDtLt7N0Wz491P9HSPixfd95VnAKIrEhYa9cKB4KB2mA2uzfr8hfZh95BW3BK5O0l9GttapxemRT91G15rf77R+0oaLxz9eNNw0D+5AmL/k4canh78rsmlyxIvIeDBE/mje76abWkpLS4Yf+BrFFBgKRAmAYRXMSPpCDWKP9PmwoCabB9v57ulJQT7Pp3QdpDZnAIDCYSnDv6C+xCzy/j/PdutSrgmyg/pNXOltgEMDBiNCwTxFYzjCFGgN0O6kZwLo00O4FUiNhKEw67jdvqJB9M3Shwkqzp7vV3eWP4TDuMH/25KRp3a+rubJWY9FSITk1evoxjL1GtffKOO3cYYZQJjIsG7tbaWRBK4XHF0Nbk1/ryP3HuOK7lqXax+Y+SsXP1zWqar00cQkn41Fd4A1KhkOHTY12YC/DIemRsHmdH5YjRzGd4vcBoT+eD5TkHf9QspB82IoIhj1WkEb++X29eRV7ZmFoow8qgvwpzEpIiuH2IGVbyybE7CnjY3EIapgbJEGLgTFHu7RdFPCEclJUYwCY2uQh+LIp/tfXEp/aUbjNYhFcYWCCOAOEWOAwGeI6j+sg/fdhAbagXPArcXEO7YhxrCzvUhm8/VlqTccJ0sis3D0mPLKdjejOCPnXRmPcm6XhszNNE8frqDNBaz898+XWN4dOPrAy55TsA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15a7791e-e8d7-4814-8a87-08daa1c602d6 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 02:55:05.0963 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8dkHUCfKLt39PPWKxfhr2j9r1zNcKFC2j82WFo/J5fB1ux+jnaWreOJZ6q8ftb/tl+BIcBVfVsHFBMAIZQYN+9Zn35MzLkP0/74z34jqmfs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5872 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-29_02,2022-09-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209290017 X-Proofpoint-GUID: jtDFYgNLbRY7cbWE-A0XcN4ySdQ8qi4H X-Proofpoint-ORIG-GUID: jtDFYgNLbRY7cbWE-A0XcN4ySdQ8qi4H Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This has read_cap16 have scsi-ml retry errors instead of driving them itself. Signed-off-by: Mike Christie --- drivers/scsi/cxlflash/superpipe.c | 46 ++++++++++++++++++------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c index 724e52f0b58c..8627c825d031 100644 --- a/drivers/scsi/cxlflash/superpipe.c +++ b/drivers/scsi/cxlflash/superpipe.c @@ -337,10 +337,32 @@ static int read_cap16(struct scsi_device *sdev, struct llun_info *lli) u8 *scsi_cmd = NULL; int rc = 0; int result = 0; - int retry_cnt = 0; u32 to = CMD_TIMEOUT * HZ; + struct scsi_failure failures[] = { + { + .sense = UNIT_ATTENTION, + .asc = 0x29, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = 1, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = UNIT_ATTENTION, + .asc = 0x2A, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = 1, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = UNIT_ATTENTION, + .asc = 0x3F, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = 1, + .result = SAM_STAT_CHECK_CONDITION, + }, + {}, + }; -retry: cmd_buf = kzalloc(CMD_BUFSIZE, GFP_KERNEL); scsi_cmd = kzalloc(MAX_COMMAND_SIZE, GFP_KERNEL); if (unlikely(!cmd_buf || !scsi_cmd)) { @@ -352,8 +374,7 @@ static int read_cap16(struct scsi_device *sdev, struct llun_info *lli) scsi_cmd[1] = SAI_READ_CAPACITY_16; /* service action */ put_unaligned_be32(CMD_BUFSIZE, &scsi_cmd[10]); - dev_dbg(dev, "%s: %ssending cmd(%02x)\n", __func__, - retry_cnt ? "re" : "", scsi_cmd[0]); + dev_dbg(dev, "%s: sending cmd(%02x)\n", __func__, scsi_cmd[0]); /* Drop the ioctl read semahpore across lengthy call */ up_read(&cfg->ioctl_rwsem); @@ -365,7 +386,8 @@ static int read_cap16(struct scsi_device *sdev, struct llun_info *lli) .buf_len = CMD_BUFSIZE, .sshdr = &sshdr, .timeout = to, - .retries = CMD_RETRIES })); + .retries = CMD_RETRIES, + .failures = failures })); down_read(&cfg->ioctl_rwsem); rc = check_state(cfg); if (rc) { @@ -383,20 +405,6 @@ static int read_cap16(struct scsi_device *sdev, struct llun_info *lli) case NOT_READY: result &= ~SAM_STAT_CHECK_CONDITION; break; - case UNIT_ATTENTION: - switch (sshdr.asc) { - case 0x29: /* Power on Reset or Device Reset */ - fallthrough; - case 0x2A: /* Device capacity changed */ - case 0x3F: /* Report LUNs changed */ - /* Retry the command once more */ - if (retry_cnt++ < 1) { - kfree(cmd_buf); - kfree(scsi_cmd); - goto retry; - } - } - break; default: break; }