From patchwork Sun Oct 23 03:03:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 618725 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 B04F5C433FE for ; Sun, 23 Oct 2022 03:04:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229976AbiJWDEl (ORCPT ); Sat, 22 Oct 2022 23:04:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229756AbiJWDEb (ORCPT ); Sat, 22 Oct 2022 23:04:31 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BA9B2669 for ; Sat, 22 Oct 2022 20:04:24 -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 29N2ssKw014061; Sun, 23 Oct 2022 03:04:16 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=YjrAn5VLPkT2+p7vbcDBYRL77YeE9wnvFdg3nj8EpRU=; b=yjXbSCDrN4VAMHI2tHZErLNMFfHFnUKFMHRROo6RftDdOfT9GLBAOG6TZBQm3yjO5AVL 2aOrrZX3bb9j2pXhP5G0LAjS8ceXZISUqxCzZ5s5+nvGj+VLqKD/poYrx9KJB1KJz+cz v4+xIDyT/7YxjMyGS2fSU0bjmiSLKxvnuEOf9NI+ca6mwj/F4f88GQoiPQjtm/VDvNLJ TiPwFZTwF6hbsBhVj++w7/h0+BVliYP7Ir3jFZbPyzR2HVjuNGWshxa5IVvbwQipoaba mWaDTjMXKM+jKtM3T69tGOOIK8f5XBPVtEhff3/G4eYxYZ7OOs7wYAmU/1JSQCN3I4fo AA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc7a2s4pp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:16 +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 29MJ548h030616; Sun, 23 Oct 2022 03:04:10 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y2ryup-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UjascbDT/gHZdv2A8hBYfj1A5npwW7DL5aLlUyIjMhGjppkfAzcrnfgBWmHNqZpbiwpvBT7x7Em/ddGWcJ7IdnCN2fG3J3q1i7oeI2/5sT5JG+FYnrqpl9IqelUuTix3bQuEvQXOPngY6rWXpYY9Uv/DSly0Mbp/nEoOnb1cijuE//vqW8or3ajJp3/4bH2Jj30wlzaV1vNJKfdBCB1mmk9cBqLqevQRGpHfGqpP8BfjGryApViwsEWxBk0zOch3GP3hHDnUl8KpAG4EHQY5hWnQ9C8U0C43LXdH4eqQlrlwHX5khYI35ctgXUAZkHGaWGUvJSceKLmNxnXjhqiKPw== 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=YjrAn5VLPkT2+p7vbcDBYRL77YeE9wnvFdg3nj8EpRU=; b=BfaEnluER+Y+WjfVVWSsme16sOlStjKwqPZiTgUn4VdWy9eh+Zs33lBpS17eunsHJCetJfZX86h+hfpMDMQuCb97rXfFbjodplSGjHuXDPpEtGK/ThgaUMNJcoYndQ0mHBZ3bqXLVOmpF+ECoyY3gnyV66I4LMmx68xM2+2lTCoHP+xKtggldeCHTw3S9RP3LUD7ci+j77CdWAOaI+YiuREprR5QLUPHDv90Yi2WFZUe+V2ToKAcibOJa/JbL9dyNHwffEJcCusrspQv0b975wze303b8cZDT27L/EA/p9hlrj3/lviqfPELjwI05XtlrxnY3AigV9c4YJrFfccVyg== 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=YjrAn5VLPkT2+p7vbcDBYRL77YeE9wnvFdg3nj8EpRU=; b=Gl5GgjUx4LMkjMiq8zXENwEeOrwiNlapPbT9Y96lqiRjG5wF1q+64I9LIc7lBrypNwHpOQFMBF1PT+mItfQ9lUONVEOZdmWaMvTNsGy/vAXVJnK8KKKL8RWZKyD9Btkb8IufeMa2zdqVty7yXSpJgUWekAyHsbUXuKAk6+zieMI= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS7PR10MB5150.namprd10.prod.outlook.com (2603:10b6:5:3a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:08 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04:08 +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 v5 01/35] scsi: Add helper to prep sense during error handling Date: Sat, 22 Oct 2022 22:03:29 -0500 Message-Id: <20221023030403.33845-2-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0085.namprd03.prod.outlook.com (2603:10b6:610:cc::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_|DS7PR10MB5150:EE_ X-MS-Office365-Filtering-Correlation-Id: 42d724b8-c5cb-4b98-a598-08dab4a340a0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pSkGRZHJxg13DVvGBtp0XTfFctqyS3Qnn2QXKebXmGP8cg4FgTIOjyPvXL1238xtUAaTBIdRERCJ113JoR2k9rXK47stU0LGVSg/wO2Gn4O2P6OSmDWKAP+Vd2a9Djvy81TzxatGfHwVifWjeJMWIngbnkSElVWYlAG/u8aJ9zz41sn4MZ+wbodY5NM4GuGI2HYA2dAHefiBHK1IIoG6gtvsyinxxbI1UfxGJ8kRrNLj0+pqxHbZFQfg0JkxxHtUkdOIhxwd8vr4LywsreYDjB6CO7IQOvubf9TKnu1kGkZPK3IHas3uFAv61zxUe2mMabuuINQjurqWAQzVI4PCkpHm/YriUMCDrDR6hh4CCub0d7LWfvnZJZ8g3EfLeJ23828qot8nKtelEF79ZWCfzs0/nwF+v435Ez/PKeOKDdMme4PIZ+vbJoTLzZHnCAFf3PPbHWGcIlPlUIByz1kRaY11j89YJCy6GI/MwH1eWCzwlB2cG8u7ClEIZNQUqhbAtGFWX25i0cHS8cArnQziAl4roanN7fjL/kbrrqfKrV7wOf0/HrLjaqONLnZHDxSXY8AIw6X/QdaYBFGTn7YpqSvD+22HJhEDrfhmt1orA7w1QRLnK4wEQkQirmT+lHjMoBZpw3CM3azXnQyNHx3hkuIyWzjxy0YcPg9QM3YRuJgD2LGal5KPuhwNd8M2Hycz8qo1iups69ZjOWfc9NDLjQ== 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)(396003)(39860400002)(346002)(136003)(366004)(376002)(451199015)(478600001)(8676002)(4326008)(36756003)(186003)(1076003)(66476007)(66556008)(86362001)(66946007)(38100700002)(41300700001)(6486002)(83380400001)(2906002)(6506007)(26005)(107886003)(2616005)(316002)(6512007)(6666004)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KwAX4V87ALmjcoHK7a7RdnFgAEhA1MAV0XB/AJqLpd9DaTTfwCEOdxM7qN1XmCXbAv3/aT30M7CcF2s6jX9C3JGKTUh4G0JxoC0YcPmvph/dkFsJxsZ82YMGrqCH91td7i9dNajeShkBKFiJB8LvgYYjCXIGPoZE1NgMoQFX9jI6xH8poU7IrDgedbDDB7ru8TbB+o61MJ0C+5q813/ThJLFB2mWjmiAIrIC4CWP/7cdzpnIWkEFkLk91ZJEJTI0T012YVgI6JNhL80TN7pyhN6z38I++CRZ2bCHH3uE1IyQJaGM9AFZJD8x2XhveOVzw68vZTARVUoFtMWv36mTSTu5OdNLw6O6orENDr4WmsdbjaS3meqSuFxHIusWaHlSxlszNMbQOrXV6q37nV6wapKOfVoNAw0UxaWn1QAAQ12B9t7ssUikAiH8Rs7/9/CxD9aYevI6KOfPfznEGNYihfWKAjGjUs1rceSI69KkyWvBFiIG8QRh/uZhQusTOAXJwlp80lJoAk4abXwtzkJw276Bre77J4Rbief4szoQCxqsCh1THeZL5D5Kx+uIdTzzU2/ICAdE5zhB7pr8yW5prmw9OomqQt34lCTB8VmstBVlXIMIpNorefks7ZUdOXV/OzHsVXdv5kCGQ8+8mMNvtzdXCLhNkuDOjBp2VRaxhT/jhE2wL1Cdn5KtC0iigbDen7g0dugsdyr8cCsZMJQdft0ePznqTS4+dikvmUt39rfZAIYeLEzf75ucT5yDoEzTzhYGGFP+O7FnksdGHLYMsARZxXGx0BGl4rE5GFw4FWoYklXv9EEGB9nkG3/e/k5Ei9OxryaAG0Rj22xh18oPC1182V8h9Swp//ApckGynMRWyF7HEXM5B44P+2oa1e8zW0LYw5NOk7EIIM+ae9qBKCF7iLOJ1vNXtkUU7Qt40I1zZVmUad4rd0Ce5rRP47HqmLQV+etT8qLKktTPzQtNfshuQnEx/j/4s5YHMatAs3zv537uZ49afnvvjX7h4EIVAzzRJ2TcVnbSwkHxaS3l7C3H+5xXZFnhwoQaq48v3cNkMQ3IxLj0vsa6pekaYa+DT656pYNOzPIq42d8oYHZ8RCkNMl2/15arieAQYEdmWCgthce0N9W6kiwGcp9pIDCBXTavXPjSbBe2Is1PyNHk4pnCRYXZkCnTjixy1ADLQcFxN+NnZd+Azhjvw83NsfCtgX2C3RKjOO6JhOPTdnvW/uQ/Is5N1KduXZXCGqRGmi0HM3zRb+A8LVCOU8TQICOImy/3xKXk0lgqB3KWP9Rg1Z6zRXGFVSFAGnCmCm0fFhYNAdvYcUvdSpD2DH/VcrcX3Gl68PhQhEcHkL2IBnMjozaoFJ9g95ZzN43c77oAVbzFcvbTa1pXLkNvaYf9IPYlxP5yuc/z84CZg30h/XOOW1p2AXMHrxgNtgQzcsEKRK98+QMZLXiqitQEcWZjFGe1T8e5ak+7FoHlG5JMExAdm6isq4gGdD/FR9mVMm3vNq0nI/c6I3GRvUtX9s4OxVg3Fli3UFxgahFctJjfZZWSdsUXatwtwcLFd5hrjcB50twwlek8k9Cpl1KXNNvIXcaewochKDa7ZqS/tbSOJYT0A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 42d724b8-c5cb-4b98-a598-08dab4a340a0 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:08.4379 (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: 04meUxyIIoHujBOAaa9B7bgy6frl9yvd8yN3dHgOy44BTBNfSNHVC8GqO5gIBIG95aWl6fr5w/DPSyk5PPU14RtJNrIdS1htVBEjG1PDV+g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5150 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: gXFLFFlOcZzjxXu-oD4BCnHGwpcpcFzr X-Proofpoint-ORIG-GUID: gXFLFFlOcZzjxXu-oD4BCnHGwpcpcFzr 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 Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Reviewed-by: Martin Wilck --- 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 6995c8979230..36ae7cc5e7d9 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -520,6 +520,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. @@ -535,14 +552,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 Sun Oct 23 03:03:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 617797 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 48AC4C433FE for ; Sun, 23 Oct 2022 03:04:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229974AbiJWDEh (ORCPT ); Sat, 22 Oct 2022 23:04:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229695AbiJWDEb (ORCPT ); Sat, 22 Oct 2022 23:04:31 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 258DC26CE for ; Sat, 22 Oct 2022 20:04:25 -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 29N2sqqI006776; Sun, 23 Oct 2022 03:04:12 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=xggUMucoeCGKmNgdDNHPRXQiBcswsnK5bhke0LkCycY=; b=aOhAF/aXTTGfSsznxSOMf7WdFOu0KRuK2uS8S7AHmHkdDtcy+D/E3mx7+jYNvu46t8W7 34ix/+VojtUSxmvUx8FPWenC5zwl2Ju5knkPRoSdOR1zGvYRmhGEv3nX+Tqw5yEtXbxY OPKH3HXjFmOQ3U9faXO78iPxcB5mIrM2+/jbyLB3xEq0Gbmzz33FpKr96iOhHw0o3NqK juto5FBZSvGTBfsnga08hhF+NyLy7DQUQppufCy5fXCVXZ0J925TklqaBfPcjZRvQZac 1tM0Vu64H3j4xPJ9noDNFtO7ZgmoHQaDUK9sONfXJPhP5g3Le6FSbmh/NaF7AmRV6flQ uA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc6xds4v0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:12 +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 29MKI5b9040561; Sun, 23 Oct 2022 03:04:11 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2174.outbound.protection.outlook.com [104.47.59.174]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y8grxq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pl9fqplf3+JBWWTtD+Ls7DOuuEfjcthFJ6E4yuGhdlxMo3E+DbV6WJhHTzs7M482tOPD686fxwDH1cG1sb8/qflBgGzUMXuoZ14U5utn345lgIKSBGdE+eNEP2XN42ATE8zoUGWwPyDnmLFhEIMVlLMg9mFRfpHOIc9FvQlhcxqrlSln6T3F4F3WGktgAOj65OWD2U5wA3DBf8SXP+K6qJeEM27gojcoLTGnqhAnqkd7iFSys9oAMzueheUuLloSwiSGVFFJ5+hLAF3EZKGIpEuS2nhaC3AHECHFM1TXZYlY9KmWU6YK+N3xCOkPRZhUvmfvj/Z/5HpyRdhXRHo9Fw== 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=xggUMucoeCGKmNgdDNHPRXQiBcswsnK5bhke0LkCycY=; b=Z03+Lrr54NHhcZJ7JI39HiP1pKwl2qqXnLVH9KUUjIXVOuuQaC/+Jmpv+Npa4jgesLUM52ULDh1vi6LfRe6oBY9gtcYAJpxc9MOnS8aXbItbmDyjZLNnRne7I+PuVA1qgVeyux5JfAUlAY5xIKAbst2ySvoKxcqiyp91PLHvURI0eJ4fssYMPR3vv2gfP0BYoBBIMpNDF/BfW/z05+mMvGkVwG7ttOcgon5UEZ7wZN9F0IW7oT7de4LrMcPIUxUX/PTGy3hW1kpkwYqUlhkSN7XmVo6pRZUZcfcFsqp9O/pnmUtKiHpxOGqbVgTcRKglQDBJxt44vlH1Mtg/sFcn1w== 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=xggUMucoeCGKmNgdDNHPRXQiBcswsnK5bhke0LkCycY=; b=pxIKMYNDxZpzjCb+pxAW5RlKl5dNxvacj/IaKw07SxvCDwYIXB4kcom/GTI0k7tiDitTlfHOGyeJJ16RXI2cWQ9nJFdNSSB8LVVKmkcfGsi7G6YioxKzMWyYmuBiiqiqlUjcOd3/inYxHpjZZ+oWMSWmVdp7al6eeGhW/x2+hcU= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS7PR10MB5150.namprd10.prod.outlook.com (2603:10b6:5:3a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:09 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04:09 +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 v5 02/35] scsi: Allow passthrough to override what errors to retry Date: Sat, 22 Oct 2022 22:03:30 -0500 Message-Id: <20221023030403.33845-3-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0071.namprd03.prod.outlook.com (2603:10b6:610:cc::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_|DS7PR10MB5150:EE_ X-MS-Office365-Filtering-Correlation-Id: 8205449f-72df-4d95-9705-08dab4a34179 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vvaswptCMTaBmd0/FKuRX7y01XWypADNKxaMLo8qygMJDhlge9ASHfl2EwHndW1WYWQFgDsJ7Cl+rY69OM10F4z2YwF5O2Y0QaBgoS7Otic1zFfNV0wmqZWo3VDjKdsay5eVTLO7afMHhGDUUsD1dIrjZ6KVXcdwj0HQk42nZTTeCcG1F1/6glA4KdXOeYHArpzc63WSuudbw/o/+Jaz9+zKqlSAvWS57yx4/rB2JXx2aSNT3W62se5n8OLwn0M/VU74K1KVzKw3aCVP182sKF3dAwxOM6YFnBHR7AhpfyjEZ5DkRO6j9GIihfHF/i1IM+c7gLbzHbLfvrkGqHai5DI53DA7Ta7Afn6lCeLgU9Qgs+6fkntqhrPs/wc0+zPUNEXq0rHVN9cja6Mg3idLwGo3lIiqCgmuWI6Uj7z0h/phrvETmn6XbncgojeddLK9LsHN8f4+WfwNapejxAKn1O2HdXIprTWAa6QH07HxX6taqrh1Hr/4wrcUUhmZaeVgQkoevkTPxRtXi92PVID3ccL9oCOn5N1He3tGbLtr0pHBtfTHenlipAIuZgYNl7R8cMLj8xKiSZk9PVRBjc5XF1Qdecrg51Z7NZRPuiYh0xP35rxbY/Da0lOJcQt4prdy53AKpm1RAW7HlemcvM+bNeYAvmhKX2uyQuWWCVE7lqHh4+1ckqp1Nktm3NQDiB1d7tzqlIYnf/hUQbfSVNDYeQ== 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)(396003)(39860400002)(346002)(136003)(366004)(376002)(451199015)(478600001)(8676002)(4326008)(36756003)(186003)(1076003)(66476007)(66556008)(86362001)(66946007)(38100700002)(41300700001)(6486002)(83380400001)(2906002)(6506007)(26005)(107886003)(2616005)(316002)(6512007)(6666004)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fSXPBb2wJZQG/vtpOftfROQ9FM9GwpRiid4XDDSGmsYbraoctfHQVpfBlsLY/QXlULL93dA61i+fzCn84c7tb6wddnL853/cv8pD6lj4+YqvFnQVtRxms4S5DS8R1bYZaEWzvLvEc64TuMA8tI0odCu5f+D0bwkWHVKJywsiFTg8xxId9UCbaXgA/q2PJ6BnBLNNjTZqQQwY7wGrYmRq+GoA6/YjanVdeLBzxmJVMI6DsIcIp7A9L/mQjWGLDUP0XSjpldOWM2ZVt7ROTPdggYNT1Cb0AUpyYYz/wNjkaM1NtAKqS44WRCma/CvqtXD4bbR55CqiZXHcqwzpM2b9a4r6Tfs+A/cb9lT8zq39q/rIGQv8rtROKzczjlaWu548tSeQ43es2XYT6he3rL4C63ApufsW1+wTTPhVBAFT0q8GqqiJrG3fx4Maaz827jaA/QKGypuhY4Q64CIy6LQzWEsllGIbMHp3W9M79eINcYP7IXtciGNdLlS5zZwDxCOOyTeBaRTyGkDYBx2CLxDjj/OsfSlnv/jY7uTLQwxBMBBg12N7ifKtvcTV2ns2Ng2JISKKexU2r1N0s442ZoHYZG9w8QN8Va90xeYanQfYuxN7y8iHdSgvmYINc+7T+XY31W2sP8+vtLuIu36EHZN+3eeYRMlQngoQQhZKKy5BIdgIujxoK6EoHvwRux8NzxwKhQQLTTV5OvTC2HNQv66tZh6G+uqXAamGNPNsj3vgGx5TzGRdnWWgUvBad9AyVYnvRDiB2ad4Cjub/nJC+D7F29TehPrHXRYjnXBqULr9Hk0DDWrOGoJpyIKPkD1FlT4/GrQpAWzKyZIPEEKby9L6NP9Ex9bgILcLTAS+DJ8uVEqWen7nGLN5tbs+NdywwN7pIOPAAg6Hgui/FTX2GpsGA0x8csJx8hPW0B/jdbjm6gWb0KliEXpJ/AJ5lp79QZSexnSese7Zq8CYI8laoqGNa+A2iJbRphcTlVIfU7HUDC6WbmMwHifHRCIOT5PJGBJGN7TAFMIUx2q7o3jlhXZtizR10cK2rLeyQLEg+SDWVupLjtCwLqfHT7vY/433RZtsgwi2uG2zUuikD7NWF5mWPjZSodFM6Dtgcq3tm3pi4JIPkICzeHhDrVlMd+U1iC7jtRZFzkAHuAAG1CBl0mLEaKhrbIcHqgOXbXJaQ5vGwiltGbZ1h8eiIslplQSiuxpdLeCi1fFknE24FImhRHFxtu33t5vFJ7QVZpJMM2OMnVqKF4N4LWs2e/ZZyJzoTvW97XjxqTjaCIciTOia5WTjmjoVW33Fxo9q4aj24d1EN4JOV3Ueh3WCVmjo1GQKCtqtA98LiFX4EUSoo05kAJx3pHZKF2HTtsCrpZr0evQWLlvsPR6b3WoirHs2lHn1KOUbUFBdsoPpWcfUa7edoxmuxOWDakk34pd4XNDQvQFFg+deP7bldga5i99Es0ScrX9gxLQeivXfkgXmGB0hkcHOeE3/PyRC6ZrQcrvFvuFelcyw17LZJXIqKr73mMLkLIRHaJIE8rSf+nfJ1EaTHmR+KbNm7GV7+2Qvq6NguAXDoB94z9G8pj6807tubA2vnFyLKzPn1IgdU2H3YCCkFebL6A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8205449f-72df-4d95-9705-08dab4a34179 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:09.8440 (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: UcR9gYT/mxrySgXheF55cftWujvgyrZ1fMpNxF1rhQevqxInGnIP79/e8fLHO9JNN+nj5LNldLeReLyEGAvZB5ji02HPs6EyyooF+7W7m8Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5150 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: xirIhmiFr0JrKQTnclHtD3Jh8nAZuQ5m X-Proofpoint-ORIG-GUID: xirIhmiFr0JrKQTnclHtD3Jh8nAZuQ5m 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 | 82 +++++++++++++++++++++++++++++++++++++++ drivers/scsi/scsi_lib.c | 1 + include/scsi/scsi_cmnd.h | 26 ++++++++++++- 3 files changed, 108 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 36ae7cc5e7d9..19548a1d69c0 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1832,6 +1832,82 @@ bool scsi_noretry_cmd(struct scsi_cmnd *scmd) return false; } +/** + * scsi_check_passthrough - Determine if passthrough scsi_cmnd needs a retry. + * @scmd: scsi_cmnd to check. + * + * Return value: + * SCSI_RETURN_NOT_HANDLED - if the caller should process the command + * because there is no error or the passthrough user wanted the default + * error processing. + * SUCCESS, FAILED or NEEDS_RETRY - if this function has determined the + * command should be completed, go through the error handler due to + * missing sense or should be retried. + */ +static enum scsi_disposition scsi_check_passthrough(struct scsi_cmnd *scmd) +{ + struct scsi_failure *failure; + struct scsi_sense_hdr sshdr; + enum scsi_disposition ret; + enum sam_status status; + + if (!scmd->result || !scmd->failures) + return SCSI_RETURN_NOT_HANDLED; + + for (failure = scmd->failures; failure->result; failure++) { + if (failure->result == SCMD_FAILURE_RESULT_ANY) + goto maybe_retry; + + if (host_byte(scmd->result) && + host_byte(scmd->result) == host_byte(failure->result)) + goto maybe_retry; + + status = get_status_byte(scmd); + if (!status) + continue; + + if (failure->result == SCMD_FAILURE_STAT_ANY && + !scsi_status_is_good(scmd->result)) + goto maybe_retry; + + if (status != __get_status_byte(failure->result)) + continue; + + if (__get_status_byte(failure->result) != + 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. @@ -1860,6 +1936,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 8b89fab7c420..eae438d53ac5 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1130,6 +1130,7 @@ static void scsi_initialize_rq(struct request *rq) init_rcu_head(&cmd->rcu); cmd->jiffies_at_alloc = jiffies; cmd->retries = 0; + cmd->failures = NULL; } struct request *scsi_alloc_request(struct request_queue *q, blk_opf_t opf, diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 7d3622db38ed..ba629ac4525f 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_RESULT_ANY 0x7fffffff +#define SCMD_FAILURE_STAT_ANY 0xff +#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 Sun Oct 23 03:03:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 618721 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 76F0BC433FE for ; Sun, 23 Oct 2022 03:07:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230039AbiJWDG5 (ORCPT ); Sat, 22 Oct 2022 23:06:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229988AbiJWDGe (ORCPT ); Sat, 22 Oct 2022 23:06:34 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25D1D1EC7E for ; Sat, 22 Oct 2022 20:06: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 29N2tp2H008722; Sun, 23 Oct 2022 03:04:23 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=bKN/3na6/yeB6BRg9V7tGq/OT9G+2mZyp24rh/u+TKE=; b=Sx7JU73+cykjF5wlod/yf/ZqxDF6saPOkEloDJWHK0Y/+Cguq4nv625eo+XUXd3/DnjM K9thMsQD6nQOwOGwHp8aoml/pb8V+yKvqBozqvNRkRum02uo21KEGW7ZGdY+95vSEg/V 1CG9Y91nTuJrUGyRmPUzo5KzG89uVJoZFCsFws8zHgQNkUFMmTaCcmq3YrC8Pf/WdNHo W4btFrDrX33BpVQ3DkCaTrsDZ/HHJbN2616Pobb7mlNGgimz6EPovULMBLhvT7tBlCuH P+KIkiH1W9IcmGs+CQgq/UJ9kfZmzom/rS6gdGRXxHRtfvwKXqZ/AoMGKJvNxOAASbRi 1g== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc6xds4v1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:23 +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 29MJVPB4030694; Sun, 23 Oct 2022 03:04:12 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y2ryvq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nuDT8LsCObAciwmY5Ok6Xedd1qm00tERKzzkV0IoVozWjkGYCAZBKtRTEGGE/uDv7aZ2zGdOgx5HLvH73bPJuy2h4AnMtNNTNPQd1hIm7H9kTxzoj2keu+5Dk+zCahhc6xslsjimdFdDwaON6nSOuMwNEnuHG7DrerzKovNsDio4EO5zZEKpgBQttBadwKjNgNgTAvBes7vRGX4nC/wrV/GM1Fqw0K5C4V8wXHmfO1mgytyYpHxH9NaZOmpU3XE+LHx1bmnklHXU2EpqzFgEIImbEurQAu/SJzv0z3alj1cON5zy3Swgiykcdq7BVbHykwFsLSEfMaBLK8OIR5UIiw== 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=bKN/3na6/yeB6BRg9V7tGq/OT9G+2mZyp24rh/u+TKE=; b=Ue8xNjr3jZ2KJhKdaMANYMGg0O1rjUbJ5w5kl6uNZXc2PUr9Z1dNQH1Y7p7YG18+cLXMYIk+bbz1flr7+/2psEHOhOw+HEmKGiuSxAlr6zh/uJOZh+rbD42fkSocBno3cLhX4Ey9IBc+yv+8wiWLm2+KLrj9IseoH7hS6ChhA8UtkOaQy015YmW7IFVP4EQhqte+2ONg51LKCGo9w4XVHXLk16Tm+e7xC9BDAn9Te48v6/jxRIPFBdGgwBHMS1lqDkcn2qNgBeL0Cn6nwm//52+KgIxdRw4uUTh6kzGeaHrMibxKEo0lzFsVY7Ca7Siexmm0ANcnFxlT4NKKbQy1UA== 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=bKN/3na6/yeB6BRg9V7tGq/OT9G+2mZyp24rh/u+TKE=; b=KmAjW5jVVTrF6slaqBjz/XIh9S6dKRXH9ib2mu8qTmIuKlA4QZnSHP2ErINbQ+RUHMy98cXJxfV+NPm62zl3ncb99ftT+QZKloSSX8lCOP7YfOTzQWaXRdSSMNxCcV9H16v81d5J1S93wY2rvrJ4A5s4foq4xqZd3vNsuSCIFzM= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS7PR10MB5150.namprd10.prod.outlook.com (2603:10b6:5:3a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:11 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04:11 +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 v5 03/35] scsi: Add struct for args to execution functions Date: Sat, 22 Oct 2022 22:03:31 -0500 Message-Id: <20221023030403.33845-4-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0069.namprd03.prod.outlook.com (2603:10b6:610:cc::14) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS7PR10MB5150:EE_ X-MS-Office365-Filtering-Correlation-Id: c1601f75-4c7b-4d79-61a3-08dab4a3424b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: grdeE3a3YGfeEEL5htyytNG6uKSQ5Z/EpfcPKjHzOa7H1bI9Sswecsl383U1ZAbr/Hv/NQlvepiXfSfleo7o1S77A3QPCss1s4lGqopY/Uwcu9SKV+hwKIvtwIVKNTDJS+Xbo+44wlA2fqYMm/zmcFuEUcElK8RA6QXBLHE46kLZ6XAfwasEKC1DT+QXdTSM3gZSzy67dwb7YOON9aeyvEYxxf8LcX2D9vmMWeOW1CDgT/d1s3gymSQKg5Z+0ZzGH/0sQ164ZvCxAqIMgAR8OSXZqdzxb9KZqWjMyopLSLEWrqNV3epQ/JBeasghJCgmSdpolFUlUC3Tr1zCeUWbGWIQQK3wg2OnwqxBSuUmiEGnkAZWOQwhzL3Waubdo8afxXZUDdjphChNmTUNbI6VIHy0UxcXuZnaS7tfKKeb6IQE4S++4r3/Si8iJ32Jo/Ce1A4TbpnULS199sOKTQwWoL7y2lkoBzWyjzLKeGDv1+Gfj2B3C/t4hFdQDOcZyFJnAn/3Jb56j7RhvcXQoYU5jwEvcxhjPuoBE5S61yeuAg+XomDLU7XJE2crtlqDKdaD9UNm+IZhxOI8a7fL26j4zZ79mbLQGGWJcRFRJoZcrdnWs7iMU/+boC7XHx9DXmswAMijw+WEDstvzbqQFMtFNIHkCm52p88kGymJMsWULGTUjWmk/nqKDJcI6Iac+1WtNI/kP9oEfg8dAjwK7T6Jcg== 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)(396003)(39860400002)(346002)(136003)(366004)(376002)(451199015)(478600001)(8676002)(4326008)(36756003)(186003)(1076003)(66476007)(66556008)(86362001)(66946007)(38100700002)(41300700001)(6486002)(83380400001)(2906002)(6506007)(26005)(107886003)(2616005)(316002)(6512007)(6666004)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FV3jFkd/TE5aR7vGioOGJeHSTQQzxPcKUMW8mhXc8Xx6ZJv8kI+atFCCoV7o+sg/MIu67cqrBXOjeJz7U6+NpcW1KlwsnUcCzSRPG6WyzGcFI5i2CeG1rFGrp6+4FpeerwhTSlmmTmmAmWWau2ySKdbE5QXG7gYRCNQtjKXIszSI8u5ubpuFgwSOqE+ubnPbLOops98iUA9F8LNZg+RDDMS9Q8/2MgUH8tqwXHLCPqcEioXQ2F2LxDbAVkeDcYivxaT09kAPBEv/kvfzwO8wn5a++SfRc4gJUaKaF9bB+cw2KX0M9oeMxLOdLvRnwa/xZAT0X7NDsbwOWpHic8KAVi7S810lkAhxEN3Zoj/yUFuwkPMyv0PiMbJ9rHzcBYADMGw+jINmXL2JUeEQlQ0d61Igzvj+z9wb2Yv9EUAaERYdCOo0+JIjG8jnB7m6rpWzKrnZ9GH9LKo2U3rpuB5Gh9XFgPUv9ys+cmZ9tsy+Bfeg7dKGg8BSsDhgaLQNy9HATTy8ZxFGKrZrJebB80wq0bpLx+IrEkZ8oooVNzyLgKaKQkTu7kmwPv/DQCSeInp26g1rCsqGLO3wPxRUDdNnHxZMb0MWVDCxpLsHbQa3yiPHtbxLTMMwZQ0+FfxYdhDqGBx/0IHMnBZnEHTPB0BIIYSmazMlfMFVohc2IMj7M3B4zj08bBuvnafvXQjNanNZCjfo+X65eTsJl5yneLMMyVkLBr4n+u6iAVizQSRSURbON21l+Lk+wYi4PVkIrrb0Is9TAW5CHbjn9tbEens0mCGCSVkpzrMDHmCKMh6gMEKM/YLqH52pBaUDHxaIDsIkdr/LCNoxWulqrZydkyGEGO6hog4tE3NoVjm0LVtA0C6brR66iyLobfeXi3StAWMf01bNvI+GyJYS+2E/V/yuvxO1qTcQEtZ+US+zMKFMFvkkDkj+Exa/qGarlxl9A/zyv/jG7txdffQcjSatbDIWZQTcYIQ3m0lT2piGpG9tp5wRUDX7ix9UtWc9jKJmro/0DlyAcpjgJ8vPXgZ9SnnPu3DCNXRn0sJKkdyicHt47I1oTT2i6p2RAQcoYnGzLJgLBxgIgYy/eX+N6V+61x6NKxZQ8iQaj8d5JXmHnv2PD+VKTGbtzmHkj3pqws7BA3f6hrZsR8ecBPASLEapIB+EeE493Wno10FUuCcatp/FP/WDRvdrADiRH4V0imQqxjyyn0KlvHJqddXHnToNKYInNF7CgAGcAVBOxVGTgI005+zWE3jG2qKf7L9nfjf/MrkT5z06ricwrrZVBk8d6YqhuixzTDehzeNPmDLCncs4Xr0fvt1XKywSOT9+AsoZCzfht3DWo5dJm0NeSh6hq8ul9PzXlBv4r5TlUgqWS1txwYlfCrbFTWWyT6HNMwhIMKF/phHVmGrMoJGp+35KZUsvV9zXx4mXXrJFQ7If7jiQ+9ocbarD3mRAZEvAQ0PaohcusyMz1yRyeYlXUPgI/IRQzu5M01IO3CeIq20AjpcCjehOubA/KEWW5y38n6nLOPj3FIKYdQxt9zHyE9u3mHKvb1WF1yOiPVQlh4KaRs5TbciW03jmqzSWI569Q6cDBfx+NvEY1a2m3yepQvJDl5lDuA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c1601f75-4c7b-4d79-61a3-08dab4a3424b X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:11.2658 (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: XxHAWeuW4VckLZazKQPYhq+UyncNAIVLao4nDJDYXIzuY4RVedumx+ePi4xomeo1wiZ4nh7j5eEFQixi8E5U4YrtCLFKaWmA8W7yMN497OA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5150 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: 5YmMRLTlYE3p_EihLptF2Dw6zkQMC1co X-Proofpoint-ORIG-GUID: 5YmMRLTlYE3p_EihLptF2Dw6zkQMC1co 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 Reviewed-by: Martin Wilck Reviewed-by: Bart Van Assche --- 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 eae438d53ac5..f0c55e2621da 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(const 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 c36656d8ac6c..d49a7157d7c1 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -455,28 +455,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(const 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 Sun Oct 23 03:03:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 618723 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 A8D0CC433FE for ; Sun, 23 Oct 2022 03:06:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229882AbiJWDGd (ORCPT ); Sat, 22 Oct 2022 23:06:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229783AbiJWDG2 (ORCPT ); Sat, 22 Oct 2022 23:06:28 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0524A631F6 for ; Sat, 22 Oct 2022 20:06:25 -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 29N2t8VK012741; Sun, 23 Oct 2022 03:04: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=hQxVcrJ3Uo6hFBiz0ptcjbcp4kwxOTssETzpyjsjovk=; b=uR1DqYoOxPc22zD+rLSmU2uGgLQAeCsTNWM43WS6XYmrhyalO3mZHeoTlQ7LuDtue4A0 CEFqQMw4/6x9m+Fs8LvVDaRwG+mjOf3+AxYZ+SgGTg+zVabU4pnRhCiC7Tk/8LA50WV2 hvBNpa7poHEWNKvDedyWm3KT08wxMFlHuZaWrR0Z2yC5x9R3YKG5NsuT+GfsnoVVunzb 9Q4zsItxv4R21+NNL9c01oPqqkucIq6m/C0vyw0oKYFGIrvlVI6mKP3qGS1Ppx5OMm6i 9/QE+vAQXQtmaJqcPlOewPH0dV9DvXx+JbC8m5cydXxX+NiyomFYPIsdmstv0SfVmB18 Iw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc84ss3fp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:17 +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 29MKH3st000972; Sun, 23 Oct 2022 03:04:14 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y8grye-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fb8WOdBVtkuMn2mO1XJYk/w7GLAg6SRTEQFKRRe7C0HMmCAWlobBGizgRvBaJNlumkzAimB559wHMDITuTHOSEYULNJdCLmrH5RnUBM5l06rWRlE8rqxFFoxSuOJIhA/yGXPLKTndx2hNkUnDRvrXKKvFQwoKcX190RnaxMPcwnq5GYd7IOYX2zkie7fP+ooPPWFw8cd6WDnkqh8lGlLv/6A7W15ctbB/aOmqwN3cakR2KQoysZuBh3qxjU34eBOvnSRfN5P5DXRXrokXl9An43fzt4YGne1+Cmj8OwO8j5ZiKxwMhsRtik32v6AaPPg/fhiIT3cpZGnAICaCWU9+g== 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=hQxVcrJ3Uo6hFBiz0ptcjbcp4kwxOTssETzpyjsjovk=; b=RkWHU7qm9GAUvBcCVh3Wx6PPaahnle7qCJ0BaZc9Khj65LZ+BQUEdbuL0qs7BBhLYDKnGareXSXS/jfTHrIo63f+LPMJ4dxXJ3Qicf0FQNmRTUwlcLmsTYv9JEbUK87wG2GNc8Be+6hHTXGdsBQ+w9Y37lZNlOLJXtB17jNQj0g8qwwaGHuw2/G1JF0oygTvhwB1BcwQDEK5mq2mXbJoiFV0aG52Wc6gBemrIfZtdOlB4Qz5/KKTXLA64fBwBherclfu3IrLSPsxpGa/1zlwsYmlCaXzatxKI67cQhtnR0Hfwx4MJcennftFEakSddKChDWEy2uRcEoJV5Kj9MOP6g== 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=hQxVcrJ3Uo6hFBiz0ptcjbcp4kwxOTssETzpyjsjovk=; b=j/TzmZ/BnrX/hHQ9+2DT+K6FcznDYpvkBGxOx4wZJGCGS45NwxIRU89jt5EFPo5gporNONDINgUMxxXkNIMhPHZIEXZ4Pg0mnephw64bqpajOPcGpaNggQIxf3cipq+mH8f4sOKUmNKItHnz+dwbZd6QpHv0dXLGLbiA/Z85PQ8= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS7PR10MB5150.namprd10.prod.outlook.com (2603:10b6:5:3a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:12 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04:12 +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 v5 04/35] scsi: Add scsi_failure field to scsi_exec_args Date: Sat, 22 Oct 2022 22:03:32 -0500 Message-Id: <20221023030403.33845-5-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR11CA0003.namprd11.prod.outlook.com (2603:10b6:610:54::13) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS7PR10MB5150:EE_ X-MS-Office365-Filtering-Correlation-Id: 92a6d8fc-45ae-449b-17a8-08dab4a34329 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fer6U9lIZfmtRww7fnYerRSmSJnpd6OElNkbmf/XA89qSFQ5lKa1/LsTQrRgaL3wAy2G2TBxUDb5pmHBJVHtYNetIjhqotjW3JcEzvr/I7IhiVLTkx6SK/VacTehxEMYKz/0LbmyyJlkfUSkE2R7qT0irx4JjvJWQeyTtOsl/enFW+5O7Jxlt8WZx+ElC6HrWiAqZWPRs3mdpjBwIfPSMhWAKDJGo0rh9Ces5ORKR9lzOGmbVAWnaQEnALPwjPPi/HRfkklOWQMMXzxzEUYOo88IohMtpNdx0ZNr86iGafllTW4ShD4E2Ghc4z+Idu6mbM/tH6dvoQnc5WewJQEc8uCO8xbbrnNTzLlP9RNzFnTmgYWV/YIakfzoM9awOEtwJmG9KxkelfTbGsQonPd5aNSnq/n90DjDaYh0FuHb5WW4JqFBckt0A1sSPC9t1DF/eu3El7Uzt+HeUc0tqRmffs7sdt6P8LmowINoWxipAoUxSUEOdoW09jZxM46TsjVemrVT+mOxmWPq+U19UibshT2lNwMyfJI3s3NpHIEYTH6gzq+G549TdA5zB21z7HJ0qjME0HMTXrG9rYQ40BTI3a9ACQcLyz1ViM+QJaWwskmex8BO1AaMv9zYkmUC0nD+904SAMQijFNhMzoa05kW9zAmud3IucnTObRF0v4oU8LSAOaitsA+Kez0sLk9Cmw0rKGdba+fYTuPRQXDO78nVg== 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)(396003)(39860400002)(346002)(136003)(366004)(376002)(451199015)(478600001)(8676002)(4326008)(36756003)(186003)(1076003)(66476007)(66556008)(86362001)(66946007)(38100700002)(41300700001)(6486002)(83380400001)(2906002)(6506007)(26005)(107886003)(2616005)(316002)(6512007)(6666004)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wE8xLgzBvUYOomFLhDEPxNmMQbPhB9Y2sRZMzVNSWha2ajBh2UDS0HeZo2BaASN1Soj8aYn2hox4zygN1FdUne70oMDYIeUdyfoPPCuOMJ4lr1VRNeXDHMaPMN+xsq3avxxRONXcPq8v8s6pKjvc2HrHl2105IQNGyxaKCIXH9rYAWThd/S6TfWrha1fF9UXZahJO2mKDBM3VTpxiNt8j0aq+MtpbwZ5Y4bkrf3wisc4y5Pm6WjVeipg6fqLBeIAg2b7dO1n6c2wMbgEvxty4jnsodRZFP7AT7h1x05SMgg5pZwmWHYhIoGUws3lnr+NwwKirWoabkqHMWIER0TDljQ05IL0YJUgwkNeTOkXm5ExhlblibRKLFlRmkvqozNjZa5vwNd4p/pxI0hrjdaSuCqJhhm/jOf0kHtZYdBa7rDjmMsYXQkzCCSiFqUQgb54v2P/500xS47nYAo4NkVOjMQ2Z0NMtA1g/5xfyTnBCGdniYnaa/flThPwe6HEZ6FzUJWuU54uQ+vBKJT/HYroct0jxZg4/6LSSxm9qVkONlf7cqSm/RlgVoiLyI/6G82y+nCYeGpUX68LvU58BiHcNpzJWyY5FBcrcWMM6H29IWN1/Z2hOmQTedzqvjwGA5Uue1IyQxOXYQJM15GB63l8mtYcHnUj0Zrcq1f3owgFS2h6Q7WlKC1WQuKTqNC1klaETE4F2mLh90/euJXHFCcK5d8+LE/VsVjSMk2Xajj8acrgpGqb8otgHI73oCxJWHuyYysEjij6FUEyD2/UGi6sMxZXsuxKJ8zPML3PTGs6DOVRAqoV5Qmtwc5BZRiWE0noYQOdregzwCV4ey4+JpvZI1edEqMV+2QqiD/HBj2Kzzwkg/7MS/DD1qrR54f7fx4usahl+K6n3p6jxpN8a1QYX2JMJ5LpWk4+C0uS+WoJFzHyA11WgDb/El/u2HCOzqSB74WTdM94EeOjtXYOZ69+pUFTt89fnsH+HKqQ4/S76Fkx7P/N+0d2+UtBqI9wnKfCIe35daR/KAYn50+2DmwFWXhihNJ2fagKRo9iiW9nGRysu4oZLqmqXS4Jw5VlcYwqw1J3YsfPkGBiRrlpBzvTrY1T/t5NcunEneg4A8z/+yIbAp9hbmAdRx2+F2kZcchlilFm7K04JP6VmZ6mptEaCa55DjGWFVLyQYW4Gpu2SzXom0Zu3I4JeCoCyfwHin/gskQFRtEucJvzWEHQgGAaHdQb8BS06kZdvXJAcfKciIcUAkyoPn5nVX82JoVjwh+xKPyq4H2ILTjlXXn4x2v/iATOxG057pPxenskwIEd4vF2CjBp0mq8xIpM2QA24wedXdxw/yodQR4Csk6iyZIs7+1xbzHWwKX9itTDWb92dMCZYCzJ9n7J41QMYrCOnLYymZNmpMQTXCePJBGXqJm8rpR02MzsYkri9Ic11jy4tZfKJxpERxPIXqjjwYlA4FeWw4hR9PWJgCbZMcibHRxbuSO6eUrmWTlW1Z5U8BCf9OHDWsSRvcVKWBxoWVy/lnt+bGITYTc/oV85ymQ/1X7Yjl7Rk56bvKbSFNsmSENxZFQ4S1qYPpkXMtf/4AQizsqMdO8gZwZ7/19awjoCfMi62g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 92a6d8fc-45ae-449b-17a8-08dab4a34329 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:12.7500 (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: OY71ugENb89UP1yGiVJ1W9CoHY4E0Pf8fWPxea/cHfFzbJceF7d7Z4f5Uwmk/pJKBABctm0S2ABnZOR3nZ7nysBsfpqOOtyOk6qieo0iStU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5150 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-ORIG-GUID: a2WpvdSeyxToN0oBBXZW_7JfQtqJ7aDD X-Proofpoint-GUID: a2WpvdSeyxToN0oBBXZW_7JfQtqJ7aDD 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 Reviewed-by: Martin Wilck Reviewed-by: Bart Van Assche --- 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 f0c55e2621da..0ad0e476f2cf 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -215,6 +215,7 @@ int __scsi_exec_req(const 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 d49a7157d7c1..72d1690f4ff1 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; @@ -470,6 +471,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(const struct scsi_exec_args *args); From patchwork Sun Oct 23 03:03: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: 618722 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 4A86DC433FE for ; Sun, 23 Oct 2022 03:06:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230003AbiJWDGg (ORCPT ); Sat, 22 Oct 2022 23:06:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229917AbiJWDG3 (ORCPT ); Sat, 22 Oct 2022 23:06:29 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7115D6386B for ; Sat, 22 Oct 2022 20:06:27 -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 29N2sexp010909; Sun, 23 Oct 2022 03:04: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=gLJqvLDnoM2LAwyzuFcx9nVzpbqbINSt3ruS/6SUL1s=; b=1wqGTAzbmiMK5Mnv3BoVUxXiJ6zNkSBtclaBzxbV/hoGVn9ifFOOzLhFYI/s16L9JbL9 s7nTmMXNnmRjdDkwkC5LAq/mgqr/uaV9pYXZNnDyR6cRgcv2wMEOZeNrTWO+fS1VAFF2 97AA5n0d8XubxOcz5t6jPNECRoASNyS/wIxrp0TCdkrQXLDuUO43O8qhE+2Q6aAeYgcQ FG8hWR03QVgGLLyUqQR3GOGa/RiJTuRfR5aciXYa47BGFwLIpo80Ff1NbJ3gbkb9Vcf8 H7eFx5H5Jxmb1a0iCyNuxlJ2+b7A9lbDl0fXUaR+c19iuBMOVBbxr4uDdPP1BGXDzTUO jA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc84ss3fq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:17 +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 29ML0GQJ016347; Sun, 23 Oct 2022 03:04:15 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y90n9b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jZ6dq+PnL7+e4HxcnADNr5r09orQCIbqE+KVW6mgz+tOkonVKkC9KACkMENtwYUv+wI997GiYXom0xu7SHyCAPc34rtkpJhDX7pW3FWLjrXn6lyP1AyeeiPY5INl+oIBxb02YH37QABXMd2UFWy34gL0xq60JKtnvx1hVyN+laKcltk9m6CRQfjd4nLI6VhQbL/LlPId3ZdWMaYKFykLS6wAczeQJaOqh+4Yh+7KtKLslIUHoeDesiO7jJefMcBQMgWVW3ey8WJoHM1boIRpG23/3epK3iBvXbLtR1mZ+j0lC45X1fu1/eNnb9zQbiI7D/9mDfd52fUq8HKDlqO1iw== 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=gLJqvLDnoM2LAwyzuFcx9nVzpbqbINSt3ruS/6SUL1s=; b=Sot2U70mzbi/tFWI/OR5rL5wmRJcN0XsUJrsjcVoxP7CRJRctgFSX0noNxHBGJmMWhwkF+kip+perAyM4aNPnEp/CmjnlXfJkInBVe+zCVW0ZkoMdKozAS9M0IBAbQkdoXW/2pkOF2cYOo4xxpV2vQCE4UijYmi+pRivxIaQc8J0cHWr4dRz4CvqKUNbBq4LrbnNFLfr13kGS2j3N/2dYX9cYnEgltblrXrsIRdfF1WiJ5REYzQVqnmoE1jagCTyepRwNw+d5k0UlyGPpn2u59ooHZrneLIgKnte7CzMkJNGp3CMTqSZv7xCQy99hR18nZWDAsQ0mvWENFGGQiIsrA== 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=gLJqvLDnoM2LAwyzuFcx9nVzpbqbINSt3ruS/6SUL1s=; b=NO8762vAfUx1ryoHkwkCxvrS+NULaYMG29PsVk+34K2buo8yEDdKEtQHA6MxokSTDiCFleqS3QCV11f1HzTMTPAFdLYrIQqKLrjs8qRRNyutHIlHa/L6CFqhJXKDjEmkGUReT5QjcT+kMNyxVAinelayiiWnHol85WcoiPypfLU= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS7PR10MB5150.namprd10.prod.outlook.com (2603:10b6:5:3a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:14 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04: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 v5 05/35] scsi: libata: Convert to scsi_exec_req Date: Sat, 22 Oct 2022 22:03:33 -0500 Message-Id: <20221023030403.33845-6-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR15CA0017.namprd15.prod.outlook.com (2603:10b6:610:51::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_|DS7PR10MB5150:EE_ X-MS-Office365-Filtering-Correlation-Id: 9f48f67a-5367-42fb-091e-08dab4a34402 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wMNSw4Vtem9vnOa/2NySBvdOE2kBbrNHQYwCrhY5RPaRyQtOZEG5XqPzENeofIJutJ7+9l4nFYoe65Xs5EEAS5/AdPqk9VDuP+5hT02ZKij+SGczmjsw4ZWzyDNbveTc8gs6PZpTPSYbi3A8CjYZqFN9lmrWGrPuxW2cn+w7secZLC9j/bNkxlvx9CygQuCVZ78zwJXnKGoYlII5nIdoKchW9Rf8N862/5wJivAc9xrFohyFGMkB30hpzvHhrarDL0Jsjc95aSEPfEXzOL/P+GtuVgeOcbgyZsxaEdgjKcg0BZekQyV23y92wqq8r9/pIc6SkB2ZnDrS1XGyqMDnpWOEe8AYSpIMU3xHQJIBQm3a5sjwqLxuk7iPcpKw38kEzBNe8o89Wo/8e4mKfO9Zd3OE+IvTN3GL8fNHyBJLdNHboKanowm8zyEfAHMBIZhWSHjtame8p8vTAOCJKghj4OdceImkZcA/e8T881nabtnNNYHduUPGqWRrETWnNRjQPthY3db/AA/4I+kXKNqYLQ6SNNLQV7HifhvnwtPxB7thRbO0w/b2n3gyJWtCkLYQm4vHYxwwVZjLyVdoAjsRPROyzCucwK0d3TShKnmlJmHYDesUcmqMe84XKgZEQxSObaIZdt2Y1JUHXv7pkfC7c8VV8Sn5kBftv7AHrAxuMA/f5WftDega04hI85DErV/Lnad2C6B6VmnXFMK6ffSqBw== 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)(396003)(39860400002)(346002)(136003)(366004)(376002)(451199015)(478600001)(8676002)(4326008)(36756003)(186003)(1076003)(66476007)(66556008)(86362001)(66946007)(38100700002)(41300700001)(6486002)(83380400001)(2906002)(6506007)(26005)(107886003)(2616005)(316002)(6512007)(6666004)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: T9mzQ93nerBJmndVcrIX87yUt2Nb+H2JttKR+0k4XP6uQfmR4PyUTMphOrayMJJIq63Js6HWO4FU/UrihP8b/U+yhyVh8mZh8K79Pgji6R0+F0uIvusbD25FPJMTZGaB/9pSFodBoneZHaM43WPrJqsbetCpHJoTsxnTSW2f/dtLjNeUMbUw1ulbL7DwEIGjIt3zDxfw35hKacyoK5WhOgTUq2xnPBLk9fRnkvXhKK4tQEIAvwi6kW375dFj3dk72C9zTXVu2aDdCJhMYwrtbFi1sabLYCpn2W6P11W0W6lPIu7zMFYuvlhxymuBSMWZ1Me7QAHCJ5CgxXLEelPvvb8ttKlExdWXp94YERk3Pm1KsAM5vq9k1Gi7apIgmXCb2FjUihSunhmNJBjNTxbvyap0F1MpgmjeffiUIshqS7WdOwMRzN9vroymgovgRN8iirvSAF5uKXm3i2r52VZEhTLJJtENuVNT6vCrlwa1xj54+onVdCUSu8M8rebyUBdp3Klt7ouhxy76sOHW/iHDmrc7hijvBSKs5R1yLqT2phN/c9I8/4N5R1d7v4U4haY1VPC/o+bzIOacl9/DdcPYB5bNpN51et2oE4rcvzhBFvoZys+X6QePTN9p+62irw6UF1KWapKg5uhljOGLHEjjy5ZVOJS2LliwoZtq6XQsugbXf9BHSXsAkYLcRxqHU9dcylU7nnFGfIRqlmDKCcf0P+CJZNEA2TnWb8uiD4wbrisTV7E+oSMrikjVhfrnf8SEvWCX5AR/RArQIqwtfrSJGHtPjyeL3Q9HRQHB+OgnPBR0hxtJSFWeXQSDcsaBnEZPcouFzRDWiUcrKE9gC7JQGVZhBLZclKNzzPTEy5CuutQTttn/Wktb/sJPYnmAiCrAo1K1nDKZRF6iZnY0+ub+v/A+DVOspOj1utRQxK1+gEHJ/mL/Rc++bgD+dxglk9BgsOiKgJLg66/mmHsCLbC6Ut/D0BKVkAvKfAt0xq0i9VJl5DI0ZXhy97YQW48RZk22OAkBiMzDA3ayC9cRXb4CJexFGNfYlnHexxmHGF0u6vCHqHR0ruEQxq75DwwKyeuBcAfw6CTvMuGJL5PZR8cKclFqzAvk8I7UIvqmis6+FOF7qIF/nnWvCkYNzhIxXPXeB4VpjUjSR6PSQ53oWoeEAoFH8fKbnyfL6/MojQwyZLcwLocLpkXr4m9LIWtkMQTA14O4Qk0mOFwjp2WDcLRMFZiDewZbTQ6mxhWKY8kMZoz8p4HGnJKdU57K+MoDqKUvQghrk9vqHTP1EmD2QOoHV50QjgSwzNEt2/YhVr64cqxbmH2MTSJuFJv7PBjnhHXQlZZ78Dm+IcSKW+27ScRYveoYtZwfAZablbpPq+bfMkmvl96uKAHzn7PhpGoIxfp5UDk84ZrQ2V+VveU/k9TqJO/W8DwUZoYLBFb/AiynHAvIkZ7QyIyrGme57E/w0FaXUecJCrLJk+AIImwjTUdJfsBQ2BTguGKqfhEyvEXx2oornNgBXs45hZlI1lFnLiMtaQhOVl34cUFuyM5Qjc1GH6f1fRPkiN1biB9MbGnaUmER16zrIzUw7TKX9Mmiopz4FgWckg2a4Ie/llIoGMiN2w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f48f67a-5367-42fb-091e-08dab4a34402 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:14.2655 (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: 7MBriOVNPpIiYSCnLu7k+DSaiONRd96ChSOw9Z6PHlMkK0Mw0mI/XdWfodZpSG6SHlLnI6Pfk7Q9/3G9DeesF6s2wNbapfgZg/A1OFekis4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5150 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 spamscore=0 suspectscore=0 bulkscore=0 malwarescore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-ORIG-GUID: OOZ3ETRhtBPlIcxVob7JR_WvX4rvssPd X-Proofpoint-GUID: OOZ3ETRhtBPlIcxVob7JR_WvX4rvssPd 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 Reviewed-by: Martin Wilck Reviewed-by: Bart Van Assche --- 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 e2ebb0b065e2..3057f703982d 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 Sun Oct 23 03:03: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: 617796 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 67DFEC3A59D for ; Sun, 23 Oct 2022 03:04:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229756AbiJWDEn (ORCPT ); Sat, 22 Oct 2022 23:04:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229964AbiJWDEd (ORCPT ); Sat, 22 Oct 2022 23:04:33 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80B9926F5 for ; Sat, 22 Oct 2022 20:04:25 -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 29N2tKAl015631; Sun, 23 Oct 2022 03:04: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=w6ze2qNHltbPDGym7a+87QbyUKKhBwuwBnx4llIGzf8=; b=WgWq+GtkZpL7wuGk5MOLq+16VNyKvsTFkdVw3WbMx2h+iC2vEy4qK6MZtjGfBwBKdM7r IEyy0JspM8WAP8hTTZQHtvzKTqJofadQ71K3pP3hIEnjOAs/4oneH4UFGamxr2ylI/Dw W2OlFb+0Dza6O//mk/6MO2WIqf64unoln5tI0jH/MniSdoxmPUITfXjpWgCoxZGEkryO O989NOpryIi+M7y93EFhokFZ7RgMwdEovqbShMyXntblhBdv05xeDOiwTtN5L2tkgLs/ Z0AQurdJr/TLCBFxVXoBismwTuuFppDN/ZWVw3xsieFN4jpdOF8luUM2NR4dfmEyp3Qs dg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc7a2s4pt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:17 +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 29MKH3su000972; Sun, 23 Oct 2022 03:04:17 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2175.outbound.protection.outlook.com [104.47.55.175]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y8gryx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MQexT1yn0tFjNlT8C8UgFP3twFe2a1HZskRpqY9E7u5/mqg9F3aqo24yJ+0lBsrGPe3N4/nyiIvhg8IAYjOFRjkJZThIYfdsduwX8H1ghr3qRvUqx9cZOTJ1THQS/NP2hq//dNnL1aZaQZaosaegmzivsEtT3xd/RoQPgkc8MoF1gLbL0ISz+hhyMkDPmiZtlciIKSftR7dughuG2op2qUc6Zw0KRm1HrZ3rQNURfdkfMBoDjAJbPvvcY1IyrvZ00OwY5k+5cjRvr9mqxpVHHhVbdlCAZIsHXSLEZDD52PL0s5+LfLC/HKzsRg5rwrv9puJkOLFIP/YSck4LRo4xlg== 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=w6ze2qNHltbPDGym7a+87QbyUKKhBwuwBnx4llIGzf8=; b=LllKifzDZwWqtzc/rhUYOuBOUK5YtTwwOybppF7jsLvcGsBgX2MSShh6TJ6Wcm1gxnOv8cFBv+ZPmm9FC3BJGFfQfi159/5NP75S9zs3cx4uxizgDUZeD31CaTmqUMeRBdJKiVNsB/Hh/6norKjmRS/uozdq6rmrv3dJwJPRmXiSOhjZ/dLAXlppFu0IJ6WDd/0xNSU3GUzqnDlebv69S0At+IFN8JlB4X1OoVlqJqorwMG4Yi3WkzisgHMi6dfmFmkjJqn7FC8LL7ZeDZLcRwGA7F/6yoBqZL+A6fuIhdKREpcgDj1ck/nMFwpjhCSz4euC2VS0pJR3iOpmwSghnA== 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=w6ze2qNHltbPDGym7a+87QbyUKKhBwuwBnx4llIGzf8=; b=KGHND0B4B3oa6P11O86ptRM9ESRsV7SGIGxdTWcm0NjSgAwPFpdVDE+vgOWxVXSYis3jbNuEoFOeZOGUKbJ3AaEntRV43Dri+iWKvd983TkN1ULDz94Z/26jFpJqQBeHSrRcDlISODHAtdlDAQytiq4gUPBIrSZut5zKNbsfepY= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS7PR10MB5150.namprd10.prod.outlook.com (2603:10b6:5:3a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:16 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04: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 , Damien Le Moal Subject: [PATCH v5 06/35] hwmon: drivetemp: Convert to scsi_exec_req Date: Sat, 22 Oct 2022 22:03:34 -0500 Message-Id: <20221023030403.33845-7-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR15CA0002.namprd15.prod.outlook.com (2603:10b6:610:51::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_|DS7PR10MB5150:EE_ X-MS-Office365-Filtering-Correlation-Id: 474a4a0d-b71d-4efd-443d-08dab4a34527 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y7snAkhzXf7VY8pEkr5bkr6J2pLwz9xj9o6PfMJcfwdveXM25pXPjNleKqo3p7JrUDZE2vkVnqmkB/ygJtgddZiBLywBioFdFJYmGxxRt1QfZbxTxLNVPRe6DsSzB7MKsjYPlUJExjdSKrT8IpPbRM9gzdLPsjhHJaY6R48EsMPiORJsZDCgvqdanJDN+Xdv3Tj2M+9/AXalGIEBZl2ZDP9fpif2d6hAhOezNgtf04RivZ7+CVBh2aWoYqjc0rynCEq+0z6pn/CR0XNdqyxqFcBGBTpmV5OrwJlC5D3o6Se3kc/Vjj2SvdTGlM4jbG56kUOOWlWoymWM6BU6w9Lz2xxoVNM33TVMr2Qspm8cA003FczSRVljjvCdY9M+cLrvN4jrzLx4SAzqCm7CAMcUQ/o3VNF7FtXVbCpW9IuwtaBUU0muv2nWolBJMgUUaQNSrIddPp6ptujVuP5KaqaftvEF7GdZHyPH36AbbZDwJd57hyN+GPJzY827awZsMC6H5gHSgTbu/f68+sVSEMhIslZiPz7j5eOMEdckvPVc42q61TXRjKZ8le7fErv7rVtl7VJjjH6nWtDzP8VGEwYgHq/nS6LHHq8BHJmMOl/vm4M2uIjFJTL/O/rc/D2meeCC18fGsMj16yjYJh2eglln9to+bu2Si+U36V4GWhvGC2ph95JW0LYbxYmWGgGFFonGA0pxnwkQU7AiDI6n3X8auw== 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)(396003)(39860400002)(346002)(136003)(366004)(376002)(451199015)(478600001)(8676002)(4326008)(36756003)(186003)(1076003)(66476007)(66556008)(86362001)(66946007)(38100700002)(41300700001)(6486002)(83380400001)(2906002)(6506007)(54906003)(26005)(2616005)(316002)(6512007)(6666004)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vZ+Omu2jwdA+IzSAunnSnqkWEnOmUrEmorcZ9amrS7AE6+aixYIBEaVMY4GrImuQP1r9C9sC59HImxaM29wJ5+V2DXI9LgjTmW93kP/VL3UCTCElq4uHrhGj0SQLhFq2h0Lz/b12QKz6LDbVYDFIKj8QtNn6gejgGuFb89/KmPUJfDpsXepDSEC88oDtnUxr/WMmPlExhZ3q+Wjpa1xQ3sTHTWJZwFbPMPI36wtctEM95pN8ztQUpy0Hqk1RXtxlHdJoHGF3pVqwRnNyNOG6oQTIIojQ0RYApFGt9pHsL9rlfcY/6p/XMWeNtrHg2RfsfPmy7WAwHyf/b0tL3JzUPu0ZE8L450Bs78dqCP1kVpO9IRPSMUfq6Y6tCsN8e8EjeqGltBKgiLuzDZ49zfMFHySz9EnMDPi8mCZGzbdnkuVF/iGmkEh4HTlU5UQkJ08wALgE4wyJmO/6LJhr4kmEFI6ucrIHa0clwO0nyTubFwueFiBd/xxPgfw/Zw0K4hYqP+nrond0gSStHe/HIDvmoHx6EjIVlFv8P0Lt8VKCTRvD72a6OBVSxAPUOxyKw6YQSY9/1n3MHKoCUuS1zt4w8ynmeAhAhVfO5jXXXJIJDdZIwRCXdArkdeGC7XqfzbhB4Wmge9F7n+nUKmiEuiSwu87Z1vHlKxlfsn9EDlrrilP2TePrbFFtuwcwKXl1WuflPZp1w8G0ARi+8/3Q4E/ZzC/kofsKn8kfOuLbHg42kHPuXqr8M/4kzuKGDrSWQeOTd6tn4l09Enuf/wkC5OtOoP0jveEzLOI5+YGuD1bOjUDkLFNiha9XwrLtrI/9RY8GmSymBeOFx5rqwgry7zkc8D9Z+b/h6A+vFvI/OFEAJEpCXVxBr7BKCa+3QuV5+IUBO7nTodNCgsyeVW7fnIbGen5Z2aBKcYPRWNcTW4CWPA5Mj3M9zshc9NlLCSkBsQW8arsXKMBXztW3xhvLIFJXEj2V8C97bN0PvyNerOmZcEpm8s54dGvxoRP4/CZ4DWQ9n/OiCcYO/ryddJzBeoxGFGXrz+435cg7BNTL/fL2viR78WdPn/brvIvbSYpeW/utMy1hdM/D26Qg2MUUr5KyUu2yYN5ARVPoxjvlXGkz+X/8zgZLI7g3TfYRXQe6HqkRScFtcWUFCYIaCHqZKX8JsKJfYyqyVk0Am+mivj1vpheR/1Q1L3erdLbaYJMPyeKKJI5juWXI1puQvKwH8biwESddnyU4I77cy8RR6/WHkj3poPV26pEN/jSlazA1OSkqdPnkpt4wWnxDmGH4v7YJ/0LWYWynwjEHO6vJud0U/dEPVP+OthV9TO+rxpycLKmxciDTdzh4tMe65OP/5Bx6z6aQ6FgjZbfe5SyXIvcrCCTNlAPcys1OwHKNwHUJORnG+dANntKLhBPinecm+FRDroMnFGj2QyPqjaOn+279xCjdWVw/OOJQQ91XEpc1zyBClCqTEu8PUul1WruL5DfqcKrFloubMZnDdr+0ew/meXkSnJx0Y1MEhncgzoD8P1i192w3N/rCr0Xq8nCSruxvAcLt4HIj18i0/VARRDU0rPYP+uFxMLpbOR9xU+Xq4yhrrVDisPnFWD80Vm3w4BhyyQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 474a4a0d-b71d-4efd-443d-08dab4a34527 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:16.0310 (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: qJO5DJz/2dqIEPK6K1X01qzawXYmc1gAUBxBpuSmgK81e0X7gAzlQU/XdCGVNaafONmsPDCjZETFDiGxuGuWrIw0nr70Gn03R65zo2VV/4w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5150 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: UmlcKa2gXX8D5JopRz0ZJD5TMB_M9_-k X-Proofpoint-ORIG-GUID: UmlcKa2gXX8D5JopRz0ZJD5TMB_M9_-k 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 Reviewed-by: Martin Wilck Reviewed-by: Bart Van Assche Reviewed-by: Damien Le Moal --- 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 Sun Oct 23 03:03: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: 617794 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 C0872C433FE for ; Sun, 23 Oct 2022 03:06:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229973AbiJWDGd (ORCPT ); Sat, 22 Oct 2022 23:06:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229967AbiJWDG3 (ORCPT ); Sat, 22 Oct 2022 23:06:29 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D916263842 for ; Sat, 22 Oct 2022 20:06: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 29N2tKAm015631; Sun, 23 Oct 2022 03:04:19 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=mLO3Spkew+E+i1LsX8SIRp5psan2Y90s9P0m1HdmK0U=; b=mMZ4w6RmXl56pZO9uQeLFLKCzbklk3LGx7X/WGAy4Ne+q+nfqbvL5QZ64ynchbOqhL3P XLj804t6vhWfCNsdMDhx2StGQwsf2gzY+meNAs+nxazUkNGjZIaMNs96wvd27xG3hKl7 usZbA6iMkw0wPWuygk2I5FZ8a3F3yE1NgoyQjOGoTj33GG2HzmsCQa3OicfB9TpPTpL0 e883r5vD7owvaKm1SjjTzYgNYdSfULktTACgIX++HreKWiG9jBvueexMVgrJHbNjhSbc ew0UDKUR0R4C8ygCIAEEUMlXJwqYqnmwVJcN5LYEOfP54MrO5UgD6RzZWpVK6z9C/4UQ 9A== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc7a2s4pu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:19 +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 29MKGd2a016377; Sun, 23 Oct 2022 03:04:19 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2174.outbound.protection.outlook.com [104.47.55.174]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y90n9t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h0/EMrKy7yHNfryj3UkSAjkSbpIfIzkq6YqTbjpHCSoWhrfM/1ErZZGZHg/j5P+hHLp8eNXvBT8mfnbW1M5OSbbZnejX8TgJIA61ltp6P4r4EAQrF58+agRZiMfKwqvovZqaXZJGwOSazkiF6W+uDWvHjH/T1JWX9uNrsvl0cmOYeMpa8hlwXnDy6V/DRpd/q/feoCBcZGpQIauGJj3yCa+yduaPyxx7R2tmBp7EmWMiQGjrmPPUPSVyqvj8RNdRDs1I4PWJUDkR7qVIt093JtJb4MGPvKdp0oeV2CX0CVz6bMgV6nGhDOY10E6PB0cONI7yTDmKaITYEfJrAo7fwQ== 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=mLO3Spkew+E+i1LsX8SIRp5psan2Y90s9P0m1HdmK0U=; b=EBYrwkLoT+PqcYgwXkJ4CfJWFSvXin13exj3lUATBO71ZDwkodS8v2IzPtMj7RDmEwi+xR0Adbraj0Qv0pnZbpplCgCPcPjRMKKhH0myQmG1oQQlIDVxuJjyIDO1cBHPQ231H2WURfZgjxLAn6263TF+pSnrmNvlI4mJVhOZcNbTDEfJosEc/lMIdrYoiyWe71pYdK/JasS4ruPengcD3N7DzPxKapeBhBIemTP8ohL/HEcRd6A5YFdWFe7oREJSjGzX+d5timuZBlM7oclXvncMKc/aQI3mL8VyiWbu+rrwRYi4WnAMFrlqHuXmdJKDB+DiShCIdxLG73ngkRhe8w== 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=mLO3Spkew+E+i1LsX8SIRp5psan2Y90s9P0m1HdmK0U=; b=MvMPlcYylFBEqGuZF6JLtlWweGu6ZcJo0+6ghQrFZZlQmZY8exYxBULupgf0xaaOcJRGoUmZoG3Xh9mFZtQzMVIE4FT6HUNYvBofwAkAX9Y3mjsTa9zL7ZePt1m5P0ajjMT+j9xxVWJT1UnGS1BlYWlwRvys027W1TWhz97qSVY= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS7PR10MB5150.namprd10.prod.outlook.com (2603:10b6:5:3a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:17 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04:17 +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 v5 07/35] scsi: ch: Convert to scsi_exec_req Date: Sat, 22 Oct 2022 22:03:35 -0500 Message-Id: <20221023030403.33845-8-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR15CA0028.namprd15.prod.outlook.com (2603:10b6:610:51::38) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS7PR10MB5150:EE_ X-MS-Office365-Filtering-Correlation-Id: 4954361f-f71c-4bbe-4821-08dab4a34613 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MmdiHU2gpQfrjpK0P0DvSK+ebva4w5A83LJLRSw9PZMhGmiyRIPVKEVeqiJibaIhWR0p64FiZA9Y7EywJYU8XZ4FxCQsJXTOiejV7kY7kitJDDET6cbM7odipcp4nLVv95UmDDTjNYJfsZ0Zkz4QTqTMjr7t1Fx9jaVS6P4q6Wq9B1eLSQk3QiRNyxOtj0hdx7KJPzNPVkElDtsICT0PziiqrbthwaNLhvKzkk0E/ZyPtBEsQQInUXfaH9W5wiikh7+sQE3JfcpeEp6wcCYJunWl+9aUAWwMScgZsi/15FNK7kRtkWAT7e89OaSN3bET1W2u5I0+C58tiES8+qKrEVlRMUEGz8CIRveGdQbt0VHYG4glf4lA/GT20Yiak9+zXMvaHB9zjut/ukH5mjXpnp8/XrjpE8AUwLC/aLCM6WfbvVifhoHY2R19YPNl2UkdvgQSvSOaoF+I9KbHVaKyHVSxcxKzFocXiVie8Ap6F/TXknGe8uRaJSorVxoH/aWyZET4xq2gRmuB7Hwhemj0u2Apebb03b2b8o/Gk14YOv8LXYxSx602ZpuANIH/ozbZbfBvV6rkNh9ROrJijH9n7sdMlaqc8Vo5oH9W99uBCkKMIZbF8vi1dLQcRcDllmvK5bzmklhBEHU+7SBYfVv7/pElT1vI6Q3j5itd7cdG+XPqyzKGevQ3horOx+qmutzNgVH6NrZisqrIaEqzC9XDHw== 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)(396003)(39860400002)(346002)(136003)(366004)(376002)(451199015)(478600001)(8676002)(4326008)(36756003)(186003)(1076003)(66476007)(66556008)(86362001)(66946007)(38100700002)(41300700001)(6486002)(83380400001)(2906002)(6506007)(26005)(107886003)(2616005)(316002)(6512007)(6666004)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: N6f/2dBuQXipQry4FcoYuz7bdTLdlj9WutLnkXHuASPVppC4ThHrTYy0GZ5sPhY5hV39PneLovznzeyT8lCmfPrxo6uZFW1JksbTKpB7DHvzJLqC6/Gag01pXVF1hwwqjNiYu9l7orNKgtRFFG01awgrkQ9KOyrCsqpafqUCupfUucqEQDgGj/NxLszhADbK19W7NnrqivNoNNYs1NU3B7Gxy771uAoI4VKRZuO5TiUiwMPhRK63GMehES1HSLXnUF/qZbABvUZvoYkTHtfm6Jd/1F0YAk5mDpttnShuoeRzJ63JkxFCETsNgj+cXsee2+Mh2sZwg9+4kMWlnGmRjfGgMosWHLecGakA3IAq8f9Ce5l6EK3dMKOwTwpDeL3aR+d7CvsB+evjhCZdECDVkVObJbW3NAs5iQClnP0jBjyTOxuscDn4YRJ3DGSMwZbR0SK5uwqrIf6xvlt2hUfhSi0aPZelOHnAoodHT/W5V6v+2ZU54gGz7j8rxu6WvHJIuSkr6+kCRppGSF3IbXk42t2CoN7oQ7J7y0/tF89vgUgx7EQ8TV1xAwjiEorgIadONSc8Tzks3x/NPMbPyNg5/3DSZ8V0AH2ZHgF0VT0hqE+ubvrhom8ULKaI9o78GvoO4m8CU0YL6Pz/Y0PZJ+X2nYm+mh+oN4690J9Z4e4ie11yvPHjEVdHdurmIkhgGMkWhbHKEF9fv2HYfpIDXGIWXCYbLEjpvEM7o83q7NQ13dJKrXB7TM4lZ14sRtlKB7LgQNMZ2BfOdZxDQFyuT3aNqgrwyXPBjuNMoymlCg6wdpmLjMPIovAH2qa9vMNgAHZitSekYc4QLlktDNgmsdwH7d/o8OZ45das6jVb38kXGES3fsdval1XJaRxvFgZ4HzjghVAE31l9nOn5lkphWyoSXm8UEn6JDRloLlEWuw0l6fXIm6CQh5m/YS6zD4ROMxH5H+F5ks4d0+w7EU1UV1SIwYm2cdZVstGiBFqWnKSWYhci7Kdz29q6nqQrc7Ej1ZGKa7e6+7Sh2QfZbNgPtBPYwg/Op1npqOPvMdET6AO7/KT1OL6Wn6Ji1dJlwPDlROrNjtQCGwBlrg6CUGH5mqFw/O2JmbaalsVpfMbVqI87Za1mECgle1qSFrWuQOzHZzP4sGHLubWzkNlrwVHzZOXcbaK+vVoCr/3ySPwIEUsGNumCeEgT44D7YnTY+gZerfGjjl47DKnLZ4a7hcoG65PNBjQA67ebJx+5iSR7u03lvgkBIar65UMV0JljTuezQGFBpfKk0M5rsim/oNE8vKaz8H8x03Stvgt7GGsogVa97vP1QVixIypzncK9O3jSQbX9MQfdd2nQADeJsvyJAKpwlDNSttIJwnyok9MuKY0h/yud7nzQ0on4bR/6GDHaD31GGgnVv1zJcpWMeOPcxzTwxkaZKsb5nopB2lS4Au6EcrVMy2OyqzohFVij74MjlA7hEnp8jwxrOV2aVCa9HvtK+MgyCfHkbLE8LYzWyjsAss8HAlrraiMXbJl40JQgKq7NGkzy7Es0nDZMqJJof5REP+FBiEMkc/ODm8VzxULIrqBrhp9GvWKFx48A40xZyyNxLJvUdUwcz6eczpDK9cYig== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4954361f-f71c-4bbe-4821-08dab4a34613 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:17.5934 (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: shqKzkWGGL3agbQ28x4wYLpIHYJv6l67N5iP5YRjtJXC2Mbw6LFi1qlTIhBAJGv3AC+boAAIsFBlseCnKqVkS/RV5bmdkUrS8Rc/wcVbqIk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5150 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 spamscore=0 suspectscore=0 bulkscore=0 malwarescore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: eNNpqWPDBKIsMSuwUW_YC-cqTbu1hEhK X-Proofpoint-ORIG-GUID: eNNpqWPDBKIsMSuwUW_YC-cqTbu1hEhK 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 Reviewed-by: Martin Wilck Reviewed-by: Bart Van Assche --- 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 Sun Oct 23 03:03: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: 617792 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 B41D6C04A95 for ; Sun, 23 Oct 2022 03:07:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229987AbiJWDHB (ORCPT ); Sat, 22 Oct 2022 23:07:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229981AbiJWDGe (ORCPT ); Sat, 22 Oct 2022 23:06:34 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25C53183B8 for ; Sat, 22 Oct 2022 20:06:30 -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 29N2tGUS012781; Sun, 23 Oct 2022 03:04:22 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=njWcjRm7rRVDU92EVjdVekYdbKtw8s0S20ejH0HXvtA=; b=H7+kvl/NfFkoG/j7kRm7aeJ5VJgray9IdTXYfv4k3pkF/x927ZfSV26PRy1LVFbJX91d XXeAeIqMU0n5bZcnQ2QHm6Dl1N+zqnfhLgSvHoUDJPiODre8FeZDFLYu5D7dIEo5ItUX R2ZmlFDkSMwoxEQ9TmAzFHwsoUQ1DklUVkjLlHAITpR4pM+PiBJ4mZ/XjMCbu82AlBZZ Vri+eCtjC1jtdDCxfpqsy0VgozMUbIqryzFEXQYwrR8RXJvlvXAwCHqWDXVJf5fZyk1u GXFJFnzB5HYGadg7H29Z9DL4ln9Z7/LEdQznstv5szbze21jBrQPWYyZ4GKNjpqiCFkW Ww== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc84ss3fs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:22 +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 29MI26um030662; Sun, 23 Oct 2022 03:04:21 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2176.outbound.protection.outlook.com [104.47.55.176]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y2ryx7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hl/6p020bTz89BdPKzoj8EP4NVtYeauE6I4Tx0qHpllZKypyh/cI2dSPtRBtFQVY0ROKihNUlm29AQLoqowruVZPZn7z6ea7IyNrHCtaAnXuF/r+tT5JWL5Q2I/eVdZtK/dBomYXMyHbzpqfeunNmYSXhDRI1kPXsRG46LRAgvIHhd4Y1ivJu14ueT1xUGBZvz2EQksYTattRIBTKLhFCTRQjJRm3dywSrcKmHkYNtV8LPKrYlJ02zJ+fESjdHhVFa5sQHKLyOLqD78LxU//DESnLTdbEThhrbeD3vrdg+CscAk4lYQlovHZZkSHAD84TZZks0BZX4b5a+5LemzWGA== 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=njWcjRm7rRVDU92EVjdVekYdbKtw8s0S20ejH0HXvtA=; b=hSExnWLgdyBdiwMikQmHpoL0Dcnmglvb9xAnc1xOD/cjZw9t02+RmzYR5qPyyf4Zya3ELRvSmsPE6ul/3lXYhE64tRfPIUwjAsA94QmA8tp2Y+FQJCU4JxChiMsTY8c8ZlHojHCct3h82Q8sHk6wk20pa22x9odjFwIA3Slxf52KygAZMHcOeJw11cqV4VsLc1p9wxkU8LUw28oGflexh3gotlNUW+dmqLNVx0cOe2dlWtCzCYTLs9lSqLMXYgirCDHLBSWEM155WtIoV5FD1EicgEWcb/o5ZIRr2o3aywSrhxoi1we0JGl8hlo9Munatwh/ql73dJcL2lPMmsI4oQ== 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=njWcjRm7rRVDU92EVjdVekYdbKtw8s0S20ejH0HXvtA=; b=YA+XqsoSjWvoQZe98cFuZntae3+JBf1Wqt4FEHroZKFjPsIXG15cRW7P+OsJjUMOI8HiolRFJJGVJMOA6zV75wTVd0KLbb/Mz/xIqbUQ7a8RWM8se86OQ68A7BnQQF9FIkppycPVnXBUDGyBUgu7/2XEI0x4do4+/nd/Mjlorrc= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS7PR10MB5150.namprd10.prod.outlook.com (2603:10b6:5:3a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:19 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04:19 +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 v5 08/35] scsi: scsi_dh: Convert to scsi_exec_req Date: Sat, 22 Oct 2022 22:03:36 -0500 Message-Id: <20221023030403.33845-9-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR15CA0014.namprd15.prod.outlook.com (2603:10b6:610:51::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_|DS7PR10MB5150:EE_ X-MS-Office365-Filtering-Correlation-Id: e7aeb8a3-2bd3-49e7-9be8-08dab4a346ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 20mJ4chXskS+78jmCyFlEpuxy56VBgE3mm5cxpDHhcLc098RKyhjEGbHVDKXcbmLnrQTten9GCJLs7UcyhWN8D1vgxICng455gaewRSFK3ZWJ1hWl5viCzXvR97KKN64MoUz82xefE9cWqWF9h5Py/0UKHjga4ZcO38vFLXq1GInaseh0mHtzWqcCn2YsYQVxTrgreMuv+T+zrDxT6gdW7HWargVR/d1kMjJ06GUlM4MKiJz5Id54NTrWJItq61Vp6+ffeAygAuWJE971xuVDr4gyegjPKjee6M4E6HHoczoJCrvmcWzszVfFjvbJhlNwFYPK2wDxpWqz95R2uvF7H3DaEGGZeyv4jeUqLygVcO/KkHeSGmF8dFjSTjJ5bfvUmsMkFiCehSKSiD5ZRQj4BHJ9XzsuTiJ6GBm/55Djj8jogu20Xe533P4AM54L63eWph0TAiQDpuqOHum6FutfIHDnpo+Chu7nGwkV89/RGsj8ZjjUCr/aqrTLbL57imNYUmwBsGBh4mYDnL2Bi8jd6faYooMoj8oYD42UoDViVzQ3SO5lwXKSfAdGp5Sx+mJ2gVJPIvTQSmVgHKP1oYs3lU05Rh5McvkX/iyvCM19fYpbbA+Cii1O3gMrJZSbl0gfe0pLxWSf7UYdd0P+6XQoUH/RY+VlIt18Nu1JjfZc3wqocVJg04tbjOqMTMFPKatZMTHqtEkrxtjko7ratZOcg== 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)(396003)(39860400002)(346002)(136003)(366004)(376002)(451199015)(478600001)(8676002)(4326008)(36756003)(186003)(1076003)(66476007)(66556008)(86362001)(66946007)(38100700002)(41300700001)(6486002)(83380400001)(2906002)(6506007)(26005)(107886003)(2616005)(316002)(6512007)(6666004)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OyJH3Q0/zF7H1AUriGG+O2oBYCdLcdguHI3vgb6ZePb5711Bk3Lpr6RMc4USlB0L+FB1LxPziIh8rYJ9zQnmc9jZI6AED6cH+8t2ZMbH5Kj318Bl31Q0QaZ/mzZJ/ph393dtol6kgHhCvjpqw3M4WF4ES6j1jyU1X2KG3q9ZMh0t+lh5XElRQwogFVvASseO4MJBlwg34uOx2HZwpnx1RHepWq8Wt0jZelLjcYXfAmI2ZFHFWQTJWygIWWX5VuBbPKTSkyFAHCf8eZYQvdizTzOS0tr9MufKgEAuqf7OvJadOB6/8f5g6e7R2jkW6fZmT8L97l9I4jESZhTmmk11F8neYNAjrk27HuwpdVU42+ErX2e5tNtFU00jGXUb+R5irF/4H+pTBZYGkv58ciDOT66Vsavf/fIB/OOxyCYa6ZQHwsLMlmZaBDWQY7XWECa0zYfpfvbDxH7Rc1QdlBKdSQ9mSYKEsc0tTl/g7soWkGN3HvVwjl7l7SVwHWr6CXqBu+5YLSCV2EgpxgoRJiVPo8+aMhW7xzyZV7+4Ozloo5d+zgJDmfF44EIt8S3E46qHvHaAG/tlCxcY+1zsQQKXRW8qExxrcKnQuIFTBSzvqjZcatmVGhqx4rbuN5mxE/j3TqwxqstsmTvxlp7X35ahxs01+L/rZKxRzMF0sLdXyWlZfKlPzsbQIZKYVp7/8NRsfb3MXoSgBUXHpfV/iSy+5ftOgOVEABUlPhQoyXyYdmH1Zi75g6AYtns04iCpDaJE4Um45GdizVQsbr2yMFE0HbOgm4wCQAvkpe82SfGQtmhJoTJbXn9qnYaJL9OUYIb7tGBnboJPYhSGyZvzBlvckcIKgd+qKmhdAUTos+jm0YUMxnUxoecA/lvY1EjOP3yph5+6JUWcJ9WKTsk5ysUgs09gAyl7dxqN6hQPMhc5FAUlXT28/BVkhq72l5j1pKzmqQvN2grKgDvzy5IJ/CrH0CptUu0pE1TcxOvV7hAvpVc1xfHiNwVpQjetmpZI00KznM0430VfG1JjvmbQttBpd79I6bhRZXRpWNQKZWNiTJo67BiUvHRg2hhN91q5D1F9NLS/sL4WrGifwJLvY+jJzWpXT6KbqKXQeEOrZAmEzD6pBqMZ2jCEyzL776UAsT7Nehj60TLYJlu3BRa51B9z3wow22p19PQChQo7F3WCnwlksc2uMNw1DzE/lKj+6NIQSWsEtOoszUKGpXX7lMDfp2Tw8eyf4SlSCZ4IaT0ZApGYe0hbqt06jmw0YO32m6MPFupLTd1/QTyNcE2bc+3ptC5aeZCn2aFBv2fpk72wklPK+E6HeXewqo0fZ6c9wcBDDKY11OmrCC9EU1fG+tChTv/895bG62GrreUYZAL5O8XT/9W989ARwj73MaKTAokZ4tTBCeho/ZrpqpP+eehj8dVKWJcxRYrf9L7qV32rq/JOh7dCpGDGfZTO3uAM+GAlp+hIvCHhTjm7FlfnQ/Ha2SYMr9QYtmvJWPWOghVFvwM4tYpMiG9ac6MlKXDKk1IS/FBGZuT+BYHzBmJ+H723up6II2ni6RenfPi/33cs9oZ7VmXIe+jObJ2aJTDJwm7OurwD09+KqP9q0i1w6YYS0Q== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e7aeb8a3-2bd3-49e7-9be8-08dab4a346ee X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:19.0307 (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: C3g+GAxjBUiX0vBc/rRqAJO8i1x2chW+CqOx9P/UhJTQ5g6Gf/htmCKoxQe2NyLh2UQ03f4MAQSRFn337OJITsPtMqAnsaoekCIBWsTY4MU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5150 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-ORIG-GUID: 0aU1HG0kigJ2G_tV8aSkhsmjr_w9wmAG X-Proofpoint-GUID: 0aU1HG0kigJ2G_tV8aSkhsmjr_w9wmAG 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 Reviewed-by: Bart Van Assche --- 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 Sun Oct 23 03:03: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: 617791 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 8B1ACC04A95 for ; Sun, 23 Oct 2022 03:07:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230043AbiJWDHH (ORCPT ); Sat, 22 Oct 2022 23:07:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230000AbiJWDGg (ORCPT ); Sat, 22 Oct 2022 23:06:36 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E021642D2 for ; Sat, 22 Oct 2022 20:06:33 -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 29N2ssKx014061; Sun, 23 Oct 2022 03:04:23 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=CXUz2yZLTeZd2IGr7kDd+IYyEIT9Z5E7aRKgFVaRZhk=; b=gyF7M+AKh8aPXM77Hf5nZe3OdjSnbOZPmsDRiFVlAH1C7LAbDl95GINmpXuZHclVr0Hd JSZtGyCFc+vdui5p9zeyE5/4HaMeH1IAupKr0VbM5FMniGL83U06j0bjSx7Wy66k9syN AkGtzEvlibUaIovGgb8Ympou/9GudgETL6Upm7sXVjJG1NYSaVy3agaNIB//1ycUs6af xBOBmw0AC6IdnVg1oPHWEwJCQHTBYGFQ+5+S/TMuZr+A5SdVH6IfPveR/uBbFy4IhhyH 03/gossuaJQpiZJ4eyoCUjXWxydoDhB6nTNz5+gK3zw9RcbNJFHiq4zzmgFVeQhxT0z4 OA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc7a2s4pv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:23 +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 29MJq0gd030706; Sun, 23 Oct 2022 03:04:22 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2171.outbound.protection.outlook.com [104.47.55.171]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y2ryxf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LHtr8eTqTKiipJ/0Z3brTZPQhcPzO9O02dy5t5+PglH4Y1eJn1x0vlBwOrus+Sg35ZA0NS/bC/IlSLhl7XXq1IZZJJKk5pPA9OYcdfWiGkOIr0i/rVoNs2Jw0sXwWv68zoeVeTHaQ0sVVkx1CoZYjSa0FTezuFnicPE3iHeGDYk3SfiyYLFkRbPVRuUwjq2+jGD4uYQYApGAbpeEAHu+sCr95F5x23Y1rlD0YttYA01NtmK+o6/KnkWxa4icbkU3TvafB3fY8P5DZ9gOBfE/Y3dgPjhFC27rK1d8vPTsXsHtV+z/OmJkEQdmBZb2mvgKMD/b25yCrz1TXKCiUHZnHQ== 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=CXUz2yZLTeZd2IGr7kDd+IYyEIT9Z5E7aRKgFVaRZhk=; b=Y/xIl9Y/781taNHrJ1/tN7Y53uBdTmGPgz0MlJ5op8l9Q0g01qGIGHnzGBsRNpnFHWscQSP6lbfZGUWqJcOtbvA9AxgOEGy//drsMvkYbyO/dxBiy6mF+Duc3Qyo8W+d0vz8XEvseE5I5ATQXKpeyd4cJqZ2y7jlmbwq85SqYugFzPwOnRmLFyMTV9cIZBamoM1FZOr81FWMEKSsHCfqiI+NztlBMCLIYnipDvJ9riS7VcWWDZJhNpVia2WV+6qcXoIAqqfWWNSPs6xYUSG+pN+i1PsIpoagZ1Qxx9/EiYu9Um4xjZXXUFuVMqXQbf7At6ZFDin8csbTHRSlPoWGcw== 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=CXUz2yZLTeZd2IGr7kDd+IYyEIT9Z5E7aRKgFVaRZhk=; b=BZXv3EHWdz9TD1Zq1aJ5T5VzoqKlHfjcu3ZpPp2tTxHS8ZNySY0RvnWMX4OtNHcGNZvVpErdQyhDA34Iv3slgBZEuLHsC4SzuA1UAPuQ1SUOvdQvslAE9pjasn2xwMNMmcsM6JiY/NXllqkn7drz6Wr03VUvPGQy39m+8efrc08= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS7PR10MB5150.namprd10.prod.outlook.com (2603:10b6:5:3a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:20 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04: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 v5 09/35] scsi: core: Convert to scsi_exec_req Date: Sat, 22 Oct 2022 22:03:37 -0500 Message-Id: <20221023030403.33845-10-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR15CA0002.namprd15.prod.outlook.com (2603:10b6:610:51::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_|DS7PR10MB5150:EE_ X-MS-Office365-Filtering-Correlation-Id: f9f01e87-de51-45ef-3d7f-08dab4a347d8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HHUDO5GIH7wW5c89jZDDChpa6Cb5s9LRpsRzHzYOk1u3MdBj8k8yOwk8RDg/uZZpq5NW5mxZjph4ji+7m46k5BEqCBsL76jE7bZZ8FdeKn8qQdOfVyokH9cGnr7FTq6D0gR45cO/KhbV/3QF8a3n5tMVq79+HrmGcyrZ8lZbq5lvkid2xZCLX2j9308/5vgNbtPCI5wZfj5frwG7ggCU9/B2fAnht13ZWc6AaXyLDAl3T74+5uKmFGj4ouMdPgZ6ZqwfE/cAVW2kIWZL3+rQmSjvXC4/jS0A8OZ8/45AkTFkLsqatZVZ6Uj1wr4X9RICKiUZmuStadJs3dndMK2nwOsCxIqtUCtm92SpiUEtvtU/uMizUXTe0pPysouh8fVHwKVSFWKcALGdyTZs8949Lhv7zpCd/fakqI4ngO5uPXSzYgiHchpqzKDuHYgbLn2RJur0O0LhrAeyvCRidolnfmiyufz46FdfyU31eHFdHqcq69ZrM4BWWNl/sWk9hrPwqiap9/na2AlvFprul8t2D27fIfoK9y0Nb/a6bvgci69+NeSEtJCo3R4AbXrwBz4Wpm6fohdEjvF1knccjs+fTNhOvwbfgbMRo331qYnOcxifFd4yT4GqHtY7HoZ4ESvFBH3/MRe3qj8DOtuCyV8Cgna9n029eObE9ZD7CFXzFAPB9k1Zcus4Ww5jjTHEznSWxyy/Q3jGqBfPzkrqbz+roA== 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)(396003)(39860400002)(346002)(136003)(366004)(376002)(451199015)(478600001)(8676002)(4326008)(36756003)(186003)(1076003)(66476007)(66556008)(86362001)(66946007)(38100700002)(41300700001)(6486002)(83380400001)(2906002)(6506007)(26005)(107886003)(2616005)(316002)(6512007)(6666004)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ggJbsfTwGBIiHBwV0ZRJTCj/NO7rbRX8zG9AuAbNwfCWshXag+LAhwiS3IiqWyLYsXUyt5J8hoMQTi745Xlm/HanIvk1c31lx73ee7j6x50VM3yAPmcmKxeTxLR37TMfPOJ5Ymh7gpLDdddxAYpgxDDt324tqpuAU1o8zirghJqSwNgSFEvi4jGJArzTSkmjoJZdxlym0KAiRMJsTxWmPvmBVvfMa7KoaY2CF69mKexdndtSdtpolW5ZXcF+BDI4K3uqdY24Tav3L5ySG0DIqqEt8gnotyUadW0cK1yohK7sJuT4OtNszGbMHM2iqwcqKQELLcAv+zaxXrtvjvwfJWsnMUzCtM74dQsnEfv5aZLdnNv7UfRVUBNajcXD+fhwI4gINSn8vo7zH8BfpW2P8P+1UV95OmsdHl/2MJ/GQuJvJIdmN1/2q5G219SnwrL9GkxzWwFQUtheQ2W4mD1hNQ20h001Ku67jikG5MZiTe2gm0JpQKLMWn3b3+RVLCtLQM6TWrJspdBphsSOCUWoPAeYwLI7hGY5EG3+3mos/heg45UK0YYBHGCeJqDCOR2YxlVIOj2d+KALplxAtj+n2E1bmR5JP7ILmbiggm7NHZeAlS5rCINPF8PKmx0NLYj+oCbOEOVdcACJEjbDpKS5GQemLLAOTDwfA7KktOQD8xDWq2sXOdDF0Rg16uGQB0SGABqqhL16+bDJqC/QV3SskMp4OjNgi73SrdjDlF9msTEIM/x83ERQkxEyAgUDNo5CF//pd0CwQXb4slyEmxNbd+mxGI9FO+oUvJklXBetoKq0zId93vZ11sZDiqG2vK7MLGtZP0mz51JZZuv5Fwn4Yv/gnGR6G+0Em/y8oP17UtuHhsvasMvTopQrCjHNlmmGLe76jxJWH071ypOvh4N+uWO2kbWY8WA95yzgUB/aFl9R0+dsHEYdieTQ7sIGiMgvHpL6YFyR5UzSbl8yFOsW2AINe1Go/YFl3co9nEGV7UqMSdzfs2BVcnBo7xZ1MB4HfLMNjUj/G0s54GVxZfu+tyTM7HRxJdxdmopOEQdllomNj8mvmHcungjNepmF4E5JQRrhS6WUC1Czt3vOq0+h0cdyEA6iTNYHmOUNFlg4WsBGM8fRGQlLqOOuB9AS3F419kFi+0pCSy2QJHgrY8Ph2bRZrnis87kgrq2qrdIgRW7p/TXYRllxQCH0rWYB1N2u+MRvte1busvoP+yDe6ke7y48RNIfVRTktxsZuFg+DK6j26Jiht8e0+80h2f5/FD+o8hoT25uChNdFkHT2eHCxy6UaFtVSBnk4lNOScYpwfMp2eaBOqz8mx5ihj1IpXf6Zaea8WYig/sD8G7tFw9xB1wfLaidC+yyQDSanMwcSjE+0GtKL9hUH/dSH3sW1ayEj3zlLIT4myS4eAnWfoozCr55E/HfMmV8smmYxeuEzjFeWxUfqL2tNiM4iVC4FYw3sBLUdy99YrqAhq4WaphUKNw/DkgQbEI8MI7s8CaBv9I3xdcYB49Fev58yFB2yiIFisQNHoOqP+UI7X2tI8blf4DlwEpd9ozDwvSrnl6SGyQX5/I1u5z31dEwZ/WRcV7oYBA2/DgJYZt2OJQL1j+VKw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9f01e87-de51-45ef-3d7f-08dab4a347d8 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:20.6712 (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: wrSa6azX4Tw3yGif95cchn/t0+YylP3qkzxQuCk59F4Q5Yzojv/TD7uH/qjS9310pCU1lyWf43FW9Jr+orTrBWp/6dT3+hb6bWoE27ZQeKQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5150 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: sVp2JmLHTnrxII9BsuGYEGMXVokbOTec X-Proofpoint-ORIG-GUID: sVp2JmLHTnrxII9BsuGYEGMXVokbOTec 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 Reviewed-by: Martin Wilck Reviewed-by: Bart Van Assche --- 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 2d20da55fb64..67f291cb0042 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 0ad0e476f2cf..e9b19fa939eb 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 Sun Oct 23 03:03: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: 617795 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 27AC4C433FE for ; Sun, 23 Oct 2022 03:05:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229847AbiJWDFI (ORCPT ); Sat, 22 Oct 2022 23:05:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229964AbiJWDEq (ORCPT ); Sat, 22 Oct 2022 23:04:46 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87B2E16593 for ; Sat, 22 Oct 2022 20:04:41 -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 29MKxHA7030974; Sun, 23 Oct 2022 03:04:34 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=dV79/Obc87tSSRQeEHmAoG7u6mtZnjlW29/zoqDv9y0=; b=k7/URUk+AvTBcV8qO21QTBKER9GfUE07a0ZeNcL5jBBOAvNovZPQHlCr+wJzZaJ3NOxw Zv/fNe4+G9ifR3Ax87p4CvCkTlHq5bnrBN68psffNCeHJch3YK6W5sQU9LJE+Ry9dBnA /OQmW0lSGKccjlIMHIraCW9BuNksELs+kh7ywUC6F5/4azzblKLBeRMfJqVBmmlmSCAo e2JHzPywJPAlXT6JRw1mO3FUaO9MAN32G2McYEVhTbHMTqnZj79h+lgL3htv8b5LgPrM AJYQDD71MxQAIodejCxHmku/WXw9Q2FXnT8sYetqbXkuaZMkL719p7W+ooMYX9S3feFL zg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc741h86b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:33 +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 29MI0iDc003678; Sun, 23 Oct 2022 03:04:24 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y8rhjg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XsQo+R1KMIAFWqBc9Sf58ZkPtRF3gYjMPIdfs4Yz2LPyd0na3658GY0G/HttTBvxrG4fyfGTIJekZ94vR7z0q5Ry82FBVulYMCuzrg2QNFtoUVALxLLhxB/BkGhQpFWaCHTEuhQskN6PbgsVu2hYgBFW3RxY47KjuT62cHUX40yJ5rdAfbwlSZwZPjkG0MCvbj3ZymD3SnbKRNpjyWvqTQsRdrpvtBY3nkCiU+lzRPnIjxAR/TntEykEdZjXIQsRZjZN0pkXl9znc/2S8fxn2EnglfErLqTHdPgsGB42HJeNhZFoXClHJ0f/p/hARZ1I2pYfU1V3YJSqBs9ex2xvmQ== 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=dV79/Obc87tSSRQeEHmAoG7u6mtZnjlW29/zoqDv9y0=; b=GNCNFr4OuCY6YXxrIUUNEADMXXzkRzUyDaYqF+3ZxqS8CCTn9ZjvoOovxdonOfbavDxcnBGV40tiap8rjD7fWBgQWd4cRbNr5w7uwil2KFTb6k7HEiT0pHe3WRD7alzEGD6Rk89MT8BbYF7cc4Zdd0PAn2ek4QERPx8WFdZoCsXD2Le2agGFgt0RY0eCdcNPEHaVilqgVJRMSk6B+SEgI2qQwtqEQsBakM4CfE07jF2EnmurzVK3xx6wboKSo3nMedcJ0OIk7awHufW4kJl1V+U/Pdnwa6p4FFM3AB7/+Tsme0/1N6K20MqlxSADWTszk/P3BBEKUn95uXYMHdI7TA== 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=dV79/Obc87tSSRQeEHmAoG7u6mtZnjlW29/zoqDv9y0=; b=tQtiaxhVW3fqT/wm4sVcmZWygmuNaYzFVbyNNBDmamHc9hk+wpb/JmVyH2edybsVGPjxL6Up/3jzLfCaBtdDgj+ZgL21CRA6TtnnENUSL4k1B8Mnc4fERhRyOdsz9nE3Phy9qV7mqTpKQaNKKlJ8RkOQxt8InDF4uNaneqEAuiE= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS7PR10MB5150.namprd10.prod.outlook.com (2603:10b6:5:3a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:22 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04:22 +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 v5 10/35] scsi: spi: Convert to scsi_exec_req Date: Sat, 22 Oct 2022 22:03:38 -0500 Message-Id: <20221023030403.33845-11-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0P221CA0040.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:11d::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_|DS7PR10MB5150:EE_ X-MS-Office365-Filtering-Correlation-Id: 3475ff26-33f1-4fc2-dcf6-08dab4a348e0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8zh6YFjIrXZxwBBpMA3eZ0UKz6t8W03jZ61mKFm/BaZ20w1uUUO+KrOv+REW+UvHbSaAoP3106hl0Fq2AqHqkCmnniRqDaHwFF//CFJA3ekFZtYBKCSF7v0zLoqXjONNdsb8p4u5c7VM82ddOZ06Sj55TMiCAKmKdmAOBMXy7DNRyzB945/MwzNlFhs14rzN6As/FzQKi0WvTwuhM2UCCeE78kwx478EzZA6wePtUoLSE4KO5Ju4f+vI3bkQwP3yoLca7bB0ic3jat8yjwWMh578JFoKCY1cYZUXI3iBcYReIxEUc0KiPr02jMWlK7SOPYg34KRbMvbuczPd1wQ+YEmdtgJdv7rJ/wL4sdP/G9w62b5nryPgkYnODGfrLivFG4h9B05iYItZ7jCCPenM6590Ai0fIoUtkJJUThHN9uzC1eOTY/ZMiiFV9FKnSbY/iYi7fI/ctqOqz39U+If7zqIRTHmWwqu1QazW6Y/c1NohVVUe4NFfQS9yBVrxc8Bb2Z7MXb/EQXepM+gBVRLsqTjLcCF8e+uu48qHOkkj8jF9sA43rsVAAWPghqGF6zvpR04128GXNd8a9CO4GsJMa1UcTPMcF++ynoSL0VZa/bTg5EN13LV8rp9nGSGMqBu0FVWht4Ev8yjP2SrSE2TLXsqUPjcFJfxOVvu3b4QfQhWSqjzgR64rbG9uA9RMbl/Omq+l+nzfM4WjONl4wzZixg== 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)(396003)(39860400002)(346002)(136003)(366004)(376002)(451199015)(478600001)(8676002)(4326008)(36756003)(186003)(1076003)(66476007)(66556008)(86362001)(66946007)(38100700002)(41300700001)(6486002)(83380400001)(2906002)(6506007)(26005)(107886003)(2616005)(316002)(6512007)(6666004)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VMDzzolt/w+ujkp+NiYYRmODA+negls4zBqMUQyI1KigZDuBpJJXj1uxVcvmqXd1wr0/UffD+etxlzW9UNy7g8AxS77P7LvfrEazvyXrvEzwmzZ/l1JQQNijuSCJm/geeyAG4rY81qYAKhB+iDIbt+MKhcOxHICiGsI7nnT+kjCZnGhFt0zSLcpWzHw4Kt5C5o6gDGz9bGoDRYL0ZXj9HZWtRMRO8tmXqf1Fxs8F2D+zIimZ+0Ud+G8rPAPNePwBzVvPXIQ9XkUVpM/9m9LCXmT4PqamzqgBVqpxMkjOajZFJYpkKnUpwrnqJergNQF3jlZCKhvJ3F+fzb+SBnMAn8YZA3tws6aSoyToG3QuTTD9r5JJ1U/+R7HZzgz8z1eiMiRu/8IFlUhEIJh2ITCn0dg98ZxSAsbpeeX4/zb4ViDH5/oyId+ckOBTY4GnuNSMwZDuHrVfF202J2BNQsZl7OJzkvBZDkzHj9QuN/PtxaVG7CkwOh1Ns7qQYIkXffZyQlmu7ypJzXreWS7febYN7oPEyjwrGkaJZxIkiHoSJGst/eBI3vTskN3PmSPgoUlJhhKYeMvMy8jMAm3DCY/drkphWo/hGw8imTTwLlwuwwWSMdLZg60Jbtysh8ZwSQiyAneMtYf+E6YSDX+WjPhA0CThbZbvpvfZuXLDovxYLFiZwAVeW2tMQ0rYb/S1NhWZa1+2YY8hDMKae+r8wlJsgPlEFoVkE55oqn+aiRnn9SoX+oz3g/BeIdWCZx4GixrFzMzQ+2CMOK/E7b01lW/UEA4I4+R9t9aqlQQFc1IxKdCsJuQX+AeP/eWHnW6bxX/QVTE0ZajuiNtzscPJWbGi2qHHlYBDI1B5OkEgpR//+SBJAvzKiX4qFtLu3KponXLEKoFv5VLGH+bSbbUHGD/YlhTUSrnNPteg3Rgd9qGcw0Ecp+dVDHFwynrCnE/lq9EgenQU4UKlGV6O1WWxJsjZITuUr2RnNkybz+PQIO/cfWek/pxTRQaF/nKe/pDB1xXPc7SG8Ffs+NdD+c5oqNXcAwnGOyNNuQ8FVDugGPtHR8hECtKFt1poZnjpTyfFIl0pyiG8i/a8rzSMjh7y6FrKgx7mAvIYnPfg8VO9BJ0bsjPwFT+IJFSRFk1NSvxUut8PDbTY43rYwUGnnsXXTg5FHVGTcSpqX6T+mx3EFKwSvDxIKg8aJt6YFgxdThyKEyxu6v9T/ohwRGjHi3ATzx5XTqSFZOHpAoeuVPe18Wk9nmaGbwmXu+Hle91APQi1bE41NH4GXnE6oml2aTXaoMG1ie04uCL47GMe6LE2DwwRylHV455lKMuEZTXPrf6aiZtJJATLGGTMf5m+CbTrbJkdNaHE1vM87L8sC7SKH0GOwXgy2j3QR7MIhVN4zDb2x+QAlvHHLe2b0ymhfQ4m9F67VVAi8psSr/touLtm+Tn83c36qszTqX9nhNvaMauiuE+4jjdHbv83/ItId0z4eD1FDuzLQghcVAeBaO5oZANw1waUOXctmCQY6Zlj17FdWaAFb+mBAA5a3jAw3hkZchholb+eSW7UhF8QIKys/w1a4SD+W7qvnz9vx6vg6jOqvxlYEk2qC1yf8XLkkHOgaLVvTg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3475ff26-33f1-4fc2-dcf6-08dab4a348e0 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:22.3742 (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: FstcPeQ9PQNeN3FzEz0RYqVDFW9FwPnYNZJaB751u6DqnxhTqH1FHyaR+G76X1wa1Cqssgqi+VAWpKhtFfM5D6fOGwCiMEqK2TCHN2KLZ0w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5150 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: u5JWtKBIQ31KZ-Iy2fXKX9ojTJiK0P7S X-Proofpoint-ORIG-GUID: u5JWtKBIQ31KZ-Iy2fXKX9ojTJiK0P7S 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 Reviewed-by: Martin Wilck Reviewed-by: Bart Van Assche --- 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 f569cf0095c2..18a365c577ed 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 Sun Oct 23 03:03: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: 617793 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 4E9DFC433FE for ; Sun, 23 Oct 2022 03:06:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229967AbiJWDGz (ORCPT ); Sat, 22 Oct 2022 23:06:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230004AbiJWDGw (ORCPT ); Sat, 22 Oct 2022 23:06:52 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E97AD1580E for ; Sat, 22 Oct 2022 20:06: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 29N2tGUT012781; Sun, 23 Oct 2022 03:04: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=fZNfqneG0jK1/tbPpvcrmHtRanh1CuV25zs0jlbH/F0=; b=PFls7eN9fVDq/CDyWdqO7g/0Cy+J976U1H+V6/Ks2/qxLlkpQX7QiBUkQ9/5HptA1Xcv ilZtl6tksBGwi/elP117N0LYtSPWEbudqtuNJEuq6P9gxAZlRGzIPKcAltSQIfL8zUon TJdOjsgecP0Ieipb8qgzEao7ttBIH37iXtAhS2jd3ljXhtKLu071pu+tno1z6tzaxhtM TWMgp05qoHNzzGLmMz7wtDznFQl2QhSmPDsy032dTIpysCH59cwUqY8hmQwln6fP9XtJ K/MJsPJYs55F4sGlrDZ6lk+BrMwpKBmAwNZPqt/Kfh3TnVrr2G1cyO7/fNGeJRktnpXh 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 3kc84ss3fv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:26 +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 29MI9mUc016664; Sun, 23 Oct 2022 03:04:26 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2168.outbound.protection.outlook.com [104.47.55.168]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y90nbc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IbrWxB7/woG/VLolKZPVjs5/E7HMHkaUVJfFgwEyX6ArhaIhTU6CSK4GMBzRMVfTHvc+KhXTTDxVVNvfVHcOCztjtE/iBezp6i43k9US2pxt13wtYDNl+ZBJzTs02R0+fkzVemI0PiQX0c9efS1AtH1IgH5AN51UjW+IAW68gWKQuCfiR3OHobODE5R8vKemv7pDa+uHQndjDbHeAsRC/JU3cfgLkIx+1s1KP8Y7nZG5fSBo1Nr07EFeUHudbG2xGGPGAARTW0Cgq2sSRfqCP7/g/t1IIGY/K57j4/wMTW3J5XZ2DaLbyGdwndvfjnCZO9xEFZMr/oIeng4I6qaDAQ== 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=fZNfqneG0jK1/tbPpvcrmHtRanh1CuV25zs0jlbH/F0=; b=XcNTcyzNS8npT702URsftt6K9g1D7PGgwp38S5u9h23iG8eJ9hmuZ2muXUy0IUOIREeXyu6ozi9YCOtAsFie1AkdrfuhU+MdvG8UhYNr6NFO1OJTkYeOl739f8m3EGjNkfvTf5LQUIgHrFycntmWQBsbhhVZ97w9q4vADREi7aj7zvXQY6UNGhp/hvOcj4KFdPRhrJHwj+5LNbDzU1bDI4q/zWxWehKdvJWgdFOXD8IlKhs6bubsF9g38NEilUEOTkE1w1+I6qWQu+cAxh0kQDooBywhy+KY5EhNFJcdeefoUIbRu+N+hn6rdQB9D6tKM3bEfkOt8JONZ7w/O4ZifQ== 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=fZNfqneG0jK1/tbPpvcrmHtRanh1CuV25zs0jlbH/F0=; b=sxcNVf9aJMYQxzhYGqfboNMOPDDfY+van8/XC/gTklWuTSdUCZwtu55dlfVBTQ6b1+/hdDXkv5FZBpv17TJjzIOISZCXyPGslem/qjYm+xb0ZZFFPi5aDF+0Yc5pgXNStceYThWPny7+pTC+qYvpL8GOBOulIYXb1dWE9t4FZk0= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS7PR10MB5150.namprd10.prod.outlook.com (2603:10b6:5:3a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:24 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04: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 v5 11/35] scsi: sd: Convert to scsi_exec_req Date: Sat, 22 Oct 2022 22:03:39 -0500 Message-Id: <20221023030403.33845-12-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR16CA0026.namprd16.prod.outlook.com (2603:10b6:610:50::36) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS7PR10MB5150:EE_ X-MS-Office365-Filtering-Correlation-Id: b11f1532-51f4-4922-09d0-08dab4a349b5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DVG16J8tFYd7w/Wu8UOK74TUgMUr2MToA6g8nqbGnjwVyiMDtsTmkIOtqMuK1QdoFqVmD5AEWHSFmjFWVm7YE9oT4jkcCFhJqtAgOpbhpflWYaPOP8aOVSEnnOxC1wNCz8mxOF7pvsgOulbZWsX0xI9ogSJ5wSpm3T8i4zYKmBwOCVem/rxC1BrBzt4lEfjndv2VD2c6OLDyKFmdW7kKYd5IhB21YQ95Tt3e8xjHYOeaWSihGYJXk8Ex2sj3URTkz5vkadBvjGXXpudvpGyAPQZWXmdYRvV8DvCaYgrFBT9qiQDq4XQBzQc5KJS1/6bqIcsa/Qv7AlnGncWx9EK5LOwjCLDtarWfwzzX6E8MK+chxxDHPmMNBLBME0JBZC84JpU89krJ84ADYZVByBthaVFB0g2F/wFmIuH4Nm9ymbWxqxnYKS4Er0x1RmELu79VHa4j+/wzJXD2s5DicbDoBn5E6IJIsQhoORreXY5QGpEbznT//mnXMTQJgIWF48SKsWZb6Wk+OOGz+Tb2l78gia9vzoOBND/SpFEEkPymcryHP5dZGEI4InfMrpmJTKQnFEcwuteTiFIzgweruFNJj2OCHA1ugqUrcH2QhmZ1OxxKX1A0L9bLSa1hWhcmtZrmtLXRoDnRpz5WQFLZlaRgyeFUPVpN0bYWfsh1icjwMmp8cX8D7MdD/oncu/TRTpnftgOQbNLbSBX8ycXe5iYlbw== 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)(396003)(39860400002)(346002)(136003)(366004)(376002)(451199015)(478600001)(8676002)(4326008)(36756003)(186003)(1076003)(66476007)(66556008)(86362001)(66946007)(38100700002)(41300700001)(6486002)(83380400001)(2906002)(6506007)(26005)(107886003)(2616005)(316002)(6512007)(6666004)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3AKcIPv2ioOUq27mcsilZ7DdvKC7zudV3RBGQnWrx8q29UPb4FGJZcwhMG9jXpCT7oX0QSdjZtuywPAs6RNaG+CitrMykWYpN4FeB6y9FKANsSqaZTiRLzjzKmqauif/Do8QcrDjWhG3Mcr89Ti9D6csnr5CXk5gX/JqgdD7IeySHpy93YmT4dJpu8OTrdzHJkQzEAZznxOWtwck68RQi2KrFvq4R1TMo+AACr5Q8rp5zX/MHrmWDeG3SMh5/Fw6tflc1XbpSThZKciQe+XbtNqdkZVJYnj1bjLNkNChaej34QwAhOj+soGuZnncoiZiTZYUI+DVq7lMIxCvoJR4uv6IjvCUU9/c+bJXaVadOXeDKLkqGdrwoFyyGxAvk5rNLQrGZZr+GXfLiGl0cJW8NMHnkbRPXnJeXlkyItbHncgjDmbxWNS+lZp6NPDQy7mM46+D3jyZ8v4iCLx2WFKgobZxN558gPNHFa7UO0yUumGHsIywojYyvg2XNzrQ1jqtBoupJGgV78RVvJVT047SgYc/GG7oZkN8Ucxoi/cLnOuf4U127N/U6AT8ALryB14i75SC3k7rTMkwAfyKafYYQeKT1YIREHbaUkjwrfUwLM25PN8bBCYmbqMBIyyB2xVb0aEMp2/+tKwBYU4q77RM2gp0qj8Slkfj/PI8jQYK4yGYiWyDCffHUFMUPlaPjy+LOZ30M1jz5AEkbp2+nBmm/nf0IQVQc4QTlgpyVWdHylRH3qzBzlg1H/RlysgEkmsANJRfLdq5MFNgqU+Fq/1nfo8MH/KOMCpap+zYyB1ROfhbvxO7gW5J4UX/Fro3rkK1iZhq5LfvidlcI6IqTvSMHDhO5qKBcaKS55UN1+hnIKkoQVzvG2UTu3vm83Oh6KOJRssK4U8SOTNoBFN18qBW6cY7A0jXLAc0T0CzrsSJqsMSq+00nH+sMIctEfU7Zan+Z0xaVfjtAea+69JPmqmsZNaw/Wf3wSnB/DRhAJCfJ2ELt4VIhthP7rVs+vYZgfb1RPcKOqmhZGXKAFrFApIo1fLHRF2Sba6xGlpwLDwIy5XVwHjOyvlzzlJ2T7b6SfphE+YUfhxdpXL1N/il25I0f0DT1ebODLaHG0srLS7KAjh81/5/ohqLJNas2v8SPxSOICm3I+1GFaHsJwsb4sV+kbjru8y031FJwcO/Cw46R4oaAXqMP5S+psnasA641G5f9dQmlTSEqBXZ9zJTQd4CoCbbsrAwdy0T5Lb0wZ3I5rfKRB/rXE2wA8ralpeqOgTSpRPfg8lMJANKHv3le2UgUTdT0pVbju72lPQVPXIgNgbZFtdh/JCL2nojpl4QGRizkDAeg2Jmcp2ZcPsHQFkXpxlsf6I+u/iPxBWxj2x2MoDEtDwrThG2bWihfWJAMdoSCxn6J9L7ArODNApU9a/k30JFCXVGq8kzJSRbdJZtg+ovfrnhdPOzvPYfwZafNJKsD7INZZMjpRSwYxlF13PlpEBuSWA8OQYGZ1TsUsHGAm5buARpOMrYkgWZTs4/4mMqTHo3o7+GXZQE5Sg/B8+gzYekwUlTu9a8rsgnIshTFuhqcU/P5s5w4nTP+lM0pRjOlFDcEAt1H7K1igUpWLK55A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b11f1532-51f4-4922-09d0-08dab4a349b5 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:23.6866 (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: OeE7dn466zzQutTHJuISKh1m2twM/xlCqBWsNO5Qs+bNa2rhrKzt0SqMKxIeryHZDHkOKJbhgLbS9C74NY2Hek3+52UEnQD/52x9ZAgfNwI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5150 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 spamscore=0 suspectscore=0 bulkscore=0 malwarescore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-ORIG-GUID: WYj60w45q3QD1zuheve35DaXcYpi3__j X-Proofpoint-GUID: WYj60w45q3QD1zuheve35DaXcYpi3__j 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 Reviewed-by: Martin Wilck Reviewed-by: Bart Van Assche --- 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 Sun Oct 23 03:03: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: 618720 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 721B5C433FE for ; Sun, 23 Oct 2022 03:07:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229981AbiJWDHD (ORCPT ); Sat, 22 Oct 2022 23:07:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229996AbiJWDGe (ORCPT ); Sat, 22 Oct 2022 23:06:34 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87241642C6 for ; Sat, 22 Oct 2022 20:06:33 -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 29N2tC30015615; Sun, 23 Oct 2022 03:04: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=+ShUH1Cm9IjgWLwMtUP3eOv3O3dA79ysgx5YeWTHX1Q=; b=i6/JFblXs3Nyz92c2WZ845QopB+yUoneH28dOR/sTHIcqW8n8ftjDNqyESMxSMSjPij1 K+hE94gpjkCCvzKAMJ5Abc0fg0/lVmtk45F07CGbAQfy+TlWg+fBdrU6+v85uzV34/wM IgFUMzYacA/6+7GQf4yNF/LU3ZR8NP2cwh/+N4GQQUVbOSPSs4iNoeZXWf9ran28KEY8 hpUwB/3PLtqWGbsbqW9XwBqcx8eTh/OlNlP9vpgUf97ulO7W5axL2Ez+8gwlCKeyptW/ EXe+YF0TVADB5gr7CS0cLEsI07ddAxNttKQxPcRQSj11fPtbSoqJgkYv7kAJVzNj5Ow/ hA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc7a2s4py-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:27 +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 29MI9mUd016664; Sun, 23 Oct 2022 03:04:26 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2168.outbound.protection.outlook.com [104.47.55.168]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y90nbc-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m/iUwFk+lcVrVyDQ24p8aLdy+WfYrgo5Lc+Dc4sS84ub32baFTR7MBot554ARJ0Q7C3/Qu9fdm7BhYBOdcUqZrsw7s3CwEXiw/N6yGGknJiYk95+E4UbqDTLmUTCic92BoVI3yVgqOqDOagX0ZWkYowLDHSuC3KUKsjCzQtZyvWBAuTt6CkjNyZ7XCVinJ831m8XRXgfoLPld2S2/WIwmi6/mGz3JBTpCAhKxrCHzoI1V4Mo+fUcyggydTL5f1Uu/c2SEvLLUxlaZOh3A7ZhocLYiHAxxhiLWJoM+qEZV1NPfpd+68Jp6BXG1slTFoQrCxdkXTVItbaEPGIRzC5mXQ== 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=+ShUH1Cm9IjgWLwMtUP3eOv3O3dA79ysgx5YeWTHX1Q=; b=RPMUEWO8w8kMcZas9Umt9llISaqr0a6voGjy2kpOByF8dkeWyL8zlwZ89ket7RiLvZpPlzNFVMr1kQADq1+DADkRhhJRU9cBSCW5atSq85l0NU8uWUG1RC+Woja33rRHV4zln6jARr8ogftj9xcoK8+pStQoKt56EYGE7hZ7qVn9Uh1dxErOi05vpuh5p7YvAFjCVe6jqxBi+HZr54JjcHEpAZLvhZOBxT/LBd0prsGKvL5oEdIrRkfkdKyHqL8uU6esU2dVFYulaKS7CpPkpGQ5FUOg8WFEgZq5mx6gZd+ZGukMCIkvzDAM8dyANOFZXQX5nH7pbRR6sG4RarTEqw== 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=+ShUH1Cm9IjgWLwMtUP3eOv3O3dA79ysgx5YeWTHX1Q=; b=XMHjEBVzhpozRtQjAGAKNoVzZICjJnM+OLrE/yA3MQpWpv+Y6KMZKeFfXoXMX5Yk0yVAjSH27pG4jG5kM9gX9Lt7dGxDffCRNiwhWbx64+hj4aVG07E5UwXspIXqS5uUeLQlVPagJDUDzvABUJrasidz1FOZDTUpE7jveLJLZSA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS7PR10MB5150.namprd10.prod.outlook.com (2603:10b6:5:3a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:25 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04:25 +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 v5 12/35] scsi: zbc: Convert to scsi_exec_req Date: Sat, 22 Oct 2022 22:03:40 -0500 Message-Id: <20221023030403.33845-13-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR16CA0025.namprd16.prod.outlook.com (2603:10b6:610:50::35) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS7PR10MB5150:EE_ X-MS-Office365-Filtering-Correlation-Id: fbf98d6e-f16a-4383-700c-08dab4a34aa3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: K/Vl96LCPala110gYpT81VKTx5DBrcDngD7lr1eq6MLkAFl6VSIU7uDAdPkPpSXinooTko3ClHnGU6jE+ktMkwAH8hD4L7b87uiRYqpVYQs+xA05u4p9igq6f+bHOsw+VEVyKLml7UbxSTZurBi7JsN0z6IlcQYgmU1hLRaMU4FqQ9AqZVSGhjO/TXOTT5kXzCVJx1Ch4yrR7oVo7B119vbRaz9y4LqrE3OsiJtbWSzV/HumdZbFj4CkesO4KusNijPJpXj6CA8+S+aD8cb8ViiNJgZwA+K/LQxP9FyFJbaPIJn2siraQSreA0PDdfkv03/JL6KW3586kVDPHztY/t827acC8L/66/ybH18oSKmYidEIAl19OGzByRmO+v+a7hrcxkm/Q7Sg+32gnf80q2o/3gsB06LfIPHCaD/eelnQNk1JwtrAXjyrefHt3JgMLSg1A/AWJ3slyrr6UYy8fdkxcdf3Fqc/VfnUclks8TopCEOlMIsEGlYLpZ/rgDPguggZs41lUC+KKZqDHgcr5VRO8/bO8W9hE/brkYMeDIeJywzdlg9LlbNdbZdk+AN1rxqQ4Gl7AZyQk01Cs5gOBHI8ShbwZlKTTc1syJM4oo/dpmvQjQKivNBZHdvSYkqpfXYRgTx50AavFZQIt5ZyRhH1Y2lpcD7+ZYwfvczH9wqwrUbkdiqAdGau7zzzd/kJQe6MPuNDfc3l/RaQQa5U5g== 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)(396003)(39860400002)(346002)(136003)(366004)(376002)(451199015)(478600001)(8676002)(4326008)(36756003)(186003)(1076003)(66476007)(66556008)(86362001)(66946007)(38100700002)(41300700001)(6486002)(83380400001)(2906002)(6506007)(26005)(107886003)(2616005)(316002)(6512007)(6666004)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: J9p4IESi58kd1aom3cMGg47UmCny0WzHpYFn+ylk6WKVyMzQUZGr5bnk5C5wTEBEa4BRBBgPGjzkb0lVZooZ9lWHjEumdKdCnmjftnFHEHgxc3iB8WbGaBMP4KP2oTmpekvvawGPMzsJ87AkggiMpaG97k6tdiVlXY2zpRHncGTTiRSDZPsNrnFYc4yyrI1VbAsPZ0Dk2Kkawgd2EuV/xVUvtANw/6TjcFHou6ce0KUMQZ3V7CIqRwZys3cYQdRkfPgJHldnPbBDJVBilEYF4j7tBQaSbWjFHLtBW/I+P3vV9gvGezDTArPYNuGTm8M2orrWh0fwHfAE0bB5BcrRUxiIbdVo8s1kJlxr1T8t2eHREG+qFFi/QRkTbGSALL0ObynVjApKhUNoFf0HhVcOxAVobTY7vIvCYuRvDDXJfBz60ldTgWNvtDwLtFHQGqHIZG4nJRO6ALkRENVqUHBD3KTSLzKMbt8lZNRHlVP80oJ6Y9XaUgFpSot7gcgepD1vvmTOGzKxZ0M0q7F3avmasxFDeR11nrvn2iL8ph79bXAuyxika7waQDmSmyBrb05qX7oGyF8RYRlZ4IzEWuuZlXZMJgc2wNT13xWgCMYGXqSYRA7nZyuU5Ud1uyVEBH6WDkLZ7cNjcYAWIwJRF57+Cp8E2WQq+Wv2e1bk7qzduNLden6uI85fJJrdNyB8CZ6L8EPWUCq+V3E/5e0QljzsY5fdHBbp5my3NH9xdhWKF7/+TfoA6ngK0yEP5ZAUBVWf8gMd+3VGGg5W0KBq51Xlt+9PWVB7sjnX3D5VaZ6hCwL89AUS/WXvCSMSCAt6tNT2tTaqn17ydUqL94M810MsO2UO88P8iKKR9kyG9b8a8Ex7UZOxvzdTGib3jl5eW+NBPB2NwoAZB4j8/vr+vYfpyFvYHGuDnmgggCYcSwOYroVgH8sx3mgOnzHGNlakT7pdN9TUwheve77Cp1xt1NGBCDWhFIH64x1v26VSklH3+N5rW1kkAWIPg5Wg7MLE5ihvi8p22JdLDRAOJgaW4V+79mvMycpGFWKvebVK83m30k1kGDXNzuIKDOfx0ZTabURQ4V88cJT1r0mcVQLWo4YoA7IGSUUgulhG68YXyVEedPxOjjaS4st8DK46f6W+0eiStXrOh/9m64T4luXzS+jZietKz30MipWSXyhMF3z1Baw2CEQH2/oM/HceSqhZt+05PQNX0tLni5qTBHUEXOmVbrY5qA/ttkfavl0Yg7ktRgzbAADxrkVih2q2vuzrOvuOvny4qTtLCdxZIqU3ZDf66HPtNy49bel+7P8PHQPWjJfDkLxN2eYOCWZNt7IV9tn+TsMuESuRw5dNphOB/DThobXvI1+T42mf4HKHU7BnV92LIVV6FSbBA4ZaHsrfb873P/gH22Dau2kwAfhMvdxdSab4HiKVPun2CczhQNLmfn1YqcPmEAKTltt+f3EaiQvSNR3m1agxp14Om4IWNFkwWtMfOYNOHSMhzkKu2eRAHYzqZOEgPJwbQPac2bUHe9oxzp4prpndKBn3EJvG1DurWB4wG48HuN1DCCIjbkZQK8+xnUnBA0ROboZZDDPIubqlfrYknAcE8k29Z4iOCxqlXw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: fbf98d6e-f16a-4383-700c-08dab4a34aa3 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:25.2802 (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: U6eFQZYzG6Re38deaSDWlz4Ep02zT6EpUbrOovt1HT9SGelisosDWgFRvcYxoUyGbBF5Ro12WM1fnMMbFuKFGtsYL5FjWg43zuBJncw0uZ4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5150 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 spamscore=0 suspectscore=0 bulkscore=0 malwarescore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: XFNqv2g1Dn8bkbrvaO-I02R9vOBZQ8ls X-Proofpoint-ORIG-GUID: XFNqv2g1Dn8bkbrvaO-I02R9vOBZQ8ls 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 Reviewed-by: Martin Wilck Reviewed-by: Bart Van Assche --- 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 Sun Oct 23 03:03: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: 618719 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 F0253C04A95 for ; Sun, 23 Oct 2022 03:07:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230045AbiJWDHI (ORCPT ); Sat, 22 Oct 2022 23:07:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230022AbiJWDGx (ORCPT ); Sat, 22 Oct 2022 23:06:53 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B6116B15E for ; Sat, 22 Oct 2022 20:06:44 -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 29MCqKm9019479; Sun, 23 Oct 2022 03:04:33 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=a8P7VsBo6ia2NGN2xi+jJ4Yb+k/2sWqCIymwCu5ZnsY=; b=WXF8jKUz1SQi3Z0/SBQ37YSiYkjsbZEfZH/nLsHkFysUeaLv5yZRAXx6cHEnMEH7/231 b8uVM4uFvtuv+boibUNAkGm8vKexkCCqm/5gkr4qlR9HJxx9jzw5DdjxgcDdzBHoO/Q+ HidK1P+8gmZVB/Bs0tayp5g1ZKtztCHjgWZZHITuhgxTakxNXchZjQFeQpunnnSdu3a0 KUXvEvM9Wfbf/tgG8ktS/X9VwAmxtsAUPANFoO3AuisiLR2Vy99Xpkf9vZ3Zo06cWiSR C7fyV85RS0UJtAS0wsZaZxQGQfIbdXhX9h+nLUYjicunidmtbkPMRo9k8DUmRE5r3QQ0 Fg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc93918j3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:33 +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 29MKK0EV002602; Sun, 23 Oct 2022 03:04:28 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y8rhk9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KCX981OXvmY+s5zFFSQ/f5gjRRbM5w5mDmW3nvBwy4of8tgeljxs239bb6TthZxsKTMLsmhZ7oOx1NCjmvPE/EDtEbXSe0a4tkxrjxaBKRg9+5ubWzl78CIbBz/Fpo0i/Pk2soxoDZvlQsw49F7QBa749bGsn25ejhdlsLZRQokWm0pW3OKuAEMlehc2agzMZt+scQDI+xMcXhtblmxxVQN0y8mOnVeMH5qdBNGhxdVkBmHgiXXW4uHKe3g6WNvZKvF6KaiUp/v3JcZThLdR1HNZPWdeTTAOcBkmUy5sGBmfOwNfCCBQSHaO0pliCEOZFrTkWiX7C905AjM+UTkElg== 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=a8P7VsBo6ia2NGN2xi+jJ4Yb+k/2sWqCIymwCu5ZnsY=; b=TTbrCQQuX8M5GMmDPxL3x3QJpqRM8M7+kruV/6FBebblOhDGidQ2Ho/dMGnFr/5VmUIiEyeQoRHhFcc7RICulp3mMRQ1Szb/b+bf+a7mKKt2l7BHPwHEUZR3XmV5nJCbAZhdQaXL+yBHe4PbJ1Rxh+oxDRjlzsypyIEcs8e14CE2UCssEpZBo/pOUXdbl+TyknrsSWQh734cduXwV7FKj6sxcvQPoXC0MOVMEw0lxlBfxwB3uf6FgHms7Gx4EThLD54mZzyAvYqqR4f90zBcpuCB9aluV1lGogeATnzkPa2Lttbjgo1IctR/znEtpuYRURA4ushvix9JSoz+ap+08A== 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=a8P7VsBo6ia2NGN2xi+jJ4Yb+k/2sWqCIymwCu5ZnsY=; b=cP0eL+I1fKfeEjl/8+9s9ugGCOazhfEY/RKyAUxXnC34JDI4uf/8p6kmDIMkZzfmGu9OrE2y93nNOKNHC3mmjXcmmNH2WGDT9w+EiX2lGJ3t7wa/LexJ84No3+c8QiDUCwZ7Tgyx0PIjiMj30ruiyyq4o5jta7PGQEBp5nROdMo= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS7PR10MB5150.namprd10.prod.outlook.com (2603:10b6:5:3a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:26 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04: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 v5 13/35] scsi: ses: Convert to scsi_exec_req Date: Sat, 22 Oct 2022 22:03:41 -0500 Message-Id: <20221023030403.33845-14-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR16CA0030.namprd16.prod.outlook.com (2603:10b6:610:50::40) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS7PR10MB5150:EE_ X-MS-Office365-Filtering-Correlation-Id: 52e77ba7-3349-49d0-c1bc-08dab4a34b9d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wI49RarGB+0YaPkAXLxR0tsuKXsfS4KY8DWkZqyzRsmyv91XDwpVULaf1pi83HTo6Wz1z1m3crNH6S08bvv2KZd5RN9sT36qlHyCTdW1nWz3yigx8H7a6jfhaD5SNeieFonA9tcPSumrdwBkoAqcfv0JAf2YkO6KZCUZHUFJSdQgdx6Us4PEeZRkAIIqp5qiN2w71cWMg8a/HLW2Eeki3n4NeEAG5nTYz32LjzmH5QLRJ5WwQhrdEs3TCwxk4vcZdqqJUO7bZ/2m6TBYUR76vuHcQdWNDDFV43PDNPwcin5I0ULpoC27YrD67d8CAxlZF34pSI1h07sD+TbU63NIIJ/aAAY5gpdZ47AZ33SvejBZB3h0DFfa2iq3ju8if2jhuZ8IaQxF0ZnSRSTTcNjClRJPlfN7vOxeWmwiz6uD36tIfsTx7jC6V6GrWCvv//vbxO1hG1CHsoOmKa9REfSnuBmGEDgZ0E+OqWRB5+valXVgkrA7DmUS1YGsR3R0VT5vx4bYpWt4lVnXu1dY9c0prDhfQ0EIGai0BFvcgt500gQc349xDdI4x94qRqEXD50fnBXutPIoxYVmc7BKqeSOWDJaJpQUI3V34PAZdx+tOIAu0isww4CMiLerqVXTasafY201Ai4cobesKsZbluR+UNNu01RFel1QlL7dLBBNfiDe8oTrHtOEZ7RGs3zGUWTq70oGoKRYjNJne2262t7BOQ== 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)(396003)(39860400002)(346002)(136003)(366004)(376002)(451199015)(478600001)(8676002)(4326008)(36756003)(186003)(1076003)(66476007)(66556008)(86362001)(66946007)(38100700002)(41300700001)(6486002)(83380400001)(2906002)(6506007)(26005)(107886003)(2616005)(316002)(6512007)(6666004)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VTQNYYiOyoixiw8JcXaP6ANwgegrkpVoQcaKdaTJfLZQDTURiu+AtrjH/4JdKy8GB+SQxZD+joObS+AdEgYefpdzcM2N/BUkbmrryVXM1FkzcX/IcKUaFwKO95a0NyUPBJtZmX0hLpLTEAT2hjjvbm/nU5eGnUB2cqvACGZmSEYnE7zW5coMWRxoPNkRtrvIN0+PDuMXOfRFZRLTgdQv4bV2CRPN9eyib4Mzpd4rMuuLGrAbtpCMlKKa/HUBT3CRWctVHfpMTSE6QBm5h9vrEJ2zagahXuNW6ujB5wQuLP8j/+qWOtXDAt8WyQysXSaXz58eVukTP1qbfCkE4dYuB3UVKhBcMZbQxEBh639a0QFOWxUReaz2T9Q3muVqMBLKM0tuoeELFAX1bMISE2efmK20pHZmaIx9uXqDqKOL2dqo5AmjvKyIPuDaKSDywuKGqLX7t7vh5cBB6Nm6NCfCagMrlIJHjCaydEoPfqiol4rzjvng1tGSwmZ21MLLjQSQOfXHr5UUu3Tb+2HYxj3Grtuaxz4utNkjDVTtTrl5jFrbC3F5q50A7cuIDZRG/WGyHaUPblAPCImku3Al/wXnakN1tE6KjWdLphj4y7e7A05LyPs3aURB6WUE6tjXEL7K0eZURJGr3Nlw9q0WINLFYEofg5+qFlLFn8OBhwKUztCKsxN5fsDNDe15eP7GT76Cro8MvKR4Dj+OhlsrR+dORumm/rImVlrBHzKeuYz5cCGIRJln4EtNyVwbl8woITxZSExkwxFTeEniZZA3qiAB0mGPAfCqXsvWG4w3Os/eqNSYoH0zeu2ocOGv5ojzFW5/3Rf2TGVfmF7lc9Dzf8UtD/MFhkHbYgEZ3jZqiRIFEOgr3jTFlE5JU45zDPM3nfpLkOX/+LCFYzmbWHUaMu4Wo32KlUhNtne3UDtQ0b8mtzDOl7kPuGXXiI9J2ljqDQ2e4DLwteovkdzwx3SEw/lsjonqOJA/oqeyXCM2P2laxgU+JiVn2vUYVo/l3FSlSJA4opurTR+Mx2KCKJ2WUw6D1GC+SF4CSCiy3pWQc4vZF3iWcmX6hpZlY1m2cZkQ0QuKqM/OllwBfKv20liHaIcBnUU06jdYDoBfvN24YpoWQ+PQsi9GePL/c569zgaSVS6sHgQMyk9Ww9JvkaDdzhZ2ZiewBnbKhVsE24Vb8MfZ7EVNSwPXXJxoZc2KmvIZrwJ8qOtgSDYDE9piFrrWfP9JcMxmhI5WrH0MhyTn+guFsZ2f4HxxCMa4HgS33rAsEcGo4k7vquc2SOtd6xmjAqdPIMDIZyHUFiOM5BS99+YitwmaSu/HSrNlS1hFfPJXfpyi9xl/yvzXaIpN3lsK15cw0TodWlsogg/g7tzGfRhE6RUQJzSp3BvG7xUblIi5AbQZBu7ZWuDl+vigDLeAeLtEwHU3H76M7w0vvENmgzUEFbpZSSJfmOsOvLHZpD+7tEBTlg84LuO8Ng92Aq+nSeUemg8ZyWoDavfWrh54zRVVfVcsZcY4g6b1oVGIcimxGTMusn3h5NbVED+S0gUFY21SkEaG6l+/K+5SxPWS2t4Krhe6XbFcmfD0mDKXvTrnx/wTBFWLjUWnZc9ok7RWne5FZQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52e77ba7-3349-49d0-c1bc-08dab4a34b9d X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:26.8426 (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: XgFo5plk7lvRNIWIusnNSaG9nAwr2UDqBLcu6K2C0NSyW3sA/X89e5M+POolIYfqaMPdV8GJWP8mBSK9/tF8l1g6fxTkXldAwawM5UJ0EbE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5150 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: 0iTEGQlT0Rv1hPDbz_YoaevOldQY9Nil X-Proofpoint-ORIG-GUID: 0iTEGQlT0Rv1hPDbz_YoaevOldQY9Nil 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 Reviewed-by: Martin Wilck Reviewed-by: Bart Van Assche --- 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 Sun Oct 23 03:03: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: 618724 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 27092C04A95 for ; Sun, 23 Oct 2022 03:05:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230008AbiJWDFE (ORCPT ); Sat, 22 Oct 2022 23:05:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229996AbiJWDEq (ORCPT ); Sat, 22 Oct 2022 23:04:46 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1EABD5C for ; Sat, 22 Oct 2022 20:04:43 -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 29MEQLhS018071; Sun, 23 Oct 2022 03:04:33 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=osYKhSqc/sok6A/EqLBKLvCkwqI58nQvBOEjYLABYs4=; b=1/5xQTZJBckRlqB5Afb6kr7W9US6r8HCBlKfiphwFr4InrWY2k+zb1Wh9ZZa4XWdvQDY wnLgzq9ASKDopgyhX6mKO2M7Nu1ANYd+F6RTL0hQig4lrie5PL4i4d5dcJOBtQgq8Kp2 IxN3vg03/3w26rSV6pJLympumletEWilhlgPb4tl6WzU+IA5lKexlUfpVdlJ/3fh4MpV WrmJhONv0JpmqbSBC4c1Msjqz7nRtln1IgtoJz10CBQKjIF8enNVFY0EG5gGiILgfuFY 4IeELlW9WORSnbSt3O6Kz4ByBLeAi1vPbJCsFpGMls9aGEpH0kIoGAsWN1spUX02wXVt bQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc741h86d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:33 +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 29N30Vmt032218; Sun, 23 Oct 2022 03:04:30 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2172.outbound.protection.outlook.com [104.47.55.172]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y30ajx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wa+vaPM/yP+pGCxCG3buLjtlLUUl8MwQRIno/imqr2UoyIaHr/BKXjfBkbwe7Kd5wCI0pcPgYsFnKrWLkni8f5oBQ/fpbRhURbtvsK81AFv4CVI9SIhjOKmiYHKiQ65THY1LT89Ll3B0STgyta3Id4AJ2dh5hxM9DYnqCpCwjHyYFC2VNoeIHS29MMU/P/+A8/XyBUG2JstBTcTUcI4TvHGHpq8OJN0rJ7zTrhTDNc8FxU/kqb+2ypfgGIdgW/2Paxx+WrMBoBW/K8SbsXPULCMr04GazkMAfySldPf50rYHcl5nPOzdqQ5OkKTpynQWSOKqbgN7UGi27WQx661rMg== 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=osYKhSqc/sok6A/EqLBKLvCkwqI58nQvBOEjYLABYs4=; b=JVosb5dMHkZXYxSi7p5QEcJFvkv2z1iQQCqiTi4A6l70dRz8eDnTrNReDCs6k+B56bIz9IB7ez03tQMgVbDhoN7S6kvPuwh4IMLwnvqOa8kgUhVWIs1w0UhdCQvRTj+a5Ox7f3ILrlqzaFpw3v04IA2CkHccIQVqqdBjMhplNzH/EeGGEZnlxGYezDkppWJpTUe8RUA4tVaGVKXxyyKnd4BfbIZXa+c/ppsI/uQxQDR4DBMkpwtR9XJlkidzwFQqqqOv/Ym6aBf1iOPNbL9Z065Qfl3oDk0typlXHUV+IIv5G3I60SYw6z6pWvi5e5LYn8S6SucNg/7nXK+agKIG+w== 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=osYKhSqc/sok6A/EqLBKLvCkwqI58nQvBOEjYLABYs4=; b=XfFoXp4lV7EkMpGFU6eWdAadxc6jfyMqhzqY2S8e1BjndYsFAZHn9e6f/ZmNRqAWn4VXCg2g3/R5kaYJhqGI06ml+d8yIMRmsBn4NqoxG4LM9IxF9ebq/nNnvtn4U2WrAwTySlkdLobWdYluR1DoThlepiZVgLIjY+5LrYfFmwI= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS7PR10MB5150.namprd10.prod.outlook.com (2603:10b6:5:3a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:28 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04: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 v5 14/35] scsi: sr: Convert to scsi_exec_req Date: Sat, 22 Oct 2022 22:03:42 -0500 Message-Id: <20221023030403.33845-15-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR16CA0029.namprd16.prod.outlook.com (2603:10b6:610:50::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_|DS7PR10MB5150:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a7df6f5-bfdd-4475-77d4-08dab4a34c7b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DuM1XLY4/UYoxV0MviuOPw7D2w/6mWvHrI0I5vMKaIB/M0tNy2Xf1EQ/gdgkjZUQiV+fh2xcQNG/25sIbIz6lx+NbguUwdsWk2VB99ConMX4j6nrJ/PYQcL+j9As+eoFx8F8+L/YtPET9ePBM1DxrmeAKWIIRHFGcIH1v7h/TQwoiD02npToQwbbO+lE7QIim8JLrzC0DIHNkmXZoJ6ZiYvd6OLC+Yj9BSjiiEWWyD51RCLE9HVJc59MphjRHbjRaG7RFAuGwKWciFt1eP7czzuf6A5fATNzBnK7pwkVORQ6u2x8r0MlKI1OHJbBA+YNjsQPZfSuqaq6dbJwsIvNPs0B/dBHRZFRWIn7FePUbyUjdWEsI2pXv1GkqaQm7es7DeSCgRhrwclByAVb7ZtyoBGGil3MUMi9hN9HXL2808Wz1uwNModTsbnFlfhQgjhEebd8bUgFuS7c8crDTyYRuz/MQgSVBw98JJZux3SnWTnS3IPdLHSp1LOJp1GdD9VanmBS3KBg0M3KENa8n06+fJfCjq56AjrF4MFrgZQItpzTpGwkWiuBHeD4KAM6W4uHo4yEglcAQavkqEMHzvB/ZzLVYuCV5bjOUfzgtQcdErYdDfDbCpit4R/gaLfP2HrGxoQQuZTZoTOs73QTzQwhuGb7Nhmg99yUm5KGp91PJ8bEq+rqHQLZyB2+4M3sCFh4lfxZpOZq9us/QYDIYywscg== 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)(396003)(39860400002)(346002)(136003)(366004)(376002)(451199015)(478600001)(8676002)(4326008)(36756003)(186003)(1076003)(66476007)(66556008)(86362001)(66946007)(38100700002)(41300700001)(6486002)(83380400001)(2906002)(6506007)(26005)(107886003)(2616005)(316002)(6512007)(6666004)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4FXS8BL7FMXpJ+K/XS4BkOl/dwaJKTzhWO+DZxvxLugf3T0/LJEhUNUKIdI77+VAGzQ6aOqFNiJIbLbx0ckAClTQJUMSzYkVsNDBN3i2YyPUiO/b0hSq0xWhO/HZtAw6knhFto/uai4+C3wwaxa8lFFzLry/czxuhsqBKvdiH9eAotdEI969DwLEfEpAjof/FeJDScjii1uEcOEFpbGqsY9qP1NBorz99JCA13owN/AeYOMzu6U/f1xCvuK6RMoo53N2kJKRrKlWqqPFlnFI25g4odAitZg9e46xefBJ46bqFQ7YFCo9/WzIe2eBJk/99YWP2otO7MbTU8zgae73MugqODD75Tdpxd3JEX8e/aQevzwTIU1f6ugWQWkinD3ak6s625g+/xuqnSoxQZPkB3Ht70m3OmumNL/OvI4EfE9RkeMNF6acD6qS2P6QAS1bVLrIp8Jrkr603ewsI965B/ZoTFY+j6eH47BUm3kSGwHp0XdLHjIvL0IbfUgBrag3BR4AIUE+ktQ8Wn/wBT13EhEJiFIyZy9sxbITxizol6TNJrwWOrrKmoaJRFcQOZhslWkh6LyzimoXmHASn3w9fxyvmbPx9M4EpiVWzy84zY6708lip68JeDCpxP0qjxRrpC4H70LdApEdktFolI86xbbjeoB2sUMlAWQqA0xiqhnxuoO3WewBgrqtZBUNS0p4nYcq7rIf9LTh6h0suTrarRJG0dHiK+Kjq/7sB1eTDscVUnNEMCLnjJQFAnfImXfM8+NfNVH7T1QR9/WXRbAdi7v+LCCEliQsyjxFRBGWPWsr74zuVz/MI7XD3LBYXaTACb4ldqbIcdIWeoBgg+GqdzjSy1835oDETJI4UNeWhW39F5J/O+f/yPbDRj2Smtt3Za/hEJSelsWGCw2rPCc3ff13xE0SbQ/hMTCWh7Rd3Emh3Zw1MX2lNOajf5qcOFjRCEy3YtFCLtMutggmjLUUYbMpmw6ilTAZk67apJDbSjZ+4ymxm96F8gpSDH7Z0sGoE15IRS5jz5t7YwffnDI3wlVgrRHHL57FZhYcuLDFTMcFDfxK2oVvIc83+yQqq46L09kye6U5mx2Cgi121xzsWYFA962bSgU+vhvYxsIXMIAzPTCZsJbGt9b1/9O//VYO/13M627GMLOUsDq8rM1H1XUZR2S7YyzQ3mBpRl30PKI07FQgYerZLHdfqMaop+N5fYDW0/VNgDyvYnUq39FUelNZFjeMT+PFhZdBb3Dg4+UH3dAP/TzrUQhIq7pdMIuicDmZevOR7xTvlsWUlXQY7DkvpjzDiNdhWwm7F4/UL2L6QBH3MLVG3T04Om3ZwJsB6PlofhBE5uxF4sa/B+GZ53jPbEfhUqwDsAx8QzIMDds2Mw4VCD6Jr80cyn6GumA1SW8pDIUgMQ+Mun9Lg1jtFZWyrtyAVwb+fZ9zM54fpEpnaBSFi3StH92PIh3NMFK4LUJ1ERnnK5JQ0o+8d6u7ptiDLQDDsakeZHzWIqAhJaFj6ON/MWmeO7oCUI8DleR6FoKBL19uIcPznYxLdf367px425ai+1aLOpUJlcGuvUyU1XcgM9dJ6MwtnE/DNVXTTJFVhagIWbiJHf2ppJPJ2w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a7df6f5-bfdd-4475-77d4-08dab4a34c7b X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:28.3112 (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: 0PkSyBXhJX3mTCslYDZOD73DMPtCVR4tP0aZDU0gAxI9ayO5HAv2ruy1n5MkTHZyBI4qxnkCMOD4P6kYByhOdmgu5xrqBtjIPvl7fUW6LYA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5150 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: 6KnDQvMDllFa2Z8XORcrmLO-U8vkuySh X-Proofpoint-ORIG-GUID: 6KnDQvMDllFa2Z8XORcrmLO-U8vkuySh 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 Reviewed-by: Martin Wilck Reviewed-by: Bart Van Assche --- 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 Sun Oct 23 03:03: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: 617788 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 9E559C04A95 for ; Sun, 23 Oct 2022 03:07:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230036AbiJWDHY (ORCPT ); Sat, 22 Oct 2022 23:07:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230006AbiJWDG4 (ORCPT ); Sat, 22 Oct 2022 23:06:56 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6CC9719AA for ; Sat, 22 Oct 2022 20:06:47 -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 29MKvuj8001390; Sun, 23 Oct 2022 03:04: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=5qGq1GjkGe6KPqYs8n0AlyWjCvPVGaFvDm7qWcYrW/4=; b=LKgaB/b4Hz5EWoswRBKXyszv7OMUT2083Vlh2pdG+ejDfj7Gt3A/mbNlIzs+S+fEpVKD iTKuyZMUB5z9CIWzKWAJmrfalNyRfa6aH6/sh+j0ZdZMCW3wGu23w3IK4y/w0Hwm423A t9ZnizNwO+uwEGdR+gOb/GbBvmcqIliPCcuo4/bya37poZNp7Ow+LXWj35s8zxvUqzhY oH8fMIFNx8uL9nZ6tD51QIiWHgfDuYwkZ/vdWMqOvHkzR4aI/o0LkEZz/QNBUt3KiC3B jSfn1bS1lxgzXRo+H+r08rewTVND9u2EkFnyvwW0nURJzFQHQfpJ3cxZqNi5iR9q6l92 fg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc8db95n4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:39 +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 29N30Vmu032218; Sun, 23 Oct 2022 03:04:30 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2172.outbound.protection.outlook.com [104.47.55.172]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y30ajx-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dYIcOjffkXZQ3oCVHLBt+aA1fvu3b9DH3iO24NfOnrwmfIQ3R094MBtQYtLrnRT2k6/zhvgdEABzh7iIB6t7ajGfXAdMV5pOHohcks2M07gGhrjHvqu48e3//dfcghHuvht37CeqQfPf+5N5vQLH9NZEQwKqpm4pjFM6KS5xwEU7GynvuptLqUCyRJ6nlkUUL6bmbjJMr+pxqSxvj42OGxrKWB2bHt1fvnzhG5HlkCC0S66TkOdpt3lHnQUS0UQmIGZel6iZJFLmZFynr3d6FUCCM5wPEZw9vR3TEi+SjgMpdY0qZM9aY7V86zZ+kd+SYYySXETf/43tPCB84TTPqQ== 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=5qGq1GjkGe6KPqYs8n0AlyWjCvPVGaFvDm7qWcYrW/4=; b=XBRjpETK5LCPrNAFKWWSMq/QGlttAdf3uuObpjAamVS4YySFAsKDHWyJ5i0RBNt3NuzNkEaXMZBk9gW0H8r7RPwExjLqDiAvpXeB2IvYqQ4/HdytUAh18snsf7fRPVmfebQheu4LISBQqJJe7bQVBDB/25vsHjLga2JbCltZu6thLguiWqnuW+x3pogfXmuEPHevrV+bvfGqs/0+JCfNGumJCqe7r7uubBoy0yvfe39gRmdmiFYuks+mXtQaZxsplvo9OzludGY0MPmBiaqsyyukN8/EhVJWPkVNQhUlxntW3Gt0uBtPyqMwMY09wPvm+QFPAAuwokOYna9+BQMndQ== 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=5qGq1GjkGe6KPqYs8n0AlyWjCvPVGaFvDm7qWcYrW/4=; b=ljrxvIZBfILl1H85AFTDi3HqlxVAwd/QSg1EYBefdiNJzyQJqwBZcmAqCWWBW/dapsLTnUHIL6JhnDJEeRDgxnIHtCOpYxzvgbvByBZ89/ZW4Ie52PjV+2U2Zc+85/+hTsZLBvNblMiYLvfmGAt0R9ObHDuqSp8xNJL8+IE7RgY= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS7PR10MB5150.namprd10.prod.outlook.com (2603:10b6:5:3a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:29 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04: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 v5 15/35] scsi: virtio_scsi: Convert to scsi_exec_req Date: Sat, 22 Oct 2022 22:03:43 -0500 Message-Id: <20221023030403.33845-16-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR16CA0001.namprd16.prod.outlook.com (2603:10b6:610:50::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_|DS7PR10MB5150:EE_ X-MS-Office365-Filtering-Correlation-Id: 88b7586c-d169-4645-1b76-08dab4a34d46 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N7NV4gYg8tNTUeeZo6GUXLyRdSalPmZ1+V59zNcDgcEa060gQ546u+LAPTZOqIeSxurZH1eKeYWY4MrprWEOtnjQlbq5LxYvI1wMrgh019gB6RI3hxrm2iTN10GlAHaB43txdg2WX86wLq5u97n2fSMe/OupkGxP91Ad6/F/jqQwLwrKJXVgTa7QEUJQK+bIiBvp5Ei1qxKq0qAJPb59wfKO5vy4UwzOOtXnZOGfzI1zZsa4rxNPjpdk69I3f6hn1z1tF5DdklZ3A6lqf94ATOy0Na4MEWsXjNs1uyE++DhkyecOdlrcbiVaWPlcPHCmwpa1eZssOpfjzgpMEdYyYnXgGbNApPb225cFw5zwC5ZMOWrdbtyeFOe4rxt7jL/LKafHjQlxs2JZh/YTdYkqIclOkjoPwhKYke3O95O+aSCi2syVg/hAHkiDH/BHHMZFN3pG6rMuH+7xfrZdztIK13SrNQwl4Z75kzpAyVX7/slXIOkRXZ9stRKrWgKG4duv9qk0aRsO1gkbp97izhwj4o2zhFCtLWyfeB3DP6kisXVM3XEM3MCZ6vXlDQi7y0vBHDKbUqCLgSSfMyVkDo3iimGRlc66L87KEbZNvZ3HAVU+tBf3yDBidc8z2QJc8TrE+PQfRL4fOIPl4QLoT6o8/1BtHeQDPGr+zn/6wulOoqAdAzFfPk+utKhD3KVg7aVJ3ucua5LcJ1flKCRQKzlU0w== 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)(396003)(39860400002)(346002)(136003)(366004)(376002)(451199015)(478600001)(8676002)(4326008)(36756003)(186003)(1076003)(66476007)(66556008)(86362001)(66946007)(38100700002)(41300700001)(6486002)(83380400001)(2906002)(6506007)(26005)(107886003)(2616005)(316002)(6512007)(6666004)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: o5sJOOEatpxIzkdVDWicqpEs2NerxITts41hjQO7/wkl84JeCQwl2nMne3+Sm4AyIK5th6f0hYLI3sILWDUGnZmdysq8tb2xrsV1obvlvhkpybVCDSJhqOP0PD3LOyUAH8u50pqsb1XceXnEXWi6ZE+PFmUXT1HP56xNv848yH2ME/to9LxgGA5UkLsPKtGAzBwlkSFjM5QTbG56TZL7G3MdblCxM72wUcXEHYF6cWvfqK6twVv3vG8/Fq32J6VedzreV6NhQtF1jdrlI9xnRGmFNgecuutecp8Bi2QeEGvd7NsITPFlIruvIVqu7BiAprdJz85HXol4cItAKIxv1AshVn2sdquzP3VDDvusnVvup/64JVPbg2jO6KM59w/5Ib81If2apYL4UyqG7SqAJY8xvjJ7rgSmAKJle3XRl22pALYkO6RehA49cf5Zk8zIWrmCLsyF6Qp3Dr/6JCEFSMDejJ5Q462f9ZKaJaIG+8Z7UDF+t2brq6nrasJZjZKu95Q+rAi+EuSbsgBkAVCywKTHC7H8/Qwj6wKHdkM0hy9wNl9Pi3WA4U6fI0wZU8oGhMBFNy8QMcZQhaUQ3+xpAnqp8GGpuyDvU0Mto5VIOdCPM1qirRBAyg3rmJN7/1U0RLO2JBXsOrMrAdaMq+Zg76Cy6xTZAM85ixCLkTGAPahzDMTMu3rBil9bYADs1iKn4rfZPZb1kvhI5wO3049rDDJznRI/DXlzlghepCCI5UMgb+fcRzfT9PlDMF24RJtLEEKOtzpdBCwpWZ/OQ47JxBDsoV8ZYySIOZOv12lUwX2jmEpf8uehCndVFxcqFawZJeCtkI2mwEWTTxKU4erGF3WbxnDN4Ag4PleiJ2Wffr4nniGkMBoW0BXZkv8wzhdkKAEc4S11iD/0s4Tfk/QClaYfUAUAXUTTx4n0zNxDD/nxeB14WJD9plv/oUMFvvu5pQEt7YUls8wgup0k+KN2fhaa76S9PepEjDuAhlXP/gjhQdL8itmKTKXlvpgIQvaGIrZzI8ChqH/p0TbKDCHeabx4lO/ZSe6TLLO9KBqEeB5O09wRUs2pTJGxBIPl9Nk9EerXaSLNFabPa52t3bHEzYKIIQA/qVQrQC4lEMP94d56nLjie3f1uvrHY0RHMe8wVKSSg9Ep0f7xR9HVIy2lRi1mtBMc+pci13EalBPYcqplmm8F684RAS8oDuGoVPHxYINZBl5edE4KWPCFUEjGgLoNUHtL4EbnqmLMZ8l5VBRtg/9pcTQ64tNOF3Roe/Jro4ZBgxpr/8+DjXqkNa6qDyH2Es4rvNWHwS64LmuaKx1KN6G4PHkZxcmias1UeJng/bxxtaeef0vUuS1jfUWoTCXIRmXS+lA9uADDkf/emjrCE/kKZebeyS2VHMqq7E3xge3k5VNNNnOoIRjOkSSr1R5t54cTaNnhDAKwxdsyaSZmyD9IM6zMcbXolsMsCzY/+G9y9CeF2texVaCJSSE+iXYG4PAFaoGdflKObqOF3X3XQYBDWPd/GEucnE98ztxcweNQ/E/D3GJvNvUsOJio+qKzWO3N+phLTL1RR7/ejQx+sn5lktTYULlTUpNFLXYTyLKeqW0e8HTDGYNdwG3g0g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 88b7586c-d169-4645-1b76-08dab4a34d46 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:29.6393 (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: DXVW7rT5Ynn4ns7nZZ1r9QwRj2aIob6EhoEyUm6TN2YahzAO75DSpI5EC1RtHmIMZBTzWG0lK/R1rrpX8nOdPn/wnIqZtkIBKs8WcdUb59g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5150 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-ORIG-GUID: z_6dbUf_NLHXyj10Q_a6Vl9Q9FEZjK0F X-Proofpoint-GUID: z_6dbUf_NLHXyj10Q_a6Vl9Q9FEZjK0F 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 Reviewed-by: Martin Wilck Reviewed-by: Bart Van Assche --- 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 2a79ab16134b..9dbec7188995 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 Sun Oct 23 03:03: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: 617790 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 D1725C433FE for ; Sun, 23 Oct 2022 03:07:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230022AbiJWDHM (ORCPT ); Sat, 22 Oct 2022 23:07:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230023AbiJWDGx (ORCPT ); Sat, 22 Oct 2022 23:06:53 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AFA668CEC for ; Sat, 22 Oct 2022 20:06:40 -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 29N2tKAc007345; Sun, 23 Oct 2022 03:04:33 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=vagzyVM1BxkbBzp1aoQugIpEA/mf0pDjxNFPXzUVrMg=; b=kLJzDMIheghDztzPuQqlOZxdcTHO/ksXnr7h4TVhj2MnoRUlhhcoiwQz3kCBsSxi0bed Jl9qgsS7on4q+cj/N0QM9CnwOX+t0GXXwqjhXO1oh2Rk8L79vFknQGXe3bMBVeMcOWCs i7z47yr3EQH5WGw6zAzC3SCY7U4PlQkOw0EzMB9kjhiBAk9LrLxJfztda9tJsMK7zfXk njt8shLURJ2bJWGGQn7ia1kdAUCZhVDETYQaplXjqBhawx9FXrNx5PMpdpTmp7N6Cxah RGWJ8x2XKSF+JoUzU2SdB/FRiD2iYtz91WULfu2k1He1e6cPYVrNRNedZnwscdubsIC7 Cw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc6xds4v9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:33 +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 29MKrRhn015467; Sun, 23 Oct 2022 03:04:32 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2175.outbound.protection.outlook.com [104.47.59.175]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y2g7qy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MO6pTiXWQvgFhdLcMW2xU6Q/TrDiNMPPOlpCdxzZglxPOHHgUSTFFY7h1BrVdbKOwScjTukrpEHj7h/sTQ/El2bq+hGN6b2VFJ66YVfG8nCkao7F3jRAkreiHUwqKpI3XwkZpnkM9LiMaQZqC5VVWsgkl4n9XG9jhGiKYI+OstGVGMfIMFp4eNiOEjzzvm7qaW1Qawoyg7VLMKqH7ruBIH6VW68u0MS2KDeeQFl1H+C0EJDl4rN4q3LOgrlV4uQ0cgcT/85oHbUTMpnqD0JdaX15/F+PCFZSkJyNMsoKUGtxsVKHqK+SHdtCZ6wuMSNoORfPSdq/n8Y2KVbxhQZ8wA== 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=vagzyVM1BxkbBzp1aoQugIpEA/mf0pDjxNFPXzUVrMg=; b=Cq/DVjyA0pNHioPRDicQPt801mJzNZW1Pn2ejf9c01SgtGOOR0U859O/WHmWNKj+Vg+XWIKQiV742Khk30Nl5wJbVKc7r81bPXTGFnXnbiZ3Ba09zAJO54VzMk/qNRpKEhF/dFiaye+9PLL7k7HL5zHOFwR1oX+07UQc31k4ipuzatsiWrk04dAvvd0q9EYeb5pbgDet7aJbyiWkZUROQT9SnEXwm5D9jFTy5T8gZaoCM7wy46ItQCZZxMFKaiLJU75QBhOuz91EdskaJD/pq0s9bpttMEoj+8MrFasmhw3Clx536//qTa15WGdJ5tSEnEADjK7iYvIWv21sprjkYw== 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=vagzyVM1BxkbBzp1aoQugIpEA/mf0pDjxNFPXzUVrMg=; b=pywFswAfEK6LTM1kq11T96BEoIVuen9aaRWKakFDAOkJxo2CG7dzqOxY9lrLf6yOhyGi3f1iQVbaM+SRqNBWhkdeU42iWdhm+lnjYqRyK2TXgSjdPWx/amBmwy+EhR9FwRngtyzezGqW3QGLeeamf3qhQE795Xp0LUNDWV8HRxk= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS7PR10MB5150.namprd10.prod.outlook.com (2603:10b6:5:3a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:31 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04: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 v5 16/35] scsi: target_core_pscsi: Convert to scsi_exec_req Date: Sat, 22 Oct 2022 22:03:44 -0500 Message-Id: <20221023030403.33845-17-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR04CA0009.namprd04.prod.outlook.com (2603:10b6:610:76::14) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS7PR10MB5150:EE_ X-MS-Office365-Filtering-Correlation-Id: 9e50c1dd-1caa-4aab-4852-08dab4a34e1a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E64VIMDP1IruD9h/LL0qABizXfKRliiDaEwBUFKNe3bxDlNgtdMtHodTiwWnpuqR5nRBlvR/oloAVSDb8yGBwOw344Z2R//cUHk67yD5KgH4ZdPyUl7F0pPdz6gDiKaPcmnWLxHv8fkJRNckm76XiyBUloQjMnWMEzMMlcB5q43RKvnP4OUVseoitCI5b/cCe63CBGXj66y0GVxRvD+1Qg+on9oFGxopNlSDkEc0U1ZFVceo/t8HhhZ1ZjWbw1GP9cw2pVVxJSMpeqOwptGP7zsIDmkrWf2i3H9DtIEIZ3T2OHWHRQx6Fu+wv0D5u9FewKy2zg6D8zwt7JnOO5hWydWID3cFJ51h8c493VsJclBaBZe4zfOPUmCFt9XN2dVr1ht6prBcp4ntQaA4ZIENr4FSWuJlJDgOP2KpE/RXT9fvwLZtJTvdzTMct3L8jRAiQ6n8gDXIqzImbgKlOZxBJ8f4Gz3yvReGe0xQ+SGEs8shpHeYK+iMuKlaWHwCSZqv7r6YfShRM2r+MuiYvP+OfbtF3FXhbi85z/l5Pt6e7rgjReKj/R4EfFrupyw95rOr23hZyqbHWbeENuRcqX5iMp6GFRddwMIYsqA8CbIp68IEtF3o93xBNQY5huDPylQuGuOooCjzoeJJ2nwf7iaqeFYjJ3ICXmfYm5mghRiIiOwbpgNayBIbWpg6DYMvgFkKddSP7xBLA3o9or6MHeimxA== 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)(396003)(39860400002)(346002)(136003)(366004)(376002)(451199015)(478600001)(8676002)(4326008)(36756003)(186003)(1076003)(66476007)(66556008)(86362001)(66946007)(38100700002)(41300700001)(6486002)(83380400001)(2906002)(6506007)(26005)(107886003)(2616005)(316002)(6512007)(6666004)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cJ5C10faX1sgcPf1WB18mSpEtjGvEc/pjw9ULeZ6aYgyvEImyvPOApthaOkoP6OBYeBGJF/VarVJTalX1lL9EbHuVPf86Pi+pXyKtHRQ2JrrTriZdCNOKrW2i3NpNgIRkRF6nSTGn0R0W9ehTxhBxW5EmMv/XMFQv2dEgkSmo4oKrQuvbnVJp0jz8fqdwaryp9jhnJby3n2W7IkOC8G7CD/QYFnrVU1eKisrk3JQliRifScR5XChF8dXsqguVEZn3hnAY7omUGB8i1/bZqPqFjavo9ZhClt3lNfV/ux+rn9+t/o6e4SW3zclVFsjrWomwOuuW/oK0Bcj/sPuwkeXFwKPPlgvtmTESqXToI+h2HjYQM19niTlbGOZGYFzSEZHdz4H5RPGW6/PzZdO9Zxjdt0YIF3lgDTwVARw68rRCBx1HgI3jgRKcCqS3rM7yzvN7OcEAcFSbrLPWggCSaDLzeLjG97lixTxrc0Ct7nA6pogYMNICfFuG1tuAMuntVw/S+uDstux/3qWGCCphdcjKG2DVzkuEUsqfR1x+az4kswi0g2OgAxNu9HJdfJZZGXbA9StMBOt1N+YtWxfKJBDw1C8fRCmLP17GIk66zlLbHbJ8Zw2ylgkv9nGIIyXLJfJ+9w76QtUpPod5/bh1j91Lg5oS8xz9CUa8PIdrwOI1yqGasOXeHbtKmGqfOi78mJ9VugczUPg0JqtK3c3V0mnW3tUm0ycEyeVP5gw7r0AKzzPjbmWhJsaNoaEd8aA4EOJN1qoxT68/607zGIaYCY/nz0RSb3Q/UMO67wNeQixevqZie8oaXJE2wzMdpSbeliL/8fKu0zqJAgugR+jZG34NGuLMwvxxQvOgzv7ot/ZBbXW/l/41MdEb0+Xrsf0IVR4iaOCpzLGMFY7HuwiA5RFaPT71ZaqFi3SBprdU30UwRIeH9yN5GGplEynFqRDOwHxWvTpDDxf/kYTuf40O4p9YMWQ30MLzU5+V83sLuslozZVvyVy7lfqQs/szjDF3f0xMUMq/jxdzQW2x7ceVuPHnt0+sTzZl12W+x04rGy6iqIrDcVGcsP/xDR9th6QJI113HzhuIGzyqDgmhwXDIFy0Db9yn2ZtTyPY3nTl5mQr6GY2/3PKV70XPd4opJfRa/wvyAQJorWiFWaDs3GgdrG3eXYJxyuKfu2cQ9cZ0ZPoQn0ALn+omoekg6V/Z6cvIHLmDda8AfHHX2fPzOYHkqqR5I2OjmIBcxl1c2HH94Sw+Db9ndoNd1ev7f3DFlwyEja1sYUiIlJJ4r1fYN8VCGz4iO6ItlVjI6JvzqWVUactLk1jrslAssRf0j/+lFmFz85UgJmpImOx3FXZ8rH8Y+0hqxxMpYlaPXxBtxLR0HN/qyWFL/YVMu4TRBZaiCDl81/Wma0IzchFAuvsEzqS6jJV1AB69g0/R9IzRMcVlOGTH12axcvj1elvDc7+c+Z7LNZwMJZ3jYFRtaLBkxwA001XyKx0E6MoRatmGR+8m1L3PildT8grISRjZBq8bnhIDOmR1H6hK861ZwZPod4lnbLyOoVXB2tkTLnGv0gXuvkkNZGPKCCCafGRqZuvDj7y59x+eH5dj2j+7CaIAtpF0pbmg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e50c1dd-1caa-4aab-4852-08dab4a34e1a X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:31.0454 (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: LkvzlsX+XZOJKWSen7blCQuTiePZLzqMrkUxbjq9m9ebxPd7umURcV3FYe79aBq+2ygHNRk+gWymZyonYvB776ETJZBsm7dN1L8/HXxx12g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5150 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: FEW0BGuriwQc7aDtCGUtVHty56Wn3sFJ X-Proofpoint-ORIG-GUID: FEW0BGuriwQc7aDtCGUtVHty56Wn3sFJ 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 Reviewed-by: Martin Wilck Reviewed-by: Bart Van Assche --- 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 69a4c9581e80..f2f4ff0b53e1 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 Sun Oct 23 03:03: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: 618716 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 7D758C433FE for ; Sun, 23 Oct 2022 03:07:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230008AbiJWDH1 (ORCPT ); Sat, 22 Oct 2022 23:07:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230004AbiJWDG4 (ORCPT ); Sat, 22 Oct 2022 23:06:56 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6DD171BCD for ; Sat, 22 Oct 2022 20:06:47 -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 29MKvuj9001390; Sun, 23 Oct 2022 03:04:40 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=Ny4VT0kwLgtNnv1k8vwa3rPPMHTsSpr3Xikt3BRBKkY=; b=ZbpKSVL+akpeEkrzsR+Nm8ih8U4b4UKPFCkvmJ2W/Wyp3u+uG9eSc2cdaOlq5xiRoauW pIR11y5RTJ/nnYFdn8DIFn67ktjk2BDDUG5o8162RodZwG/2miypI33YtBP5GztZ2OQm ZYEfOiVUTo4B8PahJL55DEnD7mb/WB8SZj3W0eLA0TaMAMFgxHM1ER/Hj+G+jN6MDwsA 0YYaULQx2n5DzlqRmEFP2/3aeABKGKmfN+79ep31RBPqiYGqMIrfwz0oNxivY4mXkS2x vV6h8/HZF/n+1FsGOBJjwXuyiRiepY5BTebrYlCoNPKHHkYBdwQ3Og413V1+8e8Xf+es Mw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc8db95n6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:39 +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 29MKZ43U016751; Sun, 23 Oct 2022 03:04:33 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2176.outbound.protection.outlook.com [104.47.59.176]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y90ndk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=THum4IwdCtVOSiGlMIqhGpl5uoLhDXFYRLky+DR95KsNo5yWMg6v+Ef73XAur8a9A++kS46SdDHYpzft3+u7ADg+eaDMtjZRX8DIvHgsrIdY7UrlWWY+yc5fMtcg+sR92pG3aY8hVbMdPJy6QZdsD1ZVtE1tq/Lw6tefY8ZY4vQ+rVuAYeiRu1ZCp8uwcGBxUCJi1jBlofE85BEKIEYZrDdWIzuuNjIoR/1IK1FIbpEd2ZTaS17lXj/4952cPDXwhjBbEnd1CX2g+xvklzi1JIN9GtdFAZnomOFjyZPD2HocIHUyhoHbEAadgcIM6mDeHEVBBy5rNQUhnQNIXeyh1Q== 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=Ny4VT0kwLgtNnv1k8vwa3rPPMHTsSpr3Xikt3BRBKkY=; b=avYCRll6t3HvpkqHjorG0/t7NSYiF82F/zo9czQF1XGYHrmz2Ci7CtgUSM5YXyH0qqN5TJQ6aYYrmbUpgt6MmmKo2jQTei9tkF1JMLKYO/DDjEnM2R+jQ+Jomhx0EE5ZDMj4fwfKcn1VIDBuqVoYt5twxSNA5ZqM9Jzqy8GomUH56AQW1wna7N2T2LmdG6H8Xyae3mZyWTe4HUIWsoZFi7ydtfyQjtbM4DJgiJbjxxMtnsJnSiKePtW/1iLtUUzmW6jeLgg6Kz1kvsUpw7y3i9EobmZm0h+0Nvw9FedSqLaooa471NT4w4MiiLyXVjjGAATPtDQYfnTxOk/Zi6S92w== 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=Ny4VT0kwLgtNnv1k8vwa3rPPMHTsSpr3Xikt3BRBKkY=; b=Qp69dVuCfB0NjwEbpW2zLet2pvjUL8Lcj3UxUxzI8zJoNTAywikL3oHra/9Wwt7AH9qEDrEGol42WjzuN/vu4ZVPsC7WYlusLXyZIvlpRlTVodyqir+ozJIEenomsGX36yAmSXGdDBcWaDsXWOoPEXBuaqrGFA4xGvZXjusn7gA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS7PR10MB5150.namprd10.prod.outlook.com (2603:10b6:5:3a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:32 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04: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 v5 17/35] scsi: ufshcd: Convert to scsi_exec_req Date: Sat, 22 Oct 2022 22:03:45 -0500 Message-Id: <20221023030403.33845-18-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR08CA0009.namprd08.prod.outlook.com (2603:10b6:610:5a::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_|DS7PR10MB5150:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c8fccfb-0db2-46c0-89a2-08dab4a34ee2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DD5EPyip80XqnqWqEW5moMXPr4BxS7K1g/tW9WWkCySVxiDUrqWvOzqYK9bYoPDceDX7rdIk7lU3i/TNVYGq7Keq2Egf4U281nlY8Lr3XMYWO1gYLEX6busjcQjOSVP0FbJ93XBfK3OZBelCCz1qB/6hEOZ8Qm/V3JQpFKVRkCweRM2MTNEDmsgujHDEzCwThnpFPx22pL/AA5dCbQT/k3SgPKYZe2N6DUK/kXtwXVY4F/Xpy8uHbUIJbtMiIcR9wjiS5GeQk7+2mWlOkznbWQklOTK7WgB+p4jpzBjrZn6AgKyJwn5H9GooIfaZr9MNwsjmo+MF5VIoyK2luGpd0APMxPkl9OqgphAa+S2M41Q9wf8b3Qr13dcBR4FJXhi7buu134wD02WvJUauJEUFI6gcZmq1fngKzLaCMgTaVFOVs7a9ccK3goTAJPY7svrBZDFmsP/4bxPwaM02+DhP2tauHYmxfntwD9/VBstRCRzz1vFsfFBVJ2DaYfwAv4YB8OT8+Ip6xjzhl00NwhqQ99tNAnopEZ8+PglAbWj/WL61MAWBmjJwj5k28j4s0p0Rk1rjxKBmLxb2heL9tsSOXL7g4bWLUdXBomtfEHMU/8Is/mtwTui2eH/+OTWXLY2PGXhtB5JrAwJ6sJc2jJn7doBF995A1m0sUabVax1bmu7zR6XafZbPeE+LWYie8dR6Ldo+IihBDiDN9EqkLUdI8w== 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)(396003)(39860400002)(346002)(136003)(366004)(376002)(451199015)(478600001)(8676002)(4326008)(36756003)(186003)(1076003)(66476007)(66556008)(86362001)(66946007)(38100700002)(41300700001)(6486002)(83380400001)(2906002)(6506007)(26005)(107886003)(2616005)(316002)(6512007)(6666004)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wQak4Swj/rhJUAKELcbj9YITLc36rdrLH05Yg3Cib8pmTbB8o0VHoW/P1vIWQQh3sZF4lHWTZQDfjVlhx615eKbR75YV2EaZuSGyWeTcCwMt/05Zf5m0Tyw3Twd4/8BlvQTKD+puKTOKrwM2nDiss6XH+jMMs7JFp1j3r3ZadxkpqhAVAifob9MNMY9RgO8kLlab/qpzw74kMeMzpEJzNmqHO9PHcsOiUXfMmTUq07umWKQyb88Lr1SKHxr1WDQA4vqEQoEtOBcFkWwsCRrJPWX7lskqzDm5V7GV7lIB/mBRBHpGAM6DBcxy5Jgi2AwKpcp5dIYgKI2nWVMJCaijhphzKzPnMgoU8PcZY7Y62VkYxqo0cz4dOft72lYDERytbqqOQxEsEkJ0gwxKs5nljPZhOx6K9ZwVGio/8KCdJTiGwLUsaaAHtMosCCpZCXamADR1yDp+CJRE7s+TNRmKMDs7IJd/gvMONBSES7zhCnk99mWwycAzHIQSQLUSRzg/IftOqWajNHAWa9JwVZWuDkg/VjiAVkSwc2WmOfMbS5x04DmbUhKNL9IDWk7OjSnXOzFT9RYNaBpesxbmnONCErB+3i/MS4Sz8RTsF5b0sAHW7e+Za0gF21Woej69kAAyJKJaQgx1tsl9EC1XLt4ODxUJgAECqnazx8I4pOmoRyXw+w/21CV607OTeTpWVbBP44DiX8+orD0OQtvWbdZFXsWVzii2DjBlClNcZpJrsi9PDbDIE1+DJbQ6hURf6nUrJwV3if2S26d7EfcZ0aOXD2kxyzw+xS2tuELW6MGsmYTvAugGI5EqLmnQy+ljxVVbPRg9BYsN6fC3YjfeqvBLs4nYzE1SxwbzddAPTon1CX4viUlkncRDyJpVch7DYX06kA+LJykOXNm2r03Xku7BSFL/r3u3HkioiZjfPeUBwkFY+C8FEqVyHvQeWMdY9UaU1GJf/Lar5B23yfORj0XiipdiDJvneikb9jOkSTVGl8RKzeZJRjcP9F+NU3CUejYN2x6pH+SD9qVC6CrVJwzxih3fwot84bYYCLZPMX5wkRsIOCYV96wDGtn9ayoI38dqDC/m8fRZgGmQCVP3Bzbv8RAZ+rEOJFluKQFTQ0o/PRF0mnJ9beFKeZTXTK7vatawcqphBOZQMxHhy0QV7uz/fOLANEL1ECKFEipI0HvhLuvCQt49FT6YwZSLESl7OWVvjFioP5Rliiqfx/qSZaIU4O9jfIsh31qkrm/U5HCIum2ciQgrbcwHPj5p1r5lSNYIjkJ/Q/PMZtf6OiTxtqXRiZLSb+k6e4GP0si1dIBglYQ4sq5qUt1xZSLHiiZqTjMrc/IjlodRWX4Doef9sXMp6RUh4/6uImr5ij1AIYyF2XIZ9wBxZl31+aE5/V9FxKUmlxdkwlJjG6Fgz9CbXAvNWat/EYITnkRiI0NdAf0DTwlSTypQFIB06NBBw6/7YLgdjnyl7ll1rxNbkeJm0ID9VEEEjdpQoWyJ58XjOYVEdWhJIwn3Q/fKQEmjcte1RaEqk/O8DI44RxfU1P9A1ZPQklVjEXmkNGu3wqd6otBsemNE4I6PYfYuwNy7/n3DOU7dhDxVaKTXUt98iSDpLSoeOA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c8fccfb-0db2-46c0-89a2-08dab4a34ee2 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:32.3265 (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: n1icPyLrIx3YWxcjD3g5XryTpWLMTk9ov+LUQqSxvlGdjEGK49/s3lH8yatMHskoGjfxqVFb7OtFWUlXa8UZ3Rj1ZfDAXxs8Lfip0hmdknc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5150 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 spamscore=0 suspectscore=0 bulkscore=0 malwarescore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-ORIG-GUID: 4Zv0MT5D5NIGHm4Gt85Lj-PitL6gse6K X-Proofpoint-GUID: 4Zv0MT5D5NIGHm4Gt85Lj-PitL6gse6K 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 Reviewed-by: Martin Wilck 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 7256e6c43ca6..8ae51ef66b8d 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -8787,8 +8787,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 Sun Oct 23 03:03: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: 617789 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 B4C53C3A59D for ; Sun, 23 Oct 2022 03:07:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbiJWDHS (ORCPT ); Sat, 22 Oct 2022 23:07:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230025AbiJWDGx (ORCPT ); Sat, 22 Oct 2022 23:06:53 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7B5A6CF73 for ; Sat, 22 Oct 2022 20:06:46 -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 29N2tKAn015631; Sun, 23 Oct 2022 03:04: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=GbK6EOCeB16Hxeh5BeQ0zE668MA1KGgbX1F5LCZEsSM=; b=IDHNEiaeuun76iXwoqnuAwG9xcaMI5Lmaq1F6nwYP/+qoz4D2Eoxdlk9HbdBlDlAAINh AzNN4/DuTV350EO0r2UcfA5TXP7tvBBIpqIeAdXusp6glfWhB62lofO63TEbE9bAak+J sZyos098PWwPPVsR5+VS8yW3tckuRoBtTQpsdDl/RODp1nmntJl7WlaFD5+uiufMV2Sp /20e5JzCXRUnJn5Wj7OQJCJnkKs2atyofMNXoJQiL8Ebk57jx34iDxf1JobdaWldE13T 9Eklx5JgJoG32V0KB79I087w1zcI4dIKTuoerA/jpYGkLQKno94Rft6k7J8wj59tH4B0 ag== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc7a2s4q2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:36 +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 29MKH3OP032306; Sun, 23 Oct 2022 03:04:35 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2176.outbound.protection.outlook.com [104.47.59.176]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y30ake-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ed8lwOj2WPrM49fO/6UV8MQvpwPJUc/YBxJ9V3979TKae8y2sZXmh5t/7iC7wKlYc29H8ORKsjftQ3OUn0NE9CNQjXTxxcRJuhSYdQDw/oXm5JHFTH4S828H/ZvS05ay11Y40hgAS9CJNIW2KCoYY0sUfBNe+mfXU0JL9YWWCmJ17T57pOQxB/9SC86i6amdM0oTxyWrTsMQngwQz9hqU9ShH0bOT/WxBdNVqMfQLxETVOjIEVYBwsc1tggZAWyMfKtrkX8RgcJGyejVoKobiZuT+QVo4J7Q/utCHwVvXZs3vtNkk20pydn5P75hhUzUhdABRu8ZK6SzjaIwxCWo4Q== 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=GbK6EOCeB16Hxeh5BeQ0zE668MA1KGgbX1F5LCZEsSM=; b=gXokZL0f/46mlCBeQFi+/S5MZyGGOgSrc+4IV+OX1ERGa7GG3MFkEuMTMMeE/1t4a2fPLx0I9BrZnmdzvoWuwgHnzODAV8jAyerg804veCSQQalkTkR3RQYvFqqKEY6fwkO7ul+yPYYgcfQx8DD50fauEUc72+6YrrbxEtEo8oABjxt6vygJp2cMmsU3XP7/HfklXhvhFJuwJ7cCwRYCNCnKt3QAlBFQbhXOEIjPMbnBrGRKo4AxX6H4xCJJMz+GhpdIUIRfitzXnFUIUnfRD/pQqqiMgiCpkdwRiDyVolCBGZaDPdLf80xnCx5O4WtRJhXKCIisC5Fa0VL6nElfnQ== 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=GbK6EOCeB16Hxeh5BeQ0zE668MA1KGgbX1F5LCZEsSM=; b=TpROj5yBHfzDUJdk9HsUUMkmGif4djDZzVdDqPs/sPVa1E5im7SFflm3m2RcbZkYo6rMqhnXwEUMCLhuw5bylxHXJrIh1LzGCKos8jg9oCscr5Al7zIRbC+Kdief7rWYz5aeY/WodSnMhttPJYu9fsvaXHi9HC7YWW/HFqsfmNo= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS7PR10MB5150.namprd10.prod.outlook.com (2603:10b6:5:3a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:34 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04: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 v5 18/35] scsi: cxlflash: Convert to scsi_exec_req Date: Sat, 22 Oct 2022 22:03:46 -0500 Message-Id: <20221023030403.33845-19-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR08CA0008.namprd08.prod.outlook.com (2603:10b6:610:5a::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_|DS7PR10MB5150:EE_ X-MS-Office365-Filtering-Correlation-Id: 64fb3da4-b2f7-441e-8d8f-08dab4a34fce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +gobk1FikYBHXg7MLJbv8usg571+EABJ6DeY3WUtDzg7bbJT/O4TxBcUjaP//NN4RaZE7xmCmh+ouHOhSi/SMT45ZN8lcZkCXNQeP1yry/Mq3s4RGYMDNxZTQAC5T+kYT5ZABBnHXAeYTpvpjOsqwbwdqkP9QmGO7zmnwjIdYfi5jvtsEHQMxbz2d/agfXZv8R59oITz+3TF2k+Q4XoqA+mUkm0U0Xuwkyj9MOZ5n5O00P0nb7xiFa8HxNWARtmWcQqTUuOyb0G4t6aOL39rbeod0NK8PWsn8YrfmZWfNGdlDzM+wULP/bneLSwmZ+lNU/07VU6raYXwkBpJd8pSEh7BefSZf+Ww7t3rF7ZFgBb1xUw02+9NMSwZrFPmdd/N3kdy1ps/Zng6V4pN0jf4d3rRDEswsLg/8gGbtamM2f5+qngdAEcx/PqywXXAVjhjsSMxbcc20G8eKlLKkmHTywlcETxoIyHnS//FPTkSI7hqXgWx5twNffu+0CZhboKrkILROGFIU/1e+t6w/NpXBfoaqcm+cDCYOSZd2Lvevg595iYWtE4usyoBrC/1F/3n2QRvqCCjJNXkHO5K4/tW+kAAUPwzHJuz3Z0r8FU+1ZTawNKTOJnY8Xu4/K8JOPnJuFyWIWn7Jv8rkGC/IJwsCFAQrurVn91NUbGlgXJ5YCJ9+QTaA3n9Fmv0huZKmM/Tyq46zInhphGkapCM1XeDNA== 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)(396003)(39860400002)(346002)(136003)(366004)(376002)(451199015)(478600001)(8676002)(4326008)(36756003)(186003)(1076003)(66476007)(66556008)(86362001)(66946007)(38100700002)(41300700001)(6486002)(83380400001)(2906002)(6506007)(26005)(107886003)(2616005)(316002)(6512007)(6666004)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SaHD6dyZ54NZQTCTEIoDW56Hcbx1qgQx47dCt1lC7NdarnYI90S7RMKF15dVB3gMW7u2qlm55wxqGjF9KWxY+l9kce7h2cvBKEqjfs2k6OmnRp8a7ba7fo82ckoXkbJAUv3vuv8lt3sgZKifHwHAw4mWT6NY7Crcr8+HSHxtUoo/92TuHRmPHuykWfVuliMzZt60GIwyMIhvf0otKa8o/s03GHvxQFqfvJatgKruofpfpPvsHWFD7UZEbfaX9HFN2HqJWfsxNRErr9nFY7vnYjdr74zJCtiiMdXw8tmEQZzSGO5zcVMvwkcDTy7f8GD6p08vl8OiA7RxWuVFBxCko+CHsFF5QXhs4qjjOxcbRtwm6I6dhfu6NauCzhpcXZu1MtRiwsFMBDho4vNvbW0wcrB6tAfOI787tBIT67BGMjn7bpaP3GmUDjyHlSP3t9o/djDugl653pfJl8pKb2jLIyYy/Woi8f/Y7Ylb/PKXbj6MMZeQ1JokCULEJ8triYxcm9A71yA8LAUmjFMSxATJUAppE2/McaopTjpK0YzCOWD4yI12H7uDWB6gdUXDesa/a/9QJoYGsdlnqBFeppBqhohlS4hGV1hSKQAQjuQ7FxPKx7GIOkomSDgv3InSlz2mBVHJb5Iy6OVsYfBRfh7DOjLCl/Km5J5Q+bsQU8uIoENR6kvuByVdHsmHyQkDdi3NUUCXzbWITKas7nPsCyfcugxdHebaOZrKowJLijsddwqMp1Y6TZ6FEs14N7htT4Lb4ujl2Qa8MKt2jGO8WUf1XApB1T/2tzHv6EigDKtonhhyJ04tcfnc9SKcVcN4BE+zJs7D9sYdd+NUYLLV6a0bylYRC1E5v6SMq3aYedbpUSa4IGWZNpy8/hH65s7ZObBLIc+LK6N5hWHDQ8rEC+TklMRNpVuwDui5pHFsK7BVfLnlNPDULPbhkZNZiwHDTPTYX2AppM/LMPc50vJlK+7dmVJWR46QEIL2O3VKjnfik8mOXTTbeQwhOgM5MwXLetcl6ATnCh3hFffSeQ0eXKJ7yOCqjbRwqC2/v9QtRAyQCH+kSP3onJoKz2CjBwyfRrwwZ6fBmXWFTjjB5abgZVVIwNvFPKIV3aMAMCNvLmZURMFDMu1M5lrTZmFHZjzKtJvdbuN34pAZpLN0rYYOr14eX95FApVICtb952v0g+9uaq1wxZDi2b6PVtChjzE0rmC8h8CVLrdNfwrQFYAXOEfF6nmN5kQbfUdHjQMc4N3ptJ3C9N6d0kyhHu/MOn9QISYNumPAC+kkS16qcyTEjuOlWmtechwz6Fsrrdg55WocJHD3ku1Ep+WQ9qjcXDPi2O7xKC7nbS0Oc3aHJUXGl8Wv+cQY/xggVZOdqUZfidJ+T2lie/zuUf7PGxLEbcQhlhC1JADGyD9Wy0qGRlQg6cS+dGYwuVa/xQShLro/kYcES7i7yxPeCLugnFEGN1HXz3YBoalK0nFJEFIrbdRHDPEzr3k7gON8YhCKxTdyTDXOVX2Baeo5/LjsYVYFUfaDiz6DDn75DKfbjZPYomaoUlXc83wEq75H4n3xB7BcRaWms/a5WOqTohYzh44gELjIhp/Cuu919duOg0S04zTyCk6Y1Q== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 64fb3da4-b2f7-441e-8d8f-08dab4a34fce X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:33.9202 (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: EjCUuDqyr8g85rumk2A8B+NF06e+Sxuw722u3qlM0JU1uaOY5tB0rfWVmzj/SHPd9p262wslyk1hPjSVVu73nyDafO1f447fZvNlxqg2bfk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5150 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: kopLNvCAKjQ6N8_fZDrDTxbUQNOjYiT3 X-Proofpoint-ORIG-GUID: kopLNvCAKjQ6N8_fZDrDTxbUQNOjYiT3 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 Reviewed-by: Martin Wilck Reviewed-by: Bart Van Assche --- 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 Sun Oct 23 03:03: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: 618718 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 104C6C433FE for ; Sun, 23 Oct 2022 03:07:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230048AbiJWDHQ (ORCPT ); Sat, 22 Oct 2022 23:07:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230026AbiJWDGx (ORCPT ); Sat, 22 Oct 2022 23:06:53 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 109D26C11B for ; Sat, 22 Oct 2022 20:06:45 -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 29N2sexs010909; Sun, 23 Oct 2022 03:04:38 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=5YKQhcrOjULZ+YqVj101gi0gVn3r2YkP4ZGxV+G4wi8=; b=VSeTA82zZG/QSuaRAcVK/UVyKz+ybaB5zncrTeBMNTjomvIAHNrgzGP4WliU0qgNUOxp u/OwuTEd8nJFTHAY7EOBrbAy7Up/QvY/XtmmRsrCpmilN5HAkhR/hXo1rgcnyvOFG6o1 0X4e1LWMYIpD01UQbxlQijudNvQI4MEphS0GadpvITQKqXSbLJnfwxZCw8At6VPMJl8T 7Xd9Jez+F8PUngVwUa1BF+McU7j78iE6dTNA0J27RlaQu3rS7hnI7Rbti9B9TGCqQrm7 5NoFKDD9zJ1YOpEXe3F/IfQ3m7p4xeYIRMHsJF5cLJURu37quBiD/CnEL6FpyOoH79ko hA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc84ss3g0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:38 +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 29MKY9rO003104; Sun, 23 Oct 2022 03:04:38 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y8rhmq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ctZbMzYS9OqefK9NvwYOKR60JphUUg97jlcZJz92GguHjYbSRsoZKoIGaVSZz7AjLPyQa0YlsNCw1Xyfa0kEj6M65xfjtXTgEGiL691Cbs0hWUfrvmCLj4aqFzBxA6LL/MNFon3/sEwmWOIOpOqPN32Yw7xdgRTwEw9MCPJEC5wuQ7X1eHwVPq4GGPgRkJhU/ghleJsZYpFBCV7ZXt1URtDLjnPt0rVFH+3tMmQJw2DmDAJQn6WtotTnWp5Jk/2vj0KPD+jkTvDyqa9a3WhFysRuruUEMRXqzugdSHYtTI2WNzzvYJIN6ZgSjJpArl5w9bluwxUJJAavZg+UkfRxCQ== 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=5YKQhcrOjULZ+YqVj101gi0gVn3r2YkP4ZGxV+G4wi8=; b=APDp8kFPfDdUHJT3F43tTMq/o+f1piLgAEyZ5cSXyuLdBQzZ+1lPkDVRe7vF79tPH5Z7DxlmIFN+GGSxhQY+1Emkdy0/hcrPKd1JrzoireflTHtvuvPvhvh4/TnWw3qt5t4GBViKDmdX3PmQPBf+1z+sR9wOhury3EC7TJzhL6GRtWJXs+cee5hg+UvCtO3NJuLVrJriOcsS07RVL5FBVe6eQhtQET0nPee82ChOY/mxVvjESRa3RutTWGAcmr4UC+LEgDXqGmuxKrwuB/uk3n/5u1Zhssf8UlvmXCShdLAsJvbQaGNFP2vGqQs2jTkXUWBEsR8IfQgbZgcvIWnvXw== 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=5YKQhcrOjULZ+YqVj101gi0gVn3r2YkP4ZGxV+G4wi8=; b=lemYPsgQeIdzLUrJTcE2nGVP2VvZ5s12umBdZwVcRZ2zXciV8xXsUwVxbjaLb7n653hJprvTuqZNr5otmknRg8dJM1c2+vbEMv1arwemBKLoVY4Nr3se0ETV+u+88hsMK441rE39zTmjLOxEk99GM0CdYUW33vWR6HCtqYavq4M= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BY5PR10MB4337.namprd10.prod.outlook.com (2603:10b6:a03:201::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:36 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04: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 v5 19/35] scsi: Remove scsi_execute functions Date: Sat, 22 Oct 2022 22:03:47 -0500 Message-Id: <20221023030403.33845-20-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR08CA0029.namprd08.prod.outlook.com (2603:10b6:610:5a::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_|BY5PR10MB4337:EE_ X-MS-Office365-Filtering-Correlation-Id: 37e218ec-d337-4ce7-0411-08dab4a350ef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8SKcuaxSZ9NdfqnUHKhYMsD4Zr072yDor7YolVnZDWgybJIiNyroc/7IzdDzRkEdthgqUhC+DrlAb19FIuoVYhWGrxTS//Y1rRnFzhjhQISKgJzbTSsIqbD3/bukKQs4+rVUn+MUrpjRdClH0M5kqus5yMbHGmu/bfOE1weZyOug5doZ8sqvi6EYNzx2d/4n2Y9nTmJPwgf0SI5I9Kp5idhpu/ZkEHpk3Pxk+1L7dw5kd0DqfPc4wsDiYhkn0kQIyIjNebO1htr8RMdTqiv/2IafGiJE9X6eJizadvZ/JDNDkLLYTvXfXvm0Ee8xThkD7d9xaRNOk2LdJvww8hGpJ99mPlfiigjB5j/gsByHwptzPa0clcQTWm8Qxs98Hiv5zvnnP4LhDnRl67fX2ySFcIMvhLJiRT+6R3Zr21KICiyH3aWIWJd369LWAGxsY7YPaon7j7mX2n339mhcwvFY4JvEtqA5cUciBX0BOdldGnyLyYl7XpvJNxMWuqtyxLMqfDXfPQ/k+AZLJe/tLNwBLHhdK/J/qpnks7luLu+ny9Abmp7FuFkF6h+O+4xnlvAO4Fkw0wNecMoU9ot3gW/aCNdX9N9X8k7vQKDuzLkDCGk9NFf22CH9B/ya7wWXHG+gnLzXIRZ2cKkj2Dxe3XeDXgjEOPufQ+z8v18QHlL17RTH0FS3wCT4duT48bbPty/VCA9H8wMFcLu42dBxFPrXsg== 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)(346002)(376002)(366004)(136003)(39850400004)(396003)(451199015)(66946007)(8676002)(316002)(478600001)(6506007)(6486002)(6666004)(4326008)(66476007)(66556008)(107886003)(8936002)(6512007)(186003)(2906002)(86362001)(1076003)(5660300002)(2616005)(26005)(41300700001)(36756003)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qfd7XwoE81xq0v4MRTZpQwNrAJwBLeYY3hA82kNzehgtkpmXTxbolqgeDzk9B6yStIC6FOMbcC75snfUNAbEyT409rVwgiL/2H4mMZG2+ND3GT1ifRJABNK4nsHfOBPwFUUwSLNoVm584iKKn3Z2DOqB3oA+ZcOWmBW+T4dhjsz+qjpXzBpzDQ5tGHxZHYtkREWHeG1POjEOX2+8RDhqtIQSbTZjGDV2rn10xtNUnAXtDZCirgUnFkbA0xcve2ZPeWgg6G2Q05aY4nh1qwfUuIJ/bTqPAOrZXMCGl7WtcVfMEY2nFczwPtouMKRSCjDPvsNvcdqZ7zQAjL53aZl8+5/pFz7tX/i4NZZpRES8N/mi4Tz6NK1rm/NTaVECeAK/0ANVFF86YlXINhKoMtl6c2lqAT2O17mL5+YQyVUHukqsrtSX/rIWKhRCbaIZyCYxb5Wd1zEz1FTrNWi9ENUWBhDllGfzwizdGpOXMz/qFh72fsSiLX/qjJUrg0+LabPKq5i3onUVSfUuDJPLQC1bIr/JnYrLqaQgnxsAjzgg1v42EdpPspczM7TpqQsfMpqMfUlxg4UOhinzITKmgQD8bSkhBXbVKoIwFyxldDigGcVMXrGYrHBaEaUKOZqUAnTQyZaZu4mEn6/pXAZr9xQ/m6mi1RgD6WyOQNDE8t+FU7cNpdu6OrRVLfaBfzmUOxIIAfcf3+6pn8w9HWnx7zhXZBZ5h37TvSFiLoIbsz1uir98mjA3qfMw4VBr7qckL8Q3iHyXBjmOeXKvHi3IQn6uhmcpe/7vTcnZ2q0RZ0leUR/SYNd2/9kQhoxsS9WoWEWqr+PbYO2YnjC0srVRC82UK2b69/LaTP1Wpb3IXaYUdI2nJ2hVNgZF4KFga9QV3IRtUXx9y6xr5a66uI3ucHKdYnpHe/JFi6Q+1YN6LrAxkVYMX8sEAoWZYIWgTU5IAMyFuOum4dgAbMMJSBqSQnAXhw+DvTPfAcfy/9iN6HT/9TcStM4NZLl/T+LTqA0vEYl9L5EjW8P3UmGU1DDko14Ug3tzHZ8gIraFqyGuUZAOqvOEO7cAfDw8B7gOSTTiQo0uvLK7P5UbhZrVDTPghi05qSbFDusM3IZfP8VqQU13veIqUcdir/ZtYgoeDTOyR64D99DZZzpsB/YQinHl4N/n7i3SM/9lOxrtOcYAu65gYc814v9Z+Ec+dIADI5dpXGJXOYeOxXaijNaidog/Zcq6fLgpy/R3ktXxatSW6sr2umxEZ4BTXzp5eYcpUqTMEuB7Lrh8QFI7J0wu9MkkHZjIVF8es1FYOexa37H04saYKOCFVhrAwjpEw61Vmpmf3X4EFZs9y9I682NJK87/q1twnmsTmo8yOxH8ElEEyduztoW5s0ewMkxw+4x66jZFg3ZqqCVHPLBdXyoVvPqJvYxCbWYQfxvvlG752nt5btV/CrNvhps4YrQrMvGI79zqi62EiGh+irLVtZoSwVfAuzcsmuAm22oHq0ydqktHRsgR0VfZRSK2aKOkVYSZLKU5my+BldYP9fMi6vyW3jqJNlxXoBIJOW29TQfcD6bx/eYKOgLRcLX+7uz5KAyyoiBFdjv3h10EUn7fGeQIemNiBFiKlw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37e218ec-d337-4ce7-0411-08dab4a350ef X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:35.8887 (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: cbcBWogp+q4HYN767n0DtLidz2oILwJZ5CPLltO2HBgm5Y/e94878JE3mlZb0S7e8iP3WbPD5AYPIs+YALUBltc38WQeq84ZS03klrVJCaU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4337 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-ORIG-GUID: YQwX1p6zPtYZ0b-j7jPUQ6-oofq_Bcd7 X-Proofpoint-GUID: YQwX1p6zPtYZ0b-j7jPUQ6-oofq_Bcd7 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The scsi_execute* functions are no longer used so remove them. Signed-off-by: Mike Christie Reviewed-by: Martin Wilck Reviewed-by: Bart Van Assche --- 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 72d1690f4ff1..c2dbb8824ef8 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -482,45 +482,6 @@ extern int __scsi_exec_req(const 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 Sun Oct 23 03:03: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: 617787 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 C85BAC433FE for ; Sun, 23 Oct 2022 03:07:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230072AbiJWDH3 (ORCPT ); Sat, 22 Oct 2022 23:07:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230012AbiJWDG4 (ORCPT ); Sat, 22 Oct 2022 23:06:56 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C672C7173A for ; Sat, 22 Oct 2022 20:06:47 -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 29N2t04Q014578; Sun, 23 Oct 2022 03:04:40 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=8X+JWQUV8Od86j1ax9yjgfmge9XaVfHHKHWpm1Ex48Y=; b=TRk22QYbudxvReRQxVcRH5bkxt/yaqHlZEfKpZn8JX+QvvSsj0lVsEvuqGH3kiJcHbeT X08/LIuuUkNevdpRIMtChHW8op7TZslEpdM5vrGXogKkLwylLX0oqp86eDa65/8PUDv3 rAhymPLGuGnv/28+83cJX7bed1g1LpuQj6gkry5IfmFyvM4vRaIY1EfWL1DX/estmsK2 q66P3goQJxVHKy1pTBitKHGAYj8wKiXT+cPFPt+K6wT3Q+ByplHTOPCrQJiB9ra+YLWt zJRHcQw2AqOZhrjQUy3g4wm5WJT4/e2v+HHyhpr7nR645erTTru1tt4ASp5Sokyk2u5K lA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc7a2s4q3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:40 +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 29MK5hQ1032154; Sun, 23 Oct 2022 03:04:39 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2168.outbound.protection.outlook.com [104.47.58.168]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y30akv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lr0JI/THSibDabqxzRPD+2G1tYMICr2eX1QOEKlt4l4zqDw4qy2KkDuDOkHRoTix9QD3g5ywhHZTkzj3K3u8XfU0ova19Pr1C71/2JnZIL5xLOla+jwcZOWdw+V7Jt/yEcn41ZqFx5LvumXOVeCtufU1VzphwdN/MuSeUrrDVeE1an4QcZdm5j333ZeYUZLRZZqAY2/qgbU9kpO4os9EoVJAFJyZEwkuowZ0rY7tI3ynYXyKTWXiGGXdJ0QLkEpDqAXf4FS2/n/MtgTiWdhS8yOqwppURbLqLbkDBsHZaaV/+RQL7J+/AOnrnYwQu8k3hhT9zStZ8OG5MappRdIj+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=8X+JWQUV8Od86j1ax9yjgfmge9XaVfHHKHWpm1Ex48Y=; b=T+KS5BJhXP7VvmCG+iZiYYgXmLqRUhuEHZDUb9KCpu5RRXsWiR9teUeHTRZKyG2hPulR7JzgSRIep5BlL2lS7V+yZ7zIpdOBHWd1R74Y/SkyfilMNYgfHvIIOnove1CTVurjuBY3JtvVoA6BDS/J3eKRmz3GTVutSr/OiWO8Q9b9VRIJB+368rw6RrDh4PcCgY6Vruk6I2ryzLHsPkm2xlD6Ef3pcTDPv3Tj/xOsJ8qP6VcyvHW1vHJtNELXWFQ6uIPt7yqGdQ2Lr5iCjpRSBtSmEmzcL4ApKqZDYRy7YL/4F7a8WjGKBaS4iM4QQkAXIpIsnlY5JCJp0Sbr22YyYw== 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=8X+JWQUV8Od86j1ax9yjgfmge9XaVfHHKHWpm1Ex48Y=; b=o0d15LdxcTs/VKynW+6TF75skB4rVoFUgNI9NwVR1D5d6aNf3YUx+z2f2d5xxqj57sNz4nMk3d6Ysxjpa0w2ulcobaayG5x++rvUmIiEUcoSjWXRA7/WNVwCjxh4A1F9wBLpxWs3SruyOM09uZ9nbb8mNCkceMyCtTwALbTmhDo= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BY5PR10MB4337.namprd10.prod.outlook.com (2603:10b6:a03:201::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:37 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04:37 +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 v5 20/35] scsi: Have scsi-ml retry scsi_probe_lun errors Date: Sat, 22 Oct 2022 22:03:48 -0500 Message-Id: <20221023030403.33845-21-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-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_|BY5PR10MB4337:EE_ X-MS-Office365-Filtering-Correlation-Id: a8d123e8-63b5-41b3-a391-08dab4a351f7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fe3Hlspk8H1l4HYuM8/xJxKHUUQ1PjcdBOaC6ilubkTAw8WXM4rhf7ImxwUt0slmEICWk4CcEI1lgAQZSdR+kSJEEbPMaX10qKCoq1CApWG0QmkWdfjTBByrbqWT4AyP35qA9ZDVg29/JIidvLRd2TwVHV9JnIA6K7iL/AX+OXQgB9QjlqNcJMnWGujmcJrOwzufzIM5ZhAbOA15SgX/U8nvrVcK9QCxxjn/hZJ2WfluE+gpuLtRtNJdXk93F/VzGtAgEH8P2DDmMuI9/Aw0w4qkHvFN7zlG74EevcfgWiJsWt1QFaeHQtA8SaHlGKVPKZHBZ4OQ5S2kUGkI8wWokkBOYfod/+ue+mx1gDDCMkqrPYs6FGyflMre4KDx3pD1pDdZUNB6mXxrv9XKBtGhBvXbYJ4yU6ITbhhJGR18JisyeuMvUI8SWydYJLabUpd4j9tZweI0XWyFaOydpob3cwdZkcs/Gcz4rBDqag7kcsuH5w70sLryl/87114BkoH/0qXgAACeYPjdK9UCM5EzOApqhDUqXqSTEq5KIyjqnsQY36zyYA4IBZY4qBxZoik69rgPD0Im2zjHacSl+neTSwZx0uvDndIDTjfGzNy1BP2LSwpGcw8drqdMPDtJGPqPjSQgxaoHH37auXOL3EexkICVLfooBhzFbOjwa01K0YWSfgfyakxCsiGk12Jf3mYjlia9C8/uFy8bxksPrBH9fg== 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)(346002)(376002)(366004)(136003)(39850400004)(396003)(451199015)(66946007)(8676002)(316002)(478600001)(6506007)(6486002)(6666004)(4326008)(66476007)(66556008)(107886003)(8936002)(6512007)(186003)(2906002)(86362001)(1076003)(5660300002)(2616005)(26005)(41300700001)(36756003)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XNZZoDwbLMlW/aXtVp0xWosjj1TSgOXyuOMsCD5uXSbD+J6U+32bBhgBQjDScxtGsC3CGjuVl7h2Qp6XVd9iqBcolt5vCXu6BwhFTrtlLd3vfX2B/Ys36xzekG2SjVsZZ8NddlevB/e1e525qAOy+2Ugr7Ean/Oal1VPZh8lb1k0LhmDH6/a7vM70FRwrhFOnbWVad/VImwZ6cxWtEa9VlHjGvoe9P53aX0WA9bH0tG12gFfxbsE9F+IYMF0y87fDgBfGp3fXIlx4BOdxLP38b3hEZmWIxgPKJ4krTgAFKmueF+rFMMCFmG5hgvyLwPo80HjKm396qtOltCKrxeeIbWk9jq0R+VCAzFbiojETZ+WpmjWCqOnxQoXKKiwPDqttBZJdzAcBJkFVLW56z8/80ccLQRrN3IDO8l8mRcOymdY+mROyZNYaCcXHgBkeC76R2yNIbkvlF6JLALVlmH1ClYhavKp6N24kLvc6YoOhDXY3CTYeYCOqODx/TbwbiJ1D1eNaCyXOAWhysZhX8YDuO73jrhY0CvgpOyGta7FzE1E4wtXPRjgVgMlvNrHJAY6DLDx9DT4BmM653RbkCtyClmm6UB3gO7WAxwph40kOlVaG5dY9l/acD1EXDmoSdiEKKNT/g67ejXncgz9Zdz40YrlWRvMGrmziBK3bzGmLuu5S4CjO+RFTsdpJGZDF86SMBDAT0hgfdMIXX5RsW/xqLzj4Mi6eNeE8pUOic7BuVcLqx1OGxuYY0s1AQAAa/H3BEGu47ZawxnmPiR4WFkrXd58bXlpARMysRHzGhQVAx0h+ty/kq/uRECevaVPxI4qhwjeKuL9uMTSBPkAP24UqoJFP/HjbtWHS5crC+InDZOgxVtwZLn7/porGWTFMlcf0PQ+JPsYpmSz8U6oF5XkgusGjWABTT+TR9rScxNw8dAO8+YZcl0qiIuoGOx4QNM2G19U2b9PlbX3vApTpgIY2L/LkXM1nGQEy3685kLTFqsoTAxrC2vIiyqQ5Zv4qC+WxCU4/E/FudWECrQbZ81yXVTkQmHrXPctPZg5GibMMO6QrltiCfAt50/hJ62Dv03Kc/SYFCcATiMOujWqNkD7T/Ij8bNJCUO51ze/OtPdRVMFiH7mAsMxUrE45InRkCy9cmYZWQeih59feYCxQvZ9CzaO/2+Tcy1TEhFTVQZzpryziiaTP8Ax53yuhimNOH03MgsCFrWZ7gQYubpF3WSFT2X2dl8Bu2nWr/IbHQ/A3ggf9xdYVA7isdIuoI/kQyveRY/RtA9eKqRGJjeNeqTlVbZg3rhdSAM6DQtXR1MxJRaOqDwmnBhluIErn4ZOX/exfZKV/Py1i8Zsc0BjceaL/gubhpkBJ4AVhkiPQjvfQ0GN8KRGDG+1xp4wf6/yRUjYOuG9z6aptodbWbj+PyHbqkvqqnWh3GWJwFPvv9ukFPDY1PwD37ZYjZYhv/Z5Ng8AQPZJISNjrlNp+n9mQshZvnNE5rXyT37DuPpYdpViyJ9ZlOHu3KLCBQeMfuIv4G/NvuE9bFmixH46qAq69SAh45K70HRs/Czg1CpHRAlQjhm7WhnE6d7RlRGZTa4Ay5hYEERA63++HhLoReO2FKC8SQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a8d123e8-63b5-41b3-a391-08dab4a351f7 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:37.5136 (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: uH3gklcDpzxqe/Qa06romhlqTikGlpc760pB/WNWAMxSIHkyohxBkPNdvFHKyN2lqKWBfFHg+7/k1E01ocggMvRKnL4/JEUpoX4qpGLAwMI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4337 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: jA_mOMY5qO7nmM00y_FYAlxHrU4jdI4z X-Proofpoint-ORIG-GUID: jA_mOMY5qO7nmM00y_FYAlxHrU4jdI4z 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 Reviewed-by: Bart Van Assche --- drivers/scsi/scsi_scan.c | 51 ++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 58edd5d641f8..ffdb043bda5f 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -653,8 +653,29 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result, unsigned char scsi_cmd[MAX_COMMAND_SIZE]; int first_inquiry_len, try_inquiry_len, next_inquiry_len; int response_len = 0; - int pass, count, result; - struct scsi_sense_hdr sshdr; + int pass, count, result, i; + /* + * 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; @@ -671,6 +692,11 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result, pass, try_inquiry_len)); /* Each pass gets up to three chances to ignore Unit Attention */ + for (i = 0; i < ARRAY_SIZE(failures); i++) { + if (failures[i].sense == UNIT_ATTENTION) + failures[i].retries = 0; + } + for (count = 0; count < 3; ++count) { int resid; @@ -686,32 +712,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 Sun Oct 23 03:03: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: 618717 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 6B3B9C04A95 for ; Sun, 23 Oct 2022 03:07:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230035AbiJWDHV (ORCPT ); Sat, 22 Oct 2022 23:07:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230033AbiJWDG4 (ORCPT ); Sat, 22 Oct 2022 23:06:56 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54F657287C for ; Sat, 22 Oct 2022 20:06:48 -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 29MKvmjt027181; Sun, 23 Oct 2022 03:04: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=mCQ80TsAuy0hmG6ldOJJBi+B0gPmmjwea4QMlokaAIg=; b=Qd56hbjp1Q1Xp3eA9Qij31FU6MEf9AODMJW+Ed1kb17wP6rV+z2N98l6NWy+/ksPbO0w 1kJKbBxjc5eGss9Qal4dmydqTZqC80IgwADDrXoTNOHcUK8T5F3h2Y26RCtq+9qIXKpA 9zqJZPxTf+fzT3y3QoQH7/fE8MsjMHE1yKbszRrPJHaywWxeM2qac9+DHj4LTPWzynGV 03HLx+KuSRHEKYi8eZDOfzVox+5t0nQY4zwaZ8AKq1g/bGqLVGlzfZiHPWnj24wM7xhK Cr0kTbd/s3x6KQu0FMjG/0bdyaegUrBuTdR9AiGYi+H7UcdGb3zxxFQTDUlK4RptV2tP CQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc741h86j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:40 +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 29MK5hQ2032154; Sun, 23 Oct 2022 03:04:40 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2168.outbound.protection.outlook.com [104.47.58.168]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y30akv-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mOliF7Dzlll0kRQZw4/9Ziy/mV+dwldA8q4AbyqfmMBSk6hLhKabb0GvZtND8u6wgX+8vX5fMWloD3S5bSfzUD7LcO1IdaL/FfHRVj19sUP224eXhSVCgNEF/K+fB0Ow4QF/BCXAStvfrKIkfNIw5mez4QlxVr0YJibmKSMlRdpGAMkaKsoHBziMX0O2TNcbiTa9qUU57a5htbtTo6Vv1yEvYOcMoBrug5G+iOKhyeknvyxCdnBH3OrfQ5txHXHWE9DEuIjAmqzYZfkgKjYHJYl6DICPHrXAsEji911GEd+TKZhTDf7txjixtfaQEHbDe4rJONEGf4iItPn+sm5PMQ== 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=mCQ80TsAuy0hmG6ldOJJBi+B0gPmmjwea4QMlokaAIg=; b=XqFo8izZ1etQpPBK0cv5E5xs1tEH0X9v48I8dv9lSE09WgX2cHestRxadmTu+4E9JvutHZi2rSJjZlpkluHj9Ofx++pMEDg/UmGYgOXS677tvkqq+yyCwoAkRdGsXYKDvxlaqMsfU3SIzk5RxHwCIn4e6g6KJpGiLUQZLkVxe5oRYLEOO8MZnZq7Lrlp1Ff35hVAAqFWX5ScJSxwHNRK6fSsw36o/NKL1MOGirXwpWh/XNscqhHsWdwAu8rMs4F/RHWl9O8xyX6jgfQj9PwHf8nT5Z8M5dd0Qs7p/VNOP1H2XiYlFVcSlBQsj+T/Q+0SHMbiEwGBi0uRQ8FCLmOSCQ== 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=mCQ80TsAuy0hmG6ldOJJBi+B0gPmmjwea4QMlokaAIg=; b=AWsp35CH3iiMahL8EQTfOLtgeH9z3W9y8DmYoEdAU3/r2NeCBqt20AunETca7vWRWQ9DxXWE4i8GexjocxxWBpQ9ZKolam3DRHGQYuSNnnH7/JcdWQEMz/pYx1PJVwhzbrk9GI+y78G38obQCkbAVyJOTzQwno8d6M/iumUE6Lg= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BY5PR10MB4337.namprd10.prod.outlook.com (2603:10b6:a03:201::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:39 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04: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 v5 21/35] scsi: retry INQUIRY after timeout Date: Sat, 22 Oct 2022 22:03:49 -0500 Message-Id: <20221023030403.33845-22-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR08CA0009.namprd08.prod.outlook.com (2603:10b6:610:5a::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_|BY5PR10MB4337:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b813f3e-2143-4e83-473f-08dab4a352c2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ElLRRPHPBz5MNUI1knjYsaw6rvFW0AvlnmylrDKM2mYk2Q2R7B1Pgs3nKYwhmFsWc/WVT2SB9kjABNOHHJrPohbp270FRmiMsPjuuwfAtuuOBLY99Xw7nZtTiDIfKEn9pS21zLA3Jb2Soh7OgIBffJLPAh/wwYfaWyCSRPfFwibdQqi+IIrxfFdK5nS8XVCFPwT2C74TwNHqswjzijJifTwQ/O0dOjEe/TxKLQPkdzrTWwfYFhGISrkRwM9dOHPT+Lj7GSiHyJTJJgo7TV70WNtemzPbApmv+zKkJCrOnPNUg+Bv8Faka3FZA39Y5LJexwdbboGIce7J2550PZItLiNgDCGbk0OreQ2A8WnOxzIjOSLWMG4JPPxzlvkVYYgjPfY52PwiFLbvMmilQ5LJvDxQlU6YCn6u1jyPK0xswNHOvGs8HlknVc9q9yLPM4ZNt9tsAa27Ch7Z1wDks+YecOiTvebhiRB/8MUCGQCt8MS7xZWpN2QPWgj/pAftc4NAkG9/sZaIYQa236srO2JDqdIq0krXDl3GE/QccpZSXS/jp1NYCEuaHu40F63Gu7y8twN3u+2Iy0rnWlmxlry4EtWmFJzmQ1JR350et2GIG9UE7sZnLJ2V1cXrAEfL6gj3ngvZTylpO1MSVB1yb8TGE7aCjXyUBjGrxKR2KQU0W8xQ2Deahvwo8gwRbZzT7IXH2lQIWV/igJsLc3JB2S3d5A== 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)(346002)(376002)(366004)(136003)(39850400004)(396003)(451199015)(66946007)(8676002)(316002)(478600001)(6506007)(6486002)(6666004)(4326008)(66476007)(66556008)(107886003)(8936002)(6512007)(186003)(2906002)(86362001)(1076003)(5660300002)(4744005)(2616005)(26005)(41300700001)(36756003)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iuP0KNgJHCGu9H+ewq6z89vT9nvc98bQ5Un4u55epL1netARkRDBuww4zyUNlSVY4ZIO3LmQRUhMG9lq+qfFOuiZIpEgC7N52a2/3V1zbuNs+wfyYWMExX+4X6Zccs2GbCdORPzFapoZu6D+Qg462F3ULceQvDpynHu8nU0tV9vjfC/QSCMfuL729SMEG48moZgrAK7I8L7saOjEQv3wlRFKI92lVh3kPz+B+lk3x0mhgJTYZPXVh8EZydo9qjwjbljUUC4aAnk8/0Z17h7nqLyBf6BoBR2b7RBB1pJQeRxhoIpkZSw7Ej9MMpEr1Fo9MuUrCCFaqh7geTWxCKVGjGDPNE8k8th216/djPboi6NwpAPH1v3sIZUUwPclj7WUllZ6ZbY98/9lo2URYdCubhaZAa6CLdTzheULd/12BfxXL1LJkDPzJrkszOQzLxlmjAUVA/7oxXQxWijiIgm1O47i1spQjy7AHLsPOnWEhb/On5mHAxKGQaLx/UvCMttj4X0+FiWmsxpx/GY2Cto5ORnpbeJUOF95ia7LxmFZ3kjXpc35PeA8rbRfGVJ0nJrgMIAOVLYScPif9eQv/mynbipRjYjJ5jLyC4Rj6cIEEMhy/4mb5n/2wQcdm4+HaszSVO1yCXH6K04E3SvkiC+Qw9sDwG9wwGwRpmlffHxrrnF/m3tTBgF+O8CGnjRr3CQwd+fkIcNAwZd4awRT/tcWZs2Eget7ww+VNXiNkkMwe26LhBoIXYJfjoZB+H0hDArIG2WsjWMCZQzw1bjYjmnYijLe57fnK2xK8lQ4SYmEr5JGvtc+N0wAHcO02Ub65i1Nkkwv/F18g3xpHFs0qSXFrLD/VwjKQljH7JFRLdaKU6CZIMd92f2U8zB7LQGMyrUSW+tK2qNPWJu2M64ZBjqGnjyCpbqdes1HFQoDx5YP2eLQh9yLoA+l0SZE9/3+PMvnxad5I1bYGRcF/C9IX1aQ3hW1rCrhvawa8Cqwvq9++Ybn0JEK6Rivh75gwEpDXPWOL1hhN5QDyVHQSksPlWI1NLBO82VRuXUWctcM9fnnbnqx6iHe7ACft3BjC6FQxn2VZQu+eWnndSK9/J5vO9YL7oj+04vzlm6qWbC9lIf4gVNAsSAi70mjNUSqR79I96vuQ2Z+XTlAM/DEnV9xSSc2MSwKYXEXv6tmLpUO7SzzRssfbgkGqg+JgQ34zQ6hNwjMKGlrpwHEOaVueQaGTlm3zeTUt1H8iHcoVXXj19LKTxp/LWN2tv9CRztXqDoNTm/sTdDueUnXd2llM3qaJkr8UFsyu9MncH8Vsuvx/nziHOlscH0QppmoHGBLRZm064dqpZ1OMZmczlCEsFvYyptoBJiI6KIApoPrKStd37djfumz8TsZrA7ALhPQBBzff+5KU+0VqPpwHqs/WgvcmRd915q2rYpCf33b3QyR+EU/p+DOZ+HntmAQKdBjh2M87gjuEhqmmIt07xxwcddcOAk6KIcTQKMixHlt34u45hS6z9vpT5VfIVPDU1q9SN6pvj9N6qPjBr6rI5BGZOXSt3JV73cq11QODz2rkCV/k3fX2OVdMORUphwSmXfm8eP1TArh3yB8bQd+nEzXNB2+BuDj4g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b813f3e-2143-4e83-473f-08dab4a352c2 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:38.8729 (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: 9XfPYOBnYLtEP7JGx0Mi+NdW928hGGEJDuT1eUQhQsU8jzmWhQvQUWNJY5dVtDVDWyVew2v7dM4aH5pGShukYge61QP+RhcK8bJZZPWc2Tw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4337 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: KwRJhLxNlKdxQ17sfGFwttcY8YfMkWPN X-Proofpoint-ORIG-GUID: KwRJhLxNlKdxQ17sfGFwttcY8YfMkWPN 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 ffdb043bda5f..28d53efc192b 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 = 1, + .result = DID_TIME_OUT << 16, + }, {}, }; From patchwork Sun Oct 23 03:03: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: 618712 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 7F8BFC04A95 for ; Sun, 23 Oct 2022 03:08:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230107AbiJWDIa (ORCPT ); Sat, 22 Oct 2022 23:08:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230060AbiJWDHR (ORCPT ); Sat, 22 Oct 2022 23:07:17 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6521172EE3 for ; Sat, 22 Oct 2022 20:07:01 -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 29MCsDV2019473; Sun, 23 Oct 2022 03:04: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=X6ScgZ68v8bhnU3PlrE8DP4QpmE7KwuFmbi/7VZv2Ss=; b=1rmtMkLzZfodzzXYgdVC31uZm6pYJh9fZ1t9654NvLrJx8jB9u82niM4p7GZYUJyEKPY ijU2EN0JTGCzbU42ZJMxX1K4tErujsUPgP05r5bcNJ5cN45VkjZrNMa12wD+ftbEiver c3X3W4z2VrpGNyMTyEMeiN0moSko8m4vusZk1af+nzUdKMwzuuVKx3mfjULlGz1gXv2Z /PmSuRwibnZ92cSGkuDD9A9D6ycWbo+losV5HbORAGV9hAGvgO16SzsN5uLC4AZ4BIM6 Vmb207BgFKYOLtdU4VBKodCd0fCwtDhifFXylOxoQ+shVSP8M7sPLTHa66OmghXGngP5 4g== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc93918jb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04: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 29MJEUvb040828; Sun, 23 Oct 2022 03:04:42 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y8gs4k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lF/KU9HHBxOKu/Fpl/iGVyGQyQ3uhieWZJ/n/DQWrlUY4A67Ucv3AgCZw2ofsh0HE6/HQrBEj/DSXSb69zrNf+QtDMveRfvxJJ9vsY+hDja1vQia4Ia8DIix2T+E2U1EgEHTu3690FoCohsnWGvSaDa5rEO12j8QZRxOE52BUtJf9vM53IAHx3MEiqU9ZyO/ykloMYcm91cSwcAwklLUriFnnBkF3LXwgb6iR38vm6kLKJ0t2kqvpBQQAWMYY3HPMC8QkFf/o3x/+yMOdjlDaeUAWdf+3fjzb429GWcOBA+fkql6sQA6nrZLpOPEFWurqfEEyBlmxxuacQdTt5mOcg== 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=X6ScgZ68v8bhnU3PlrE8DP4QpmE7KwuFmbi/7VZv2Ss=; b=UPplli3x4TuecRDgUu/UbfRo5cD4sBAZW3hnsnKxi7Mzgc8PU8OOw330mODHuoQS2nRFI8jZ2y+5W4GR/DqQrMmCmpSm/cyPdl3obJEVN2wWw9Qo6QZKY0uVSUQRfGnazy9UDrvj+ALXn85mlWx8vHhetVKttI3u7ZuIeeWrFVp6F3yDM7afOSvpRrbJy7EwpTJhX9yI946yQ8pTANwcRoXXz2xRwlm3hAq1cDj+iUH2PfVC0T+ddO1wYN0TnUiECfTbPOb0YPF3iSrWn/qClYDIqpbgcHEuIb7ZVmE6f2qhgHi1oIgNLFEuMb1xLtDhmQeV8oRxm9uk3CJmgtAPJw== 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=X6ScgZ68v8bhnU3PlrE8DP4QpmE7KwuFmbi/7VZv2Ss=; b=d2MyuAmDVrMJHASsCu/W7SfEUntm+2966tX/0DcUHM1Pk8s1fhD9hVcdXStmXD20cBELTRntyDJz0dLSSFrB2t7XwfbQxixW698kraW3amZ7lqioBgYcJuqMbyQFlL079Bl2zYmgg5T54j3ML24Qp+Qf00t1+xNN39PpblCx0Ss= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BY5PR10MB4337.namprd10.prod.outlook.com (2603:10b6:a03:201::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:40 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04: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 v5 22/35] scsi: Have scsi-ml retry read_capacity_16 errors Date: Sat, 22 Oct 2022 22:03:50 -0500 Message-Id: <20221023030403.33845-23-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0429.namprd03.prod.outlook.com (2603:10b6:610:10e::13) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|BY5PR10MB4337:EE_ X-MS-Office365-Filtering-Correlation-Id: 285dc738-eb72-4f37-d22e-08dab4a353d6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +Qigzue2Fjy1xio7DjNYm8pnkqKhrES3NyDYIbNGTOF2T24KmdL23wBXfJGjPmPxTi6A5uG+6HOs6zljtJ24dbewaMc78vUS7HpWdVbQ8/pvozOYT9PFWq7jtQ8mqeov6IhdRFNiQd/Nvm+lr3o+TocLC1eKzZ/Q4JS6Alxz2E8WFtO7vjTkr+gXakTLDwmh8zJkuaqfy1eS19ee8YLzp2T8u5pBEVHReV3xGioP2BucsRV7VR6js8nRjZpHo6kj90gMHXJzLWxbWO8UqBCHziPRD32H0UVCj9xyzroDKFaF0cRT7paOOu01KBEZRMt9mhLbpiUTFjwx4QwKB+p7//XWGGxNMYCLgf/7nXRwrMYNbX/evd/Ki3Np8mFyOsR3swlMpHEwYvJQ1gm6p/etYTKTjo+Dc3VGGbYa3CEmpW+iKIzBK98D4rJhl9eWC4qaPGelWV2rHuEvcOF29kY2Uo9CvgXQcRbb5R2NAcEtR7o2+NlnifxtFq9qz+J5D1nimP0e/pTXeBtmLp8HPxIvvqd3Youa0QbNkddPRIBEWayulkDwOC/GdMxWWCwIaVwEhohC0YXvd4NJ6KXf8uZ09zuXPZ3lQMVgOb4rXb6kzDi+teltTDyfNyOj1g1sooQXIsjx/fIzeCWUQqUJYTY1YkWE1HwNw8M3Ex9I6jje2ad7xEDULdj34FhFbo1nUcAsWLMAMv+fkD+ZjwYRIWWtQg== 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)(346002)(376002)(366004)(136003)(39850400004)(396003)(451199015)(66946007)(8676002)(316002)(478600001)(6506007)(6486002)(6666004)(4326008)(66476007)(66556008)(107886003)(8936002)(6512007)(186003)(2906002)(86362001)(1076003)(5660300002)(2616005)(26005)(41300700001)(36756003)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 38ghKRjR2GjIqqdly+i3/l75dudWXGatijmBvfLLNLJ51tdMqrtHeMgTQmzMtS0bpmP+AnWGlik8hYJc5l9fXyjTPvCyPzAizY6tbc8uK6UowBEcJKwMtUVNIv7tXnnvv3iCelCZiAULELX0Q8V0KBg0x1OaP8t21aSSl3W1wxodHGCwItdCt1bA7BTKL4/uZLYQltNONTkNozLEzktdVCjgnmM+isvSdqJEKlnsxHTTsFVO7ynsn/y+ZndMcY2q8jOX0HTudBxhWj6s7FClKR28q3GpR7lNbhcgmhN6tBFpket3mfnoAW0ezEBmSzkWiK7c+VooDPQTJhJ5k3HmBXM0XqsiICuwI0GIpEbQWkhPzmmJgOhYuyLphFIF0k+3F6iLRz8O/G9KkNsE9UbNqnWJlpwU7BLrRUFuf8kc001yPB+8YSsE9d/dE8LNINERkNBws5AKDAdO+fJFdayxD/2tHxMiCRfGMzJeTbhMHGXHb1RR+X5df2eBS11LQEfZb9ZDGU4h0rs1JspuFnGbnmE+x+uYneS8AxhMcoz9P+A5BoWne1jXYyeAc2jRfyBsD147cDzlSrx9TO0Ogmue42KJTTeiFcu5+NfHtuAWUW+WH4lCH09ur0qQG7bm4Kd8LkH3y6/KtP8sA+zvzGYHI5W2Djj8uy9W4yVURJVqHnO1NF4qRihpmswef+drS4rMc2lwcT4McyTNXDeB0Xei75BCoA2k6rer79oeaMx94UfSEizKws57L9py8/kv8dXPj3N7Mo9ryCiX80vjL6tuBY0lVY1yq6l0jI5SXWRzyJnUnH6j6+5mDtc8ViUjjsR+2AMci0X1HHL5QLsGobXBLQN2PPVR+kk5vDRERMob9nAs0CuId2I3brRSx5f7Kfl36GLqehQc8PIXwtMH5eu2aPOVwgBwqNGaPrgNMJHBNX/tYp7U/9uRkVEFE9m5AzH04cIs2oqotphBdCsZuK2E6UWcFsJopO1avxwVzGBufsoO9XPlCxOwQr6FEipu8rY3NfBwd9qLKHhBUclQXwBf9qVeXqrDf0OSOcG0nXJ4zpdMDE5DMK8FiNEv9TLsO4m9uAodkcG6TbY/Ke+Au+FJ4g45xCvX3GRBdatzmOG6/gCGnQp0QJaHXofRFexA9jl9yTeENeXFC2GVAlwqhEBYWXP4pdC5z3gSu1lXl6pgoIHFPdkuZ5JcXWRLPQq3QqB2YrII4jRJQI+l9NuhtcWbAkSNVG/Cyb+lSo7G+YMABy8O/cmoHQoGZn3mwHYMCdN9ikibkQl3CgMEZNfgyoCpEeCUap+6YtaqRz2+tRpPwf4FZzpqA/ykkpo1G3F5F1lvXV6PM4KcLekrLaK6hT4qR374caFZIrXxbgDRlL/fP7Avz+iilrPNbLaOd2rPhFflvjuCqYZu9ySYY2tCIdja2cp6bGFsUUIKpZlXcB5MoUG4pksIEjfwCLmCR6mzNS2DPlMoSg0gillRGcul+A+BaxuflO9pEBK/cDhNgnmluWszkkYjyzg4jZ9WcMsdJNjhcuujTzgMvyIwXI0PvQvkLGcaL4zyDahn6PtYYJ/A6n02FgJGWx5Sh7HiFNPzohlrxlY6hd4IjOSO80+HCK22GQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 285dc738-eb72-4f37-d22e-08dab4a353d6 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:40.6540 (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: iYisKMKrdGphy38HqTHTXFtz+YmoAplRh+u5C4k/tKRgpAhTzFVJTN8WE7xfYfnZR7Vme50JBgf4rYp5ZiYl8C+BceWc9kKmWJ/U1zob8ek= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4337 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: E_VHi-wrA-8k_OHCZnYxVA1mNDmcYrkL X-Proofpoint-ORIG-GUID: E_VHi-wrA-8k_OHCZnYxVA1mNDmcYrkL 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 Reviewed-by: Martin Wilck --- drivers/scsi/sd.c | 115 +++++++++++++++++++++++++++++----------------- 1 file changed, 74 insertions(+), 41 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 37eafa968116..c94c3cdffa90 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2279,59 +2279,92 @@ static void read_capacity_error(struct scsi_disk *sdkp, struct scsi_device *sdp, static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp, unsigned char *buffer) { - unsigned char cmd[16]; + static const u8 cmd[16] = { SERVICE_ACTION_IN_16, SAI_READ_CAPACITY_16, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, RC16_LEN }; 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[] = { + /* + * Fail immediately for Invalid Command Operation Code or + * Invalid Field in CDB. + */ + { + .sense = ILLEGAL_REQUEST, + .asc = 0x20, + .ascq = 0x0, + .allowed = 0, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = ILLEGAL_REQUEST, + .asc = 0x24, + .ascq = 0x0, + .allowed = 0, + .result = SAM_STAT_CHECK_CONDITION, + }, + /* Fail immediately for Medium Not Present */ + { + .sense = UNIT_ATTENTION, + .asc = 0x3A, + .ascq = 0x0, + .allowed = 0, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = NOT_READY, + .asc = 0x3A, + .ascq = 0x0, + .allowed = 0, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = UNIT_ATTENTION, + .asc = 0x29, + .ascq = 0, + /* Device reset might occur several times */ + .allowed = READ_CAPACITY_RETRIES_ON_RESET, + .result = SAM_STAT_CHECK_CONDITION, + }, + /* Any other error not listed above retry */ + { + .result = SCMD_FAILURE_RESULT_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); - - 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 Sun Oct 23 03:03: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: 618715 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 25613C433FE for ; Sun, 23 Oct 2022 03:08:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230010AbiJWDIG (ORCPT ); Sat, 22 Oct 2022 23:08:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230016AbiJWDHH (ORCPT ); Sat, 22 Oct 2022 23:07:07 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38E62691B6 for ; Sat, 22 Oct 2022 20:07:01 -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 29MKvuVx019443; Sun, 23 Oct 2022 03:04: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=ZX0kC19HqVBQAkII4+hiPB/HcbHfedkV6Cr4nvIuXVU=; b=Y3YaGBwuqUVKrFu2oSrBvmiIBuHJHxxIrkvyce03I34Xg0pLOKmr3/otdl5EA0rCMUZI 63wJBY9T3i8XGfC1fgPNdPytgp6mHHzLwDcLp1qz0bez6Gni6BHvcQ15GAsT2HrmW7lX 2qHPeB87bImNtKkj8gsa6xVlrZvgQxJYjgS+Fdz+XeaIqtqpQKm8g8ZbI0PmL+1o6NYy 2hLchAzn5h/cshT9hnnW2loMwhSEvSQfF+pba0uIJGaQwhVDWH7Lb/ExNPBcmYihQHRx OzVoWdTCiDOYX7oQ2g75mMcHiYDTXlZqK1LcnpMtPfoO5D3/DGpWwZGBXrXGCm8iNTBA +w== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc93918jd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:45 +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 29MJXlt0015307; Sun, 23 Oct 2022 03:04:44 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2168.outbound.protection.outlook.com [104.47.58.168]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y2g7sg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vz/RxSuvHwm/hHlrVQTR4+AcHMR2d/l+aU+r/IreX5akY/LYFdUnw9pg9Xq/pTBN3IJx/ZaNXumIOTzxfCYHFydcqoTiHKWYEyKaE7hvuMbfcY/UhWwpgsqLuvAwHZfFPq7sp2YgPIqjLHAUuyaMH1hSEIIgmiuPVq8rQC4A+RML4a9NKtIWeWOBIwMflZu/Lptp81ZDTeJxLdC1Qdc9WTsrxV+Iox5QU2AQu7T0jBNsp7uetAc5zeey/h4sEgvLh7h+fFTEdiDz0ud3rx60Y5Ecr8cbz6D+1A9Eq2L74Nr1atqlBp8Mn1/Fq8pn93zTIsOM7yHVIKW4hVg4sZczkw== 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=ZX0kC19HqVBQAkII4+hiPB/HcbHfedkV6Cr4nvIuXVU=; b=LgrSZ3uyd8NpJfM2ucEPs+ph1lTPfoyvPLfFAP71gAUGAskHRKEpJSdkviZJO+VBHwt+48T6mwirir29vwV/nLjFpduJyAOuxLKKQ3p9+GQh8bVltETFO+QCIwOuM9m7fGnThHJyj9A35DWBAG67IxkdbEY1bbn/nGgBfZ/gr99nbvUt804mdQlkw94KcPqgrHxNuM3lDZGhFhnbc8hpIj+31vHm9Q5nlC7h7VkwtMwtsO9zN8EW7+1k1QgZVxx0oyRoU4JZUFUF5w2jSiBkMLLUxrd3g1Pdz9eCJx5OjqMpMALUTfIa25csRZtfdMscLe/CBVAcG9Tqv/KFeAaobA== 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=ZX0kC19HqVBQAkII4+hiPB/HcbHfedkV6Cr4nvIuXVU=; b=jdkRcBL/s+OfWsei7fo2LZ+j7KbK3L7CBIRrTYkChcxr4optfCFiNcG3/4e7wHAQ4qP3F6sQWJmeqZC/M45SPkWmivgS68fDPaqiTssEBGdBWMBQF4q8GlaRzkURUg64gXUWAjM2dzNmFplW5OI3ukPEA5yQClILlSCHTEBSjig= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BY5PR10MB4337.namprd10.prod.outlook.com (2603:10b6:a03:201::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:42 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04:42 +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 v5 23/35] scsi: Have scsi-ml retry sd_spinup_disk errors Date: Sat, 22 Oct 2022 22:03:51 -0500 Message-Id: <20221023030403.33845-24-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0350.namprd03.prod.outlook.com (2603:10b6:610:11a::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_|BY5PR10MB4337:EE_ X-MS-Office365-Filtering-Correlation-Id: 5ffd05e7-7bf9-420c-c199-08dab4a354ce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UZwQ61Qll3np1fqvGKuz/1xGBScBkj18EC6b+d3f5HOy48LFeLnmTKHuS6arHL2u28dGE8A2TTIH74IGnry9Uz7YaEf5dYQLO0IW+vbYUti2uACx4h2K0YIfwXdxA32N7iFz91EBQWNSikZ5dKpIuCWfOSsmGjdw/Ymq58kc38Eo7hFWr+1WvSnHtsBCK6AncB+TdUmb5sHpcuHICMlGDS2Yf2hveKQVNwpSrTmjI64553o7Tycbcm1zavg4r0GnQLwkRj+sBx7pwSCMJgTKzLMZrNmBKNFrmlbMmMYy3ioixn8jpCECU/Mpjctr0kS/2wcBZOeQhqKvRkipg0k3/QPXDszD5FSHb9eGfInklfLipvX781wuTOnqtXImDCHJs+HsP8LWZh25pF84SAtVoEv2XTNYTpnGkEf9Is+qirBUJFvGRbuuSYKH5Nvb78Y0OrPBIxAlOUk76bXB6eJGUpRkPtD7SA1bdHpjxr/eBN30F86bhSMq9npsAJEwjrr67mWXRqWdaIqqIudQ/PiH/8hOIWbZt23JBmiXTMSA0Fr+TMSHnC8a3PEyxJkpc3HUMHXGgGud7qKSvH7aDAvzvR2dUK8dBJF5aW0WTPxo6uJLED+fPh2QBvDP8C63jqQYhFRvbKkB9d4C1jC6Mqj5ZFMvKgLabu59iHIvzK7xlnUY9f9E5RoGMX4R4l3gtS4MIC/rIDXvxQi+JzQRlVewnQ== 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)(346002)(376002)(366004)(136003)(39850400004)(396003)(451199015)(66946007)(8676002)(316002)(478600001)(6506007)(6486002)(6666004)(4326008)(66476007)(66556008)(107886003)(8936002)(6512007)(186003)(2906002)(86362001)(1076003)(5660300002)(2616005)(26005)(41300700001)(36756003)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +GtCcP46yKSP98SH2UqGLEiIY29PStDQw4qDf5tVEocm7Ds176xYwvqXvmYCtiWSZ4++vMmhbjTyMOitDnlwVd3EeC7qLjBH5GnVdsUvOrJyuG5ckhgrgpNI2LpR9c+E78JaMg//gdy35Z137lzeSd19ilJGDITENqYCtwhd/SG2AtjS928TZ+wK88W0bAqsgdNt4m1uVpT8xViqEwvZ+HmPIRLvm2h1RM2z1vHDYYJloUZ4fd7tSVcETG7bzv3fNIBrAEcxN91xYFiq4cW37ac8f+LOfENgMpXLvoNixk+1EIbibjIuFLs461w6SbI0rUwS5MiLBxtWbx2qdfA4EcTPbm/5FYOpuVdgR4FFY5tZfTiQeoXEpBbLMd0QB6cPwwXdGoLQb4Vf4aeXYYNzTw+393gVtxJQNq7haBC3bAaYSW6vQgSQGs7x/y+XN62Uo4voFb+9BRTqwteR5862bFpnY5GAKEi1vz+TddY1y+rtN1xjYWdWAmH+JSd5bxZyHLcT20l089B5HpXMqiNFsIIFapkt/K1Co/g4P6sXtBougTVofg4X+Jed1ooOgJJMUSxo1ywaIhbK6h3aYI9T72bxaPDuW/rGq4KjgPnRqz6s4qE43amwedDdnrwERNFgQNZesqrRMtNfZdeW/2ZkbG40DZ4APs3m6xjgjls9pMygMq+uvEZlnWprp6yhe/Wzy0EUiASt/kf/kdCstmspLndjc60td897KzWsPiYAbzg14lLJwYz1jZ53Jtni0Pi8lnf0I3UMY7MQna0vG1vBrgMaaSA0xVukQYqmrWmvzdeDhp+oqLiLfsoAwf/aKuYgeHSs5T0ACK0O3QVJBPW0ny5HTdhbnd+onv6ge7deFPWcE/E6rZWeFWkGnZiJtcuWksC8+fpO34Pkdzy4lR73D1EZpSV8c+jTF8Jgu319vkqUiVi+TRn+oibYW4edjNhSWlYlKYHEPFGi3gTkeutRY1jJ82gc3frX6TdIr6r+6y/UQw/fOjxXOEQPfotiTiaTOVIYqmVLboK583t0Y0vRvFCCckHwX3qnEWL2lnN9B1jQ+TouTJrCwy8oR3M7W02qjNRyjPpBvnk+ZSSufYp4cJVGJ4bQ889lFBPyhNiYvAPJBxi4Nu/XMPA6ExZ4Iw777g12W8hFxLEZC//c2IMpKnM7NJSPoNwMBbbtyHN0gLxb0gRUPibUQt+oFoZ093tE0gCTd9I7DjdX3L6zw7VuZCV05G5UrfTSbU+504hGhQYqLS2rPgUCEPVE1ebHJGpriLechY6c9EuXnkUY6WZO23MxW9aVjl7QcF/eEO+pvvyhvYYHpkfPl0gJ4V6f4XY6dH4DypgtjHtIuZbhpzRhvfTxBV7W6zBdSZLqhia3xH+cQxL+zXHhSVYAMeHcJzIK/SFinWA+MuQfjkQB3ODxe+yliepxduFmTQ3SXGiXOWw9ZpT1iBGoikRJ+loxmM6qGengISbomhFzYMDqRLn+MRu4I5P5+10GQFMwpXm4MrqZuzALcfsbdg9LYZpE48Bi8bG5xdTbkZtuQhhltZVbqFStLUvkKgvu5CQDwTBQy1r0GgD6S8o++N/Zrdf0hM4usNRfvtGhb76c/pDXGe1RPA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ffd05e7-7bf9-420c-c199-08dab4a354ce X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:42.3101 (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: oJjckgVcQLnYfeyzAt5PmiSMEj3mLB05XIw+jX9DTYa3lrHiuJA4pbEitHd8TYuzm08xebNn5KiRQ7WzjQT0OKB6w7pGbuqLci+Tv6TKlR0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4337 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: X9DzYa4fxG-8gyXIZgy7mef2wZDdbghq X-Proofpoint-ORIG-GUID: X9DzYa4fxG-8gyXIZgy7mef2wZDdbghq 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 would happen for all check conditions. In this patch we use SCMD_FAILURE_STAT_ANY which will trigger for the same conditions as when scsi_status_is_good returns false. This will cover all CCs including UAs so there is no explicit failures arrary entry for 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 Reviewed-by: Bart Van Assche --- drivers/scsi/sd.c | 93 +++++++++++++++++++++++++++-------------------- 1 file changed, 53 insertions(+), 40 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index c94c3cdffa90..700b41c856c9 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2062,52 +2062,66 @@ static int sd_done(struct scsi_cmnd *SCpnt) static void sd_spinup_disk(struct scsi_disk *sdkp) { - unsigned char cmd[10]; + static const u8 cmd[10] = { TEST_UNIT_READY }; unsigned long spintime_expire = 0; - int retries, spintime; + int spintime; unsigned int the_result; struct scsi_sense_hdr sshdr; - int sense_valid = 0; + int sense_valid = 0, i; + struct scsi_failure failures[] = { + /* Fail immediately for Medium Not Present */ + { + .sense = UNIT_ATTENTION, + .asc = 0x3A, + .ascq = 0x0, + .allowed = 0, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = NOT_READY, + .asc = 0x3A, + .ascq = 0x0, + .allowed = 0, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .result = SCMD_FAILURE_STAT_ANY, + .allowed = 3, + }, + {}, + }; 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); + for (i = 0; i < ARRAY_SIZE(failures); i++) + failures[i].retries = 0; - 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 @@ -2138,16 +2152,15 @@ sd_spinup_disk(struct scsi_disk *sdkp) * Issue command to spin up drive when not ready */ if (!spintime) { + /* Return immediately and start spin cycle */ + const u8 start_cmd[10] = { START_STOP, 1, 0, 0, + sdkp->device->start_stop_pwr_cond ? + 0x11 : 1 }; + sd_printk(KERN_NOTICE, sdkp, "Spinning up disk..."); - cmd[0] = START_STOP; - cmd[1] = 1; /* Return immediately */ - memset((void *) &cmd[2], 0, 8); - cmd[4] = 1; /* Start spin cycle */ - if (sdkp->device->start_stop_pwr_cond) - cmd[4] |= 1 << 4; scsi_exec_req(((struct scsi_exec_args) { .sdev = sdkp->device, - .cmd = cmd, + .cmd = start_cmd, .data_dir = DMA_NONE, .sshdr = &sshdr, .timeout = SD_TIMEOUT, From patchwork Sun Oct 23 03:03: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: 617784 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 266F5C433FE for ; Sun, 23 Oct 2022 03:08:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230102AbiJWDI1 (ORCPT ); Sat, 22 Oct 2022 23:08:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230056AbiJWDHR (ORCPT ); Sat, 22 Oct 2022 23:07:17 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39D8472B7A for ; Sat, 22 Oct 2022 20:07:00 -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 29MKulHI017954; Sun, 23 Oct 2022 03:04: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=r2ky/VnpqfsVUO1jYDC5N49eG5u0Eb38mr0Ylx4JHu0=; b=gsHI2OvS+F6AClpSK/mN8ujawQzWrPrn0fklaZaW+/2NCtssJvEmIgsMETk/65zY3J1w oil555UQ8ols1Hosfw3/XEVvJGsAXzTIV0R6mrJWP1UoQ1IVUoYo5pCnKFJCH/98uk+K LDiPPjwVLf85h94i6lSs+Izlu6T/Di5lv2jqXsZ2v2VFORYM09eo2rFftBSSHKUcYpTj JDl2nSiQW834lZZtLhDE1weqQ+ZzEYVsWmBjgZS8+owkQIrgYzauo7JxO+4xtZLhSxEf 1T4YmOgLQe4A+3KwGUQDzN4vysiDEbPxw3FhPl0S0wIj58UTNu4CeXdDlL1Uuo8G6v1x Jw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc93918je-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:45 +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 29MJXlt1015307; Sun, 23 Oct 2022 03:04:45 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2168.outbound.protection.outlook.com [104.47.58.168]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y2g7sg-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jLeVfb7JDJj9R8XdlwNe0QQDUbcpCsLZqZP8O3T5i6fVDSyjKyWkG7W597O+Lw5leoefw8df5J2jIb/alsDFSsaIle66wgqmiHXGhsmWaCN2RyHRJOwVi0pFHt/s3EkFW+S+dYrr4nzD5nwpX2beq0w/BFfLVtbwSTKwiGoMa/70eWTF5jS3U1ebTiGiWVzq4jWvuUCiZ/7rclVb+bLVPqcPxaLpDj0jj1JVqzFEEH5lua1KPWiAb5X/qD+q1lYzDUeiGKg9WDjWepj6k2//IXj6ndSYUk8I0sHXUEVvI5GM8MYOQ0EXyBDPBWrYCZsqgE5AI1OpmSqrtrXu/ye0Hg== 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=r2ky/VnpqfsVUO1jYDC5N49eG5u0Eb38mr0Ylx4JHu0=; b=bGgdb/0aFMD90kI4KmwiMaNN1x1MkuL+6M1ZYTRkOdnRguPtO8NfeFFhou7bcFKdIQZOrGWnwsAj5Osr5hFYpklLQvbbzIY+hqgvA3NEiaEQVXrma19nhLqwdlZ9CieWH3uXXuJKK+HNxDa6y8EzLs0RJFO3u44ioFWDWT9Ynl2y5iozu9vrfA2GJ8fAFDKx5d7QCYtfqBs5yXySRHP2fIJN48BB4fHNP3cAtV4iB+QTPyWItMmHPuH7k/+1gBEiNOVtX+dm39qzxc6Hf3LJocaZCzR1aWGI+t/DYMocorhVw8UxmvzdTnVDAJIlP2E9X6sZI0lCMxmlZFUTS1Pv0w== 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=r2ky/VnpqfsVUO1jYDC5N49eG5u0Eb38mr0Ylx4JHu0=; b=FXoujMNKVb3qiAFXsRxj6be7y+iPuV9fo14DJq+pLU8lt+LORmO6ZhU17yRkozp02fvQexHstB6SbObCDc38M+ysxOzum0Oonac11Nd3DRTYHPDXOA2xLqsAewzajLvVa4luCzFDoZS8dtNLDKiwac2W0uR0AsAqc+21hLW6Vog= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BY5PR10MB4337.namprd10.prod.outlook.com (2603:10b6:a03:201::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:43 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04: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 v5 24/35] scsi: hp_sw: Have scsi-ml retry scsi_exec_req errors Date: Sat, 22 Oct 2022 22:03:52 -0500 Message-Id: <20221023030403.33845-25-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0358.namprd03.prod.outlook.com (2603:10b6:610:11a::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_|BY5PR10MB4337:EE_ X-MS-Office365-Filtering-Correlation-Id: 01f3740e-e42c-4898-6326-08dab4a355b8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9/47sCuQpHWmdtDhP2caedm+scL51LkL0y6jAzAGD0f/1AxtK1fuTWkqkasMeJEGnAp8+mAqXTUGsvRURubZb6Nt/YJLXevOU4E6Ps9a1N6eUhX+ZnODDFgxqLeZC4p014X4+m0kGSlZ5lPFse6WEkChCfKXNXELiGJqNP6zbq94EXTKYUDVIun6co19b+PL8QB87cfd7S47/qtRwulz5sMR7sk4lSKJl+3P0od5/zrBhY1EA7E6zSLfc+lJyD3akR5M/XdSlmYUiHndAQnEMq30zKURPFdYUZvUbbo9OpgzdZhvUywEn0Y04nd3cOnajxxFCFKaHg1KQULLDF4eD24tmM1n5Fic/wingIsuomhutQ0WrOhj4nakXcsfNgtxqeqCzmdRoMplQVGJ6rYjH+gWQBzNhc+3SkwQ8Yub8429Qk8PsF7tJgnqSBu4tk4CAAXDpBp9o3gz5keTslWAbtFNjNxGoDSyAosSeSXpwVx9luZvxxjiY/sAMTEpAANG3RryAY027b8Tg8D0tGO+9GamNrVpl+iyNUkSWiHf6/WVB6nWadEpjnuG/b3y4E85NIg3wlRGZ6UaOZ6ymiu4+AXVNvetObkdkfZykTMCPGIZzhmzD1nAiC8vLyHawh5Ij9z+eRnUaY3eEQAapQKQsWbSpNEHhSSgHXrjCurp5aXBZN8kVgXL0TFHa9Sx/J6pfKMcti0ZCqCJrOa0IdGKKQ== 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)(346002)(376002)(366004)(136003)(39850400004)(396003)(451199015)(66946007)(8676002)(316002)(478600001)(6506007)(6486002)(6666004)(4326008)(66476007)(66556008)(107886003)(8936002)(6512007)(186003)(2906002)(86362001)(1076003)(5660300002)(2616005)(26005)(41300700001)(36756003)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qRQFObZ5Zm9xzo7cvtpeniCCxns6brsODSSaCRK70OyjWpsSPYpTTEeNN4nrYFCDpHt8c+8XSBWmRhQFO+QaJxgYGY0M22qMO0SvsqWJbjYA2HIGZyfhAR5ozcTPkNE8x72TYHC4FlEaHJeKmBE4pXMJyUwQonLyIrRmJKhnG9btdChwv10XBEI1i9WN0Wi+RRDxUWkiJBV8CbC2b8iO1R+cWl6D7J9P9iD//LxFV/Fjr9TKR9MQToyCKm7Y3RVbk8JtlXzPlFuTpBRydDtVUY+CXYr4pm4SakjbTis85m3sqMtfTo2KzioIYXR4jHEjjB+q+2jlTWfYdn3W297aRQfvM65jgJ/ZRi+cfXKUluGEPt6kbf3ALRsPgoRGpeaV7TXidH2XuPspn4AByjugni5X+2orhurgfH4NvI2xGX1qfArGXXBI/LL5eZcwD9+TLFxK0NAd9AXDZowS9q97obopJN+Kct7X1+MrZ8AoyGjfnFWoUAAkFV68n5bQUON9zXPj2Xmt+bOmYJ1UD9aOZKmt/JhtUFjoqAdhauBUwIpQsfNVv5kVuVWvVP0sC24eaP6WgI+92rSfS+5Ag8brHVdtfjl37yBkrGJBKlKG0hRZz1ihFEyjq0uqukfw+lLcXFuJ0UkCS37SkxPZVqzp3RmStx4LowfQBJkLIP1BX2tiDM5BdgqRc19p2RCquvtWXt9J8MtLrD2K70W4Ea42e5jDQ2MNCRCdyHqTOhydtsYQWd3CTNBJNgafTdXVjagN8SZiRBKfrBhM8/ZBEOgXjehurh0PlMQIxaEkAXcuOuI0abSKxw3lbe/LFg2gMvW7dFsRHToofUFR/v2k7sSMwuAR5MfsQ+N638Bgew+HFoPkSHPn3VwJmA623N3a6oGWOKWojH1PpeY316wLrNh91+G4nVcUt437HAXrFJVetkvKIBVfWXnVKNxQ+PIs4TPwVIkNbW2BvNZyjg5kIe8ZsU+Vu+VGMqUXdsyjnwNNTad/5iflKB/Q3twp2I63A9UzgwFChgMh871o1NNT49E1ln/kPgEmGIry1kIEIgFENxnnYsnftpI17YiSRM/6QB22W3aOLKdh8jeZH8M9eReDuY1SdyScOVBIdf7cVcMXzqgLma6QdYkppkeBVoA2RBeEnXtwOUzTXcMDiK2TipTcfbcV0MYs9LpIwprg99+vl6yfD2m+BuapyPlxUIr+lKX+nWIk8c8dYvP7lpHeasM/nL1hslEwMnvyHQbiNYbkYzcKjFSNTMl/cDfgcjQCS1zlMWUGE+XgGWNjPbjlqRXHt+SNrW1a921msSBgurKsXFDTpmqaF/Yl/qF6sNi4Bg8VkePh5/izGnGc1oIyE258TF049PiEqR3tGJ9Y2jXhUQCDrL/Oek0bZPNDdlmFl01ef7jHJgKRFN4WOXL/0Nw8b8mUEmVuLK0TlbwhsoRrSd0n9tSoNw/EHfYu1brSPILcDDxQRbAhKfgLnjre1G1ubbw/ph7QcEfx6WftoHEGemv0QmhEz1mH227EgMhxpsPYjBUJvNk9bJysgSUb1uRWF9yilhbl8esmJocUCU5L9yk07fyaDSEBHf7jONAdyUFVRTMGWgMbT5m45NI2PHAY2g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 01f3740e-e42c-4898-6326-08dab4a355b8 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:43.8100 (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: AVwtrDP2Bzt+tAfA4CENRF8PSwUEmnSgyne4IX5YIiaHToQFnNsZaTvquJ4fhTSCrXu5Gndsl5fwKeGgpXte1CPgOCmLCWc25ydVEfA11ig= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4337 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: zuXQBv6u80upqfk107Ir5y8AIoWubTyV X-Proofpoint-ORIG-GUID: zuXQBv6u80upqfk107Ir5y8AIoWubTyV 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 Reviewed-by: Martin Wilck --- drivers/scsi/device_handler/scsi_dh_hp_sw.c | 46 +++++++++++++-------- 1 file changed, 29 insertions(+), 17 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..8c09d512a415 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,11 +131,24 @@ 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, @@ -138,7 +156,8 @@ static int hp_sw_start_stop(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)) { 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 Sun Oct 23 03:03: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: 618714 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 0C778C04A95 for ; Sun, 23 Oct 2022 03:08:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230092AbiJWDIO (ORCPT ); Sat, 22 Oct 2022 23:08:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230026AbiJWDHQ (ORCPT ); Sat, 22 Oct 2022 23:07:16 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 390CB71991 for ; Sat, 22 Oct 2022 20:07:01 -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 29MKv6q4032405; Sun, 23 Oct 2022 03:04: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=kNhnCtd/bjWJAR7WrKCvn1pKbt+hXTClC1leFeXMEzc=; b=ujJ524zPqWnu2rCEZvs2wx422T6efYpPP8qKrP5c5/hHk4gApYWfcXCc/T5Qd4cE/MEX 8RiutkP844D/HjjMwY/EnBYZVhSS0aeR7c1bC0lB5VOfuThtsWUk6Hzj50T8I5bI+Tyf TlZ5qkgfeWnGIeQOSCfmCgSF5ISD5y9WrWtTShbtld9CBEHwjnquljRfvkvdMb8bHHay c0PM7eE7lSsUCdCWs+62+kFGd2XAv0Hz15CiIXQzVPQSlZ5n55zhN8Xhs6tQDEtaKJtT cal6bMlgjpfzrMp9BAXKjpfIJ2JS4cQ+IMQqhyhcxecftz0JNJB6ScdoZN/P5gWPcxQJ KQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc8db95ng-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:48 +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 29MKK0EX002602; Sun, 23 Oct 2022 03:04:47 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y8rhp7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nAoCUhs0DwX+QudV+tLwftjdwTRSXT8DD9f62Z7bvu5NJP8JkGJQZEe2eMa0cQ0q+qE6zenlu4lSpFtOlbH/A53rmwd3Lik4Gc8KxaC6D4tlv+2fm6GaK3r53MQHo4G0qTOlZoODR9BoMmt4CiTaP7nz3YwIWYZZuu5yZX3R59QEIhNzH3nvTHsEQcvFM1AVIxFjiqorPrlvR1U4LH1ERNZ2NFncgNnBZhfZ5aFk82I5mc+GsUCwwBkRES1er3IGR5JDCSyWYoazo6hHGXYjNHVxPLk8zqzB9ZDqaitGO7sQHJuKmp3Z38DLnWhSl4sADihLylICLfruaAq6yx5HBQ== 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=kNhnCtd/bjWJAR7WrKCvn1pKbt+hXTClC1leFeXMEzc=; b=jlt4JH3l4dzfoVGRGp4aWMnfSXO1hG5WdxJqeQ94rAlqxXavhmbRwygXo0GdfLeeFPuCsAKMzGAkEsuouzMtYNx2R+SNIDdlv7QXk37FwiMk5Xl6a5ky16eTs06/iqUK2cymfxFRp7j77tlLBwd70PF3HlDYvlA+hBYU8KSrHjSO+P7iXEMuVDriFFSLHdKyInnCE1qsZ/RZNA6ozp2+bKI6wElnHT9ntiZZU7q/V4ZeSWe0KjyIZMjYOyEUugANgH8/bY5vy3+q7mJogvucdwR70u8sskJI3BOlXJ8trxHBAnl2Qx24U8ojrnBtnzwOk1QmrywnPaSJuJBM7+9JYg== 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=kNhnCtd/bjWJAR7WrKCvn1pKbt+hXTClC1leFeXMEzc=; b=yKbIfpNE8vEai+XYSBUF2qJMGofqjVy3yeDiO+YZzHcP4P9VwffmI34EL0NegUJ/GBU3L/rzY1n3HToUEQqqIE9k7MHOucPezkAEJodn5ToKpeYEFt6C1kHo69QsVGFFOKCo8M2eYcKIFjj53A6MYfLu1fr2aN+G50Gk3B/b7gE= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BY5PR10MB4337.namprd10.prod.outlook.com (2603:10b6:a03:201::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:45 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04: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 v5 25/35] scsi: rdac: Have scsi-ml retry send_mode_select errors Date: Sat, 22 Oct 2022 22:03:53 -0500 Message-Id: <20221023030403.33845-26-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0336.namprd03.prod.outlook.com (2603:10b6:610:11a::8) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|BY5PR10MB4337:EE_ X-MS-Office365-Filtering-Correlation-Id: f835d307-6f81-400d-b2cb-08dab4a356d1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5f+3UdGnFFYtp5ZaZsuymHET0g73mMv/ta9YQd02t3hZVTgUehz+OfL3AiWUtw6IvsaePhcifiS8R5Cc78cHLpVjCjN0zMAOe+Hi1epyt09CjT+XD+NG8Hsuygks5WgNTQDeVXMpov0txY074JgzVejgQMMsMAw3MFOFE8Idyi98xP7qQYV3bRI4KklEGm/XYmw9vorswcr93fVb46OvjyOGZfU7mpTui9uwraXSWLwyGsMtP7GwVgma8kO1MDJbpwz/BYt+D9ZI+xuTW96sB3yD+Arw5ih5Fw030dnIAiHoIZamcUJ/YqyhGhA78yzoWBRk/juDQ230z6mEF0ojD4j2pu+iGbgHqToSz3O68L2c2XNZ9dr+ECRmrHt6Hz/S4V8VQO/jQGw/V9klHmqYmYJrAAiLQpwGQWk4RmJLLSu3kYu/U48Xt0BENnHLJkUtNo+3LQ6GSkvFwj/D040BUlm0iFe2lLPMdVMhEoVZjJinU+27Trzqf/FL9o/D6/kyqPHA/6c15pSgZ27J9VJoYVxiybMvoczOcDVlDjXGClL5ucgUPJzH87apTG8aVMI9g7Mo3dF3qOLMbXm5erfFnrWSGTK/1cXxEC4n83NG9FO9LYpfbIqlv6snTdIZD5eJCc8VFGVsd/2Iel7rRe6UuioctGTs+OfO60EPUguabuRXhe8cmCxxN2101veq9Sd/C81DaQBGV8Ky4Hg7BIR4Ug== 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)(346002)(376002)(366004)(136003)(39850400004)(396003)(451199015)(66946007)(8676002)(316002)(478600001)(6506007)(6486002)(6666004)(4326008)(66476007)(66556008)(107886003)(8936002)(6512007)(186003)(2906002)(86362001)(1076003)(5660300002)(2616005)(26005)(41300700001)(36756003)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zA0F26ihcuxJdGET/pCB6/nieX/rgOHjdkBMDZEPE2ZxHIL/AuIndbTz1g98vcQdNwO4RQO6jG6XyWK5bcOE6V1zeoXMlzOwAdpN1hZOSmWH7eRUxt3dd8f61Esn7zZvGsNt3N+VKGPXGQwKX9OVQPyS2SW1iMz61HVI7afRDvbMvgVqsqF20OC3ippG7Sm+UmNwk1WxDZf5V1EIwNsu4c23zX5mXX3Yafc9jjzFyHyRLVpBopbijiBubDkGhYl7p/4jdiFgDACdX4NMg0V9H6mqaJ7OspPBBFpDw+z+PoDb4ma1vgnOgaZBemdbzd2pEmohj7+5ikgOQ5sUt1oH1OLD0yuxaoTkB85DLpJhOeHEazlllgpiZwGAwkJjrtSQvUEFmvhsz75Za/mKubwA/pMYZOLFnNz/TfkcmYQbKWe3Fu0GD0hjbCrC22UUnauBRc8HcxQ8JdVUtDUIGAl6gD7E3XsMR3kP3KLSSrVhkdjbawzvzKxo3Ch8Z32SEG6PK+mMzeGlQ2f4c/qIuDPC7EIZgQpFuU+j3UmJB6lN4W+LDmSgi5Kn+FavWYw5rIjHH1zaIT5y/OFRrKvwLd66CB1g1XsfQ6oKmcF6n+XmMbN7TI2ntZtUjYEjbW/OaTtODjinoj3ZH9hnNAWbRuO3glyHIbbUVhsOQciOy6bCw0hkpsYACc1g0vsFmNqYLR3GPld2UsBl/rOfOHwBqvmaW3HmCEDkb/nEJqflggs3iOsjKp5FuGXqH3b3aN70FwnWfeeHvc+QbaJXqM9uRF8l7qEjN5oSxfvCWPjwX0BWMaar0TEDzWxLJWxefBQAZDfy/hmrrFHrRsZZaAWjZ1LCgBk5gp8yuFVmo/Rx31uBCmcfbKp5LAgXml0TtB699bfxKU76IvlnORsUeORTMeoAV16xjQTNYqJPRzFZ+0akzGFsXyZET2DM5y+PqaIsCCBgWSwp3eVhM1cpsFL0FNMLF+c0pEyleGhPeG2t9JRcvmmeYT32jbQAOROituhhRcdW9OdEPL063dJV+WMjYFwo8Jfr6YdikopYSF8Vf28AS8jqkFW+MiSzxgE2RUIdpMg7uoOrEkBuEZgHm/tQNmfqiX0+lI5kK/z5/r6hxGBeQ2h44aBlIf/UiOQAsoiFWMG0J2GNvo2PgbG8aJDOKDmkgX4i/fhfvXVveg8Q10nQNa8rP9vVCg/+sAU/m2qtpvSOpLkJNhjbhoAXjtGkWjbt1o/+Y9SFpo4Z0QKA1p1V11n+6UF9f+J0LwhK1P8kygoyDVEzBK4DkuBF+UH9WWyI6ohPxwby1ZqS1SfUDuIxXXjClwSnEz/dCUjZeN5zeu0NVfbVog6hbIRrlSozdttr5cGK4tQhahSGfcMjFxHwOWHs4M3NGfTC/oEo89ZDUWCXyJKIFu6aG9AyPY13bg435UX6uJ46peNHmo40SeaCXvCI1+irjf5KnbgIB+T62p9s/TlA5hzIDiQQWwCDT/Kum5Jw40sq8mrhuVf2GFiMRFUYBgkcphD6kN1EOVwXWe8pE2djdL7yEbr9DS8Y1SWA9CgAqLOGuRdKmqsW11kEik6Zb26Jp4JhaWffeWf6E72C2kPnOKBkSL1ScOpS9/aIOw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f835d307-6f81-400d-b2cb-08dab4a356d1 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:45.6692 (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: /Fi9JqllLOteRbOvg8deNH/OdgdhXDMWtj748VrDPUcLLtt2T0fbpZf0wI1wk8YhYKmXrvAuz0MRrpF+zjJHsMyk/dPbEgvUyrsOSSJFqbE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4337 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-ORIG-GUID: _B7pmvizdE8ty9QYUABAci0brkx7x9U7 X-Proofpoint-GUID: _B7pmvizdE8ty9QYUABAci0brkx7x9U7 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 Reviewed-by: Martin Wilck --- 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..953fad6ddd66 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[] = { + { + .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, + }, + { + /* Command Lock contention */ + .sense = ILLEGAL_REQUEST, + .asc = 0x91, + .ascq = 0x36, + .allowed = SCMD_FAILURE_NO_LIMIT, + .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 Sun Oct 23 03:03: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: 618713 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 AE942C04A95 for ; Sun, 23 Oct 2022 03:08:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230101AbiJWDIY (ORCPT ); Sat, 22 Oct 2022 23:08:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230055AbiJWDHR (ORCPT ); Sat, 22 Oct 2022 23:07:17 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 449B172ED7 for ; Sat, 22 Oct 2022 20:07: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 29MKv6q5032405; Sun, 23 Oct 2022 03:04:50 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=06H2zVYeAsVKMHrknavrlAA1PQzNf3cQ9LEgbZtA/uA=; b=gzpRGqeAfJzaN7yZA/JtdgHaRjhSmSjj5bGQUBtjzPZRqkVLMjAa2/3CIYN1/0dTsgof 9SL61Z8QbvltpbIUR2MDfQOto/isE4TveTe7vwZEJBMBb5Y2PsG96qS+lKrt7o9QdJH5 bV2V9Nb7ZCJ1Rcin0cTpeU7+Ls0TMHgSATMXWDfjZNlU5RJydsuEkmNDPlk11n21NGvj lqnMw/7txx14Q+DontWtoqia9jEUvRYZedVs9VLSAJ0N+38rZiXn4TgaC0J8yFfaWFNs /Q8D3YXGXYTj19BqGsSUDvTUPYIKZj8wes76wp3EtFhY9f5CXotIJwSf+I0pi0CE6gQ5 4g== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc8db95nh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:50 +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 29MJfDZX030736; Sun, 23 Oct 2022 03:04:50 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y2s02t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CjidhvB+EW83+ELz4j5kLDEuEbCfwsEUuZLOAn91Aj0xZ1qykQp3ZLOD3hlg9upvzO+qiq4FCpx3bwNUPND3VwC5DMaurerVCduBd4Cnu7a6TQPfsl13N34nu4sLeeJvERwmMWZeJGQYKRkvBfXQ6hjy1TefwkxkGvIfQQgFg8Ddn/uXi3meAYDYYeMBzh5AIp1faMChmSss8q+9Hi1CdAbFGLBzKf7Vx1gVWHVCDZ6IBykpm45ZQ4buUVsELQEiD8zoBFGr7YDuRkGT3Q+GflCNpTKfVZ9wBaG5oGopynEiqh5OTTTggyIUqrHWwpAxmvz1riIF7w7dz8i4n+35MA== 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=06H2zVYeAsVKMHrknavrlAA1PQzNf3cQ9LEgbZtA/uA=; b=IYz5RAJDKwTB8l25mkRrbAHlNS/bLYm2ddjfhPllT8xqt/trS7qlcIHAkqrBuALn9MU/qm9b/dXlsXr0HwMG3Ok7Z16lxyZ1HZS0QVj/8/hU5uCWUTkRxY0rgRrdXPcuj/mklawyFD+tDdtaqCvyhoCY4OT7hEkIx0hTzlosjYQvu4y7HsKr8lShd/TKgxcL5dg0rayRL0/BZeYzg943dGrcKBsemaFPzBRK3zCqMxALunHpiWjYnyWo4OjV+KpGiEdfa3n8qlgbel6pgZZwaX8sF31X3hnYyVMq3hlCxeqKLF635Jq8XBF03bR8L17IayGG9wO+LCD9D065IWTf3w== 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=06H2zVYeAsVKMHrknavrlAA1PQzNf3cQ9LEgbZtA/uA=; b=0OXcAEH1nBELdrh6nr12dVhSlJ0v7ToiZGh7txmhuDB1LAjTZ9ahM63HPkGE2kGIk61+l9plnKdGmd+bgtz/P2i0RSzuKt1td8JwXS3K4zXSUTNFMVlYxpEhtZc6Mny7Oo8Wa6Qa0y3zshXi0Ds6oyK2W6XCSH6GuzKyUrmZekI= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BY5PR10MB4337.namprd10.prod.outlook.com (2603:10b6:a03:201::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:47 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04: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 v5 26/35] scsi: spi: Have scsi-ml retry spi_execute errors Date: Sat, 22 Oct 2022 22:03:54 -0500 Message-Id: <20221023030403.33845-27-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0332.namprd03.prod.outlook.com (2603:10b6:610:11a::9) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|BY5PR10MB4337:EE_ X-MS-Office365-Filtering-Correlation-Id: 6984c135-8da2-4c95-b6ad-08dab4a357bd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nh9mprSfivuP6emIcozs1ZyFhKzc2rELYmYSZ/vRsIcGOqwoWtQ5k2HVVEtkJO34L95uIkNXYyFcgsituUXo7zlw584/0uu9jP6QlMFiXKnxtNpufqpmLqjPjBlf0Z117E7ogJV1/ju/o4r9C0WgoY+YjAAhlSfY71t5PA4d8I5I1TcKYxe+qTI9axqyog90GZtwRBsp2XSR1K7yxbbxZgigYQCjLwcJV1u8URQYF5pdRLYpGV7XQwe5NIUOlUiCnweObKokIP8FZWOwlHfda2kvuEOCdty6fMtgSKbkzrH7uybLx6tf5flBWTxZ2XfxwGGHIRBEJZiMxDp1bL6rbrwvHmLmcfXQd9Q/K8AH08J5hxBGTGM/bjkhQ+K/TZ4W6yUgmm7wfxFimJqrAXPllqzQRrkIrEKA8y9kZpiQZAjoWCFLCYF8ghI4X2NWMu+W0US5vgrAkgNhdhTg8eNOxdBRWDCWzGkGJ8RF5z+JvQaUjpKqhPDvr9UlOH9tPV7hgJNOZKxLwiRRITX9hwi/4FCzHrqRJB54g2zSF/0wvn6cJr3fyc2tVbnipAyb39SRi4PvOdPESWWkwtniWTbgq7tDgWNf30JnMva2yAstFscgFFc+fARBxvdSmYtZpalfK+g4OTHkCJ7yu+Y3LcIONLGciYV5HTiePaPpu6ifM5n6uuJR0hNytAQAzY+sMnIcpqqZl6Ih2Ez8eliNyh5jrA== 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)(346002)(376002)(366004)(136003)(39850400004)(396003)(451199015)(66946007)(8676002)(316002)(478600001)(6506007)(6486002)(6666004)(4326008)(66476007)(66556008)(107886003)(8936002)(6512007)(186003)(2906002)(86362001)(1076003)(5660300002)(2616005)(26005)(41300700001)(36756003)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Q6q0q8ckRZDvUXkATxmejXmXM1VplTdQ33DJykJkYo9avmrbX2a3USY1mYji5lX1ylg1ylnyAL0XPWY6BR9CB0BZ1v8cOYekUd2/iWu+suCaUXSGuh2YGNfozQH59mSaAA32cl5U2WMCEarDSWUlKbkJCYk79X8fHSDMwuISa7jBbJtGs9uM/wtC1pugnrdaVs7L2Kux+SBJr6eaTaHjs2cA9UMljpEsktkBZU8/KrNkNoK6Jmqbji43rEf3dTxEr5et95B1XC0pcCfbdKYuUJqABUBhstLou0QWrv9WlfICdRbQGSyl9u8JO4cwS+YqEjVe0uJPuOxcKuHq9XwPJUKDad16/nqxYtYEyYEHUrVjuQmJo+hG3yIHEOPAo7brhU5JHSj2meu3VwAm0WUVu1VKRb9y6d6CRAekMjLqzuWihZxDpdKIogEoGzoaGv0nFS5jXulLAJsvgX2MDWSksk6eEJEuNmHQt9MM+Y3kheg4LUzwu8sXeMx4J0cOnZ1cdPKgYQ8LIOQsj5C1fvFpC+/NAMEtz2Hahh2GilLNiQLocf3pfdpvIzBmih8KTOHBRkP2OTM2QBpm0QIw5pKvIN22NqkosUm0TuMx+pAOR7gzpRPQ24MKCyMkf4MA06smd3LS9S+GkZ0xr3quQxSS/SzFSR7TWzlT4OYm6ukR7Ryj4QsR31tWfKRnQosX3t82bbDCIJ/joQz96NuopC1DoAXLk4B8k3pAOS/lckD/1h9JAADyJ9LDhBLN6/8Ob/qDPi8Q9lIraArAzjUa8gMMTkcYJ+h/gRxC0NZ5LjAOtU+6WLJsuPzfclxJ67Zpi3wHiDGyULqtaTDFBQCduz8INefJCiReXrcPl/8HkZpy8637TpjtXobls4rgRSJ5TsdijqfUZvFIs2YcvaB2JpJUpGyN4BhnE3uS8ConyDL8luXzI4JwQm7wVNYCRhTLclV7yIjctSxy7hybr68FbY1xCAhqnxuR/vdKs4ArpB1K3yFUmlXYBQvJVXdixQPk9lUuRJCdqsM5ItRHI5AKIcy9BKgRecSm2jq69iU9950ylB+X2RQF9wJDS/R24eHxmzTYoov7+WDuIBgj+hD+XpxGLFVIZLlIqCNRVcM3/Qd5JA2S6JNQaKUjFFnL4/cvA4Dxw8SDpMfqWrruG/uOyTE0+fQrIIop18P6s1fjm6Nc+QTQBkEfcfY4CIfNZ8RzLM6likSBnGYNSw3v08FJwOXkTtBn+d2GumxDD/ajMLZqK8qEoTtxnEUn1Pp7Qw/zV+8u+GFuaKN05ugqmZquiwhVU0d0UQH7aIdlKFhWshSRws5VysP+evU6R7iVw34e+4Jis7TWJaMcUtrGjVHV7NtHWVThp2c40fqNhaAuYWLy7o3uGm1cc7mkmqbgFhViziGqCQeKuyCfhNTk6Sln6NSiEBrLDG5l8RWfuMXfc/csGnJ8Km9Y/9Am5e8IiQ0/XFG0itONLKrWXRmOGQl99r3O9uiE1ryqBvlKJ5jwjreWT9wCAMeunvGh/HTUEZ/hrMvSku2H18B91i8TroVw2JmbadVj18M8JRWTEScA09eLzD1Iiq6W6XipCFG+bp8gZb3TGhm8poRBMrYfVRQxiE1BjA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6984c135-8da2-4c95-b6ad-08dab4a357bd X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:47.8409 (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: WYCKqaqNkP/gfYv3LiTMDkwKBD4Sh/DwXSHaFZwOhFczWloLL75io38tipAsndPG+Mc46fpa+psukr8bnBp46YpiGgNLnt/XJ49JFhUWmik= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4337 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-ORIG-GUID: OWp0NpBX1FvGSaL3Vwg-eINWVdeAL9T1 X-Proofpoint-GUID: OWp0NpBX1FvGSaL3Vwg-eINWVdeAL9T1 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 Reviewed-by: Martin Wilck --- 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 18a365c577ed..b172dd0205cc 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 Sun Oct 23 03:03: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: 617785 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 E6622C433FE for ; Sun, 23 Oct 2022 03:08:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230093AbiJWDIQ (ORCPT ); Sat, 22 Oct 2022 23:08:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230029AbiJWDHQ (ORCPT ); Sat, 22 Oct 2022 23:07:16 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39463719A7 for ; Sat, 22 Oct 2022 20:07:00 -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 29MKulHJ017954; Sun, 23 Oct 2022 03:04:52 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=yB27jQcUF2zXTtkKhvr44dhiLfcalsbsAH8HoWWRqDU=; b=VvLqJjNi1m+TMGBpnrIjk11CuHVIaWmiIOPvov2to6a0+YmaQoF+/xFOPH3GEwU34/hP jFKdqbRdxiUG9sOd+Itl6ioqxNyrpFET8jvhCgoDDRhqgsGB1wdkoiH8YNMR/tIqElGi QEs6uThVdyAFUVCH6TowoHu1j/I8xaIZLG0th6wt4WfX4qs9VpqvTSe9/muAij9Oi4B7 9Tbk9y2f63M+GRVozl75fcZaGnPg3P8rYU02EJuiPDjqKPGGDLX6PMwppREV383c+Czb A1bgYMhtzkF94EelLsmmET41nhYPzkJ5QNmNaFdFdFVGbmXFI6jp9q6m9e3PTsU6VgKN DQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc93918jh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:52 +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 29MHYQBh003674; Sun, 23 Oct 2022 03:04:51 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 3kc6y8rhpk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IBvIcvBcaFky06bHFUn/h3hqYGhY2bO0a1Z4EjPpYVAmkz5adPwH/HNtRZaxgUEGEq48XH9VRQG9Y1Q5FZln8kHlaT+/crr7Y9BXBOsUL5aCTODILp4oBW//s7iz1LJtKDI8nEZvRZR8NXM3FCu7MgE2cgSQYaqtGH1BIY2Ma7krdNrMa6ylEOAhxeeV3FgqNQhfpAsJfbIslyxnbG/Xofb6m2kBlYkNU83eOoumbQKqsrkrL70vI7WeNQbfMf46IzFL6C8dLtHcJF6P9CV25+1VnfZAUZ20XnqN+zPqDie9d9f60QTCRMlc5hCGq/QNOPWIwVA6sri5/GaRh92ENQ== 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=yB27jQcUF2zXTtkKhvr44dhiLfcalsbsAH8HoWWRqDU=; b=MD9SRuB4atW3ScT03kFJQZjh1C3dkIKbgNrUgomsJPbALTefnncIvQtI6LmRRF8Ypm2TDXfni1g0jjiCGwdk4PiXV72AG8owIsta5yNeUTmyjjb/0+UMME9+/tvLKthfr6SZ8ZK3j64pTAGuKZipVnztuwFMVyGxjwUhDHNiS2VQTuwBIUE7/P60v6yjCnBNo9OQ4o/Y2GOU7fr/DGGHrQSF8arLxo/BrPaZbA8t9cVN7ZQSnp0Pj8URhFh/OJpTjjwdfWysKEZPJN1QdRaKCdbxS3AH5TGq02HGYE68y0xwxj4no//0wE0TbNCJ3IF7Tain5O6oxuuWi+0EkbYW8Q== 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=yB27jQcUF2zXTtkKhvr44dhiLfcalsbsAH8HoWWRqDU=; b=i1htVwEWi1yLFqgTEYourQdJdWV2OWWCbdVO8iBd5OjNAhTijdDkP9kZi0CZXr+3dOS5JOUi5Z5jdgWH739U6ptlfHXO5Aaz/8WENteMkntalsBXg9OHk/P7Hwl2J6za0U+itwYG1Jph/ktY3dwzCpVVyA10z/1hzu9KowfIQRA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BY5PR10MB4337.namprd10.prod.outlook.com (2603:10b6:a03:201::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:49 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04:49 +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 v5 27/35] scsi: sd: Have scsi-ml retry sd_sync_cache errors Date: Sat, 22 Oct 2022 22:03:55 -0500 Message-Id: <20221023030403.33845-28-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR18CA0056.namprd18.prod.outlook.com (2603:10b6:610:55::36) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|BY5PR10MB4337:EE_ X-MS-Office365-Filtering-Correlation-Id: cf79bc2f-742d-409f-3b79-08dab4a3592f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sGvoJJgq8qxGnR/rwVlK6s1hho08pT172HNlfoZC9+UKhYnE0Mzbc4VOUPMffypKxF+vOKPYqKu6W06mx8khDWGsrcOjWQEffWzgvCUeiRTjbZkiYaB5OYr3tm/MBe4txpWs4F1avYEZ08ACJyn6dn6w4tmVEvqCM1O3XzXUjeBs04L67Zx8LAeaJbwhNsScOf/6fODS661MKs8Z0qmobpHBKxGcDYlX6uyIRHpk0serAewQIre8ENzFo2QZFicPTjeXUvl20+B6Jvh6r7kTC4zdX1sCHX9MYTejwYwfxK3/ns948fvKo0RWua5LpmXj1T6rV+ai7vxEETdkXjatpBAou1JqdYSviQYt+HMgUjYt7u2/NEGdBqm7tCl3k+Km2OdQdBDkFq2NCo8EP/otT4ZqOlTnEW3X8vwECHWmXrVin5NaQazZNTbnr1YpAn/qoRr2sEP79j4U+latEoEwiPosnnO0F2JMOZ4sc6iNfUZKV7Kq/9oB1AFTE7X1fEyaoC38p5uqA0noFnpl85TMhBgY48kyXMG673W7XIpKIMTs/+IrDIId0Kixrolql3p2YTlVfCKpfSKVJdRim3biLmCiaWy06PpbOeoXX4ZJkmXg8M8R0z15zUCWWAjRqzDmaRNWQsGplFecDRUHQ94YVriah08pnWYMEbiLJhAv/5KfSmDp1FCsyjsEPWV2CCyQ3OIoNmHlcJyIrXXNg4QvHg== 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)(346002)(376002)(366004)(136003)(39850400004)(396003)(451199015)(66946007)(8676002)(316002)(478600001)(6506007)(6486002)(6666004)(4326008)(66476007)(66556008)(107886003)(8936002)(6512007)(186003)(2906002)(86362001)(1076003)(5660300002)(2616005)(26005)(41300700001)(36756003)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Dua/R838WaZwdX+JVsGEo9LCvLK7F/sv8c2rETJqnsKLk3HjA6v2fqCsOLpaG+8+E2gInoGzj5oikzovwd6uXRjxh5ckqIUXvs2zzyOms8OGfi5ux4GIISRyITr3oYKelRDfutYafa9MS6K0YEgt804P1G2xsctm3jxsGN6dxUh8VslP6+ZUDyHmD32E1Qg7be7CIwj9Ww4kJPnHjD7Smv7NwkluPaoaVDFBJ2uLsvs8q9PeiwPc99Ui6FgqRh1XgQuYFwx2U2XzZlLLpdV+l7SLaSpKtMUcA+collSwUtDqhmzHkjAHrzQPuBWCcRVKRa3nFxmB9SdQDO5hZjJctI25x+CzDBJpL/Gf3FtfCkHe1iAw5vzSmJWV0W8RApT1OOv+4/KW2u2qkVloWubzXJYAw3dj8LtyhfJXEvPaJWUvvQYdW5aC6UjB0kHpyv/iRy/0WyOO4dYQkl83AGW6a8u2iqZYk5+2lW9biAJdAYxxuNJvZnUhATyUrNaeuW8d6tkVzxc/N9XTY5hvymyRqwkOxG2fvsLKKKVGLOriSfJM3Im4TQeggaQ2EaAHzMqWxpRKSHXQYl6pZ0YaTSAFjhG0vOUKxlGk/mEVdNcLVQGbzzET5d3VtwqoQ7xklReUwvOr4mVQu5L514+bNUFv+6qgAmgs9KB0+QOtlMvlxqVsOykDW+ZUjRraG7tsGMEXukyIM19s4xV0o8Sil8Vq8yHJ7kq6/VULcILRmHECFA9o/gb60Bq2zWurBT0jDQvTC79YbGbVvJCdc5CQsKJJ07YH3E6G01NNrj4t7MkhGw157ZQR+VJerAi87OIRsl6ZUacak8WgNNFonHF+fB1dIdE+PR9Ben1Rpn0VimakhX6aN+G2GOtH4WAVIw8STt7wWHS2vZVeH0Dtjc/NpbXghs223UQfI8sK1xzSMnv6OnVgdBXZ9Nra47kkP+FTjlqdSGoZRDREG1OIueZT+dWCjI9+p1WabAj5wST1SMZktLgE/kttnM7uB6vFrLqetz/Z7SCZq9pI87JHSSCia1ezrgsU743eaAhJq7R8sScGT5LkF4fKF666mHdwtNFoRxvEw804bp05Qgtow9VyKlRWliKSdHjPBGt8ssVfrxuSJxUGZl4es/pQj1i66MVF7V/4ntTnSm//nRLKhcJpnyni+Vk4SXSopXdeqC1F9d/EHmx21R7N3msDjIsr2YvG954zbonaJGE8IuiOLX8EXfEsG+oaW85tc46WyuobURR/YvCbLxV2aVICuyKhDRegAg8xflfZAL03ipgNnv8tYyOVpn8pp9k7V3fs8A/QRTNEbLjby3VkSZJDl0IBwdZGLsXaZ3njJFYe8kPdt33rIiW11MrVrDuwZ8yXe9se3G7E7gYxAxYfWQsHUYoxppmcXTImtYtCkCMA0TURGW2LiQTwo7abqNhfdZxQD1zigmpandi5JiQdIC6pfLCKqbSfnXmxLeyHGtP9Fb7YrBihMVXMXWIykqF5PVsygRrdzQdpdJ6iK4SseNlUg/f+uinXC4G+g1kETz6XAfioA2JocTdpNWS4g6zSC1IiAgEyYJhy2CJq5rclir8DzWoq+VuIedHa6GTPfg/ZZe+geJ0LTaU/FQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf79bc2f-742d-409f-3b79-08dab4a3592f X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:49.6845 (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: ZzNdK0OZpXl9An+d84i6leB/uDt9IEjoG8nORlEUtqtkUQkDZJo6NjFnH7wLCVfogbkjKhwq7gsKQ3KdCu8nNoZ2MZORJVaACB+TNj/0Vto= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4337 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: aY5L8FNMC2qt5q6CnJNB3xRenDkCuOlj X-Proofpoint-ORIG-GUID: aY5L8FNMC2qt5q6CnJNB3xRenDkCuOlj 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 Reviewed-by: Martin Wilck --- 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 700b41c856c9..424acbb812df 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_RESULT_ANY, + }, + {}, + }; + static const u8 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 Sun Oct 23 03:03: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: 617786 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 A21FBC04A95 for ; Sun, 23 Oct 2022 03:08:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230089AbiJWDIK (ORCPT ); Sat, 22 Oct 2022 23:08:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230027AbiJWDHQ (ORCPT ); Sat, 22 Oct 2022 23:07:16 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 447CD72ED3 for ; Sat, 22 Oct 2022 20:07:02 -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 29N2sTZj006519; Sun, 23 Oct 2022 03:04:53 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=5VBOIbxCmCDCbH7p7/9/NxCP7ayVegHA6gbJGxtXhXA=; b=Cga/H7kuQZNeZoAmGC5+K3WJUFKzVRf5AucG5TaZqpNW3y9ISgOqNc3Q45OylwGnlYUw s/HWugz0srO8kVQK4HLo+8FMp+aRLKyw7Ys3/XWyTjlCfUKvfQBnQoeyUWp9zR0957Z6 sK1eXwocMkjuScwMPsNXzysU+6F0DgVhuQ8+4s4wk4k1kXpivs7e8X509xVoqUKC7+pU GoOaQEpbsosPJ/fPDlTXl46F1Jio3PrVa7nVOn2x6gwvpObS7OLLJmnaG7PPH0c3F979 rN1ILxwaZUAoYs4/knZZYpymw5VqTY/9p620yiKpmRNv6srdL1Rc89+4d1RztnmG3aK4 Ag== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc6xds4vh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:53 +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 29MLCO3B003613; Sun, 23 Oct 2022 03:04:52 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 3kc6y8rhpv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kS0gCUlNDM5DSvC4Vn9GOyqByPndTF6UHBJyF32xahj7HK65mj1o1/3rHve5+NLAtz0iMg5g5GVrAZ4AjzYOAErISZQc5ZK2bjRmqXym74tc0SqxoN+G6plVKH6cRkp39Ou/ZbpGWx4KsqiadDugM6ZZg8HQphrGD42RX6fmyQtBs7b8NR1WoOr5m/d5q1T9zOYFXbFcNX2siKPDNs8y4rKJ+mHnzkadJKSrYG7nvfkG0YDlSHDYjAgOTNXBCR8wC7S3v5aJkHzymYENE1jMKOuCxQl3UQWpxOpo1SH1C2aAfUUiTElA4PmENid28o9Z0quoMAugYPZtWDyX14Akog== 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=5VBOIbxCmCDCbH7p7/9/NxCP7ayVegHA6gbJGxtXhXA=; b=QLbYmR/9s7+HTIDTHC9TyYE3JOn9VgeCaJgvrfTNAg8WXLNoArNZeHOTlpQ+nxBJ+VATYonJz95K9ILDLo9ueR1wwxxuesbQuZNz4205+sQKrmVJyMEpCty0X3NlEIYjzAAcBScc8r/sCqh/pUa1CSf0126ZjKnEm3iV3jwgt1hX5eUpApnCM5wTpxfcGroUKA4GdeNeItnUF1UZvuUE5JOtuQrBWY3u6yvyfOFCi0nJyvPss9W7515sbJnY5qAPAzOSUdHhnrlbe2aEVopX2fzq2JY4vRhAAHBDVVCe6dwIcUJ+APag98Od53Mw4IZF+3OeFEeYvFKG0scK1LyyWQ== 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=5VBOIbxCmCDCbH7p7/9/NxCP7ayVegHA6gbJGxtXhXA=; b=utc6CZsZ8IVt0L2MUvYpVPF2h+Iusfb8Gj7pM36DMRQtks6ozmcZiAtPoYBE8pVNCNikAeNGkxBMEVkIkoAybjPi/FD/oPuylY2YkuyNzGyKGHD3W9w2ndmRr0bjjbF1Gp/Ct6tigbCH6JgzNIPeu3xg8rGoebpwtOVTsDaJS4s= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BY5PR10MB4337.namprd10.prod.outlook.com (2603:10b6:a03:201::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:51 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04: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 v5 28/35] scsi: ch: Have scsi-ml retry ch_do_scsi errors Date: Sat, 22 Oct 2022 22:03:56 -0500 Message-Id: <20221023030403.33845-29-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0090.namprd03.prod.outlook.com (2603:10b6:610:cc::35) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|BY5PR10MB4337:EE_ X-MS-Office365-Filtering-Correlation-Id: 4e4f8dcf-2748-40e6-1663-08dab4a35a33 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4M1UxhLYGGs09Z1tsxodobHfKlUolXyHgbtxFBUhzh81FOlGojG/tknDJLIjbIw63ePFl3j4alFQ+HUzZXbaaoBJOVMDQaOTuW1QG8eM0W2BcFarAb5emRgaUnK0GrEyQrXy7gKc1i+Qs6zZRBRsFJD1O+6Y6Y4pxTuAodKKA2bwTpRaWIDUa35/w/QPhF5QODE3tsPL/crInVlJ5h2SSKpR149LdIC/uNMEIZQ7xo8FSp1zxSLWDzKoE4KorEHf5/C6pC0meYHOYITo7JwBWErHfH6hEc6ddJ1Jpyw0hJPH7DNRhJYwF8ORncOVqF4HawEpoXVVgHnoE9HnDlXBwkTu3iCCuF5ZWPXHtBY5JP9eYhuXeMug/FYNfyyHze5gLXD5rNebzNuXnJc/wvcckWy4nAo5dAednTs4cwgrHOigX1YS7YErjqq1MH8NJ+sPRUfh51ubamSv2HmKUlYlK8NZxwYAOvbYaybtJcWSJAjfBI2GFC4H8lvKyHRGiwHe/J/lfDfgGhVZViB/+adpIS7/LzQvegJerSSKBZUSCbvrINpSoj1f/a1owDwQH9pZlvXN3dP6dE5tx3Ox23qhq5kAmFn+7Oy1uAX3QJHcfL+wTLOWqnL2FtObapN8zdno/px5HugMEhuk593VGRC9QEkMxwb7fmbtyiVul22rQ+8326qRoIv40yQwoq6qAVIVISAI9lOQuam5TBI5TJXugg== 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)(346002)(376002)(366004)(136003)(39850400004)(396003)(451199015)(66946007)(8676002)(316002)(478600001)(6506007)(6486002)(4326008)(66476007)(66556008)(107886003)(8936002)(6512007)(186003)(2906002)(86362001)(1076003)(5660300002)(2616005)(26005)(41300700001)(36756003)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 61CtyXbKSRe5fhRI2vIyQMcZmEyIIcu+ydbnQUWHj7yDujohaBEsKWqjoXjYkUbrVltZ0+Ome9hdcD3rwI4pwksn8skooS44aqYHlUdyunm+lXz2SfFUI6RzrDRefkbmnZuJxkrF18QOVExeXpzxw01jt/Kpl5kQhpjFtNZMiR4kV0HOsRu5qVw2dqte4G1N9YqAkWapZiOFPwdvpTvnx8UiQcfDdpGuiUPnv0mgHfXoZU2pikrVDicYfbpeLAORIsXBaDBSvTSmVrXFh8XDrTiW8BthXLm8JcLV+MRbIJjPRn0mDgN8SkzGHTZCvexjL51LubyBKP1qN2u74U1aTWxTPXfxGoyyNv5Gw2E26kwIHrj708PvbWct1Fw1kPp5tcAvSnwACF7KuHZyyZh8smJiyQl3oCAe3v3MyTsiIqUt82yYe/yizwudF6bmFxMwCmVL2aAWv+EXcJ49Qtvs+NYfgNba3TKb0+WK6gJfQkZi1osxBjXfVYtWsKMjhrdOre55KEQS8RogETdKkZykY8oSIFEh0RLXJm93mtAzdHtF4LAV5QJUlGy5Sf0YF06wxWDILACiDqBkb2O80cYCI9ByCanpxZsYb5qkBxMkAxy/7HyWhLy37/RG6PMzNpDfgR+nFf34XGXawzDL3E+DQi4FkjPMJ60LGIRnA+UolX4XtgL/Ajkle2CH6bcHDz9A75tXiz4vjMnkH8X9cZnO4lKyRwiNE60tDZI4Ua5sEvTGO7dvA1JHfZRJEjjDi9beIetqlKN0eu6PJX40BZzsgyoDYtIhAmG4XbXvtlDl2vRzSSmVQDNgDmfOQ0d74q0TdFBs1uNlZI4W7BEM2CdGS1PSSdtIOFtrQdiMHvP2gNqCOWpMO8f/kcwujF+BnzNOEQuS5y4gSXmed82Hyid9Q9yz0sRfNG1Ux0LiL8uZECE5CrgpeyTx9nV2xSjeWSKUOhUgPyoxobuIMtJnZEDLJsT0YSF4qCD20+xQPLlYbH0fVcUFKLju4MOcCiS7b7vGV8jWTOcTp2ow1vYQq5xHqWsCYKqfVKYDUY2tsN9VZssBYBAc+Wt/MTrn1l/aPzboqIHnDGEJXg4eklQemsMAcLWN/fyiSAA7H4lFTG4U5oWEcVh7+mWgZkbmsHFRSIIax0PI1/G56Kxk++6bRZebR5/WXzkky/USsEPy9yQPlnkmjMgmHCYjuBAEgpodEBeaZxQTAAzYCA7mrA75dAmDQWaGgWPNK+nrEzY2uzQFpHSBuUJb+9AImUe1aF5jQZ6GWZqNkEKW3aYsm1/LB5+EJVp0jE6EaW20hiL3FD4wJuKCWw0Nso9phaOm+Csj+CaHGqXXYbKMmLuBVGCqa+PaOSDYdP0nrd/K7ABu0Zsagv5OChmWSBw+WL+CWwAN9hDBczdokipAjDyT8Gsl+ErqB4ohKNwezYEXyGQ/5NZ6eOMAiSzDwUSX2wyD3ajlYBW16Y8caKVjVcyA6jgzNKhlp/er0SVA1M3YV+eH8VN9W3G+PFL1+JUVzZd1vgulhYL4i8lJi9VsP1cs/cZ/QldmR2ViCi/ZNZjXFeCcStn/cObOSkSVJ2jTl7Kyd11YG/MGVVffuw7c/f5XIrmu5RfWyQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e4f8dcf-2748-40e6-1663-08dab4a35a33 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:51.3250 (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: +L9tX9fezMjvdhCUe80XXcXuInMjYgZmHW0T2aygbA07IgOJ91sgNQaGVtlCmVIM16qxi3AFGWc+tAtVkZ2epa+Myc47BQAAxL8aA8qujSM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4337 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: R3aZx4y3gKdhbtyJw7DWRbhkipTlym1S X-Proofpoint-ORIG-GUID: R3aZx4y3gKdhbtyJw7DWRbhkipTlym1S 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 Reviewed-by: Martin Wilck --- 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 Sun Oct 23 03:03: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: 617783 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 E9A24C433FE for ; Sun, 23 Oct 2022 03:08:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230116AbiJWDIl (ORCPT ); Sat, 22 Oct 2022 23:08:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230062AbiJWDHR (ORCPT ); Sat, 22 Oct 2022 23:07:17 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90BF768CEC for ; Sat, 22 Oct 2022 20:07:05 -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 29N2t8VM012741; Sun, 23 Oct 2022 03:04:55 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=GmOtgDWTQm+DIJCGDPaIxGqc++SvsLdQKZoRRmhKCZU=; b=o2jlOB/ToJ07Ucs1Syuz1Phooep1wHNk43t5QUKCW9r3VpMZ0ByQEQvKQvJqNxkhSo9+ /IbyEWSgHh63OG4yzIgmTjcWAqg0KkMOcNbr0ueSKp+BDmQyfO2DZSMIl3pV3Fmdkkgf J4GVkfJZQCspBo7+/HWFl7MPpJfQSFTXsVKpIbd4FkDhAENmfH5v8i/BKx3ZyHIsuL8W PFi4btvApygiT0zG8PEZi+ZUW+WW1ZlLrVp8eOxn3CyVt7rfxTDxQqb/0qlpAVSBujlV OfdXWerbz8MXbHtQqdKVShs7DOM8AZOFkAckZzbQOvE4PNNetAgwnnNO3po9C8SrvvXT 8w== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc84ss3g9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:55 +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 29MHYQBi003674; Sun, 23 Oct 2022 03:04:54 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 3kc6y8rhq1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:04:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UA+D4bxDA+o2pA+5/nIToG33l2KWG/tfluhjELMf9wuYQa3y9VcrQ50c8F8bP0fEfj9AzkekdJ/7dlni9OIQ6vbQG/goWapKrdrIuqi9ApOoJtNywADseFUv4wGEZbKgVt23Wj0Sc2CgzHIVBRDAjo45JVl8xHzwWO46B4HGKahbxtQ07W88tr5HI+8LSj+MtXzJtgOwztQ0hv5W9FYYENp+NW1TsZ/fJsaqix4bNweh6Jzcnfdu1wLgAd+iv7fVLo7LakIogNX/oPH96TvspDa9Wl6Sr9+Ea8HvNF4gW5WDKD9oXhCr3ypdsA59OCGyY8BikM+UYt6OaJz8M90X6A== 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=GmOtgDWTQm+DIJCGDPaIxGqc++SvsLdQKZoRRmhKCZU=; b=NiNQk1qnwtGuuTVlNTbtlKvxdx55vJU6TbcCXHsT00Djp0jCsQIt8oNiAVdE0EDyfK/M4TrYyQNcFq7cmuXWmGUfvAk6QjI88M00ATI2Wfy8vQaWJJWY076ftnShgoBRD/pRd8rIH7fALk2xbPL/4jsfh/XfwX2g9CUIgmyVqmiBxb2zcAsFdMGQl+FqQbEA7GKzDqDk6ytefRyrJQciFLnFpUyYFqTGr3UqwINJuNFnuuBrq70PbCTpoLnMz6OcqYZfg2J+wCw0zSU/3Kwq8ZGFJs+wavixZQmko2wZbO5Q8VzssicSxXw0WomBal4YUEmRY9iaqEwcSLuMt6wdvg== 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=GmOtgDWTQm+DIJCGDPaIxGqc++SvsLdQKZoRRmhKCZU=; b=pTBsSouoYkUgqEzZSANJN2d7OR+/yEyxvC/2fp3EkECskavqFFynMIr1wJFzah14J6QaJ9ElQa9fdKRkVEQL43BMZsh/t/5e/+mF8/00ak7iijf071+nTFMywLeXHy8TWd2LITIOKHqvQaim1ndN/AJP1fJU7qJxTfss5c+V6/s= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BY5PR10MB4337.namprd10.prod.outlook.com (2603:10b6:a03:201::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:04:53 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:04:53 +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 v5 29/35] scsi: Have scsi-ml retry scsi_mode_sense errors Date: Sat, 22 Oct 2022 22:03:57 -0500 Message-Id: <20221023030403.33845-30-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0079.namprd03.prod.outlook.com (2603:10b6:610:cc::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_|BY5PR10MB4337:EE_ X-MS-Office365-Filtering-Correlation-Id: ee471045-ca3f-4b73-dedb-08dab4a35b23 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jdx5mFiKrcED3DPwt3UPSkZrd3Svk9++N5r8gOxGODXUkJ79V9npBTLRnYn9yUAzXo5Wdyeq4GAtH/Drj8RwnUPOFPm4AIbQGgKzk6ZszB4r9bL/+p1Zxy/ie5J+reIq4NLXV4DEpxTTMs1luLqholq4QtMwbEsNVU2/q4ybCUFaWTwON+/pLAmyJW3xSB73D+lv3fFIDzjoMe1vbYhnXWzkfN/l5i1Qg+I0M+Frxm7ndNvutxNnTS5dfZeTS4QUX0xBIQOcvt1s/KxGxPUcncEnz7kvlitNCVC2c39BTiAMofFxtN65p3XwCx3kNenA/brteogCSd/AbSZ1fsg7ZoGrxbYs4CLEfphTQNzhOoNv+I6BEerqtSGPZuPn1shG733qi46UxrL7cP36MBPvHOK2LyS6sF+L1OgenSJOI8IFLmrHDqkwzLvyCIgDTDxtaGPCD2uCm/+Z4wwxScQSrGqxEvIgjINEHaRxBIGkcskJ7Jc1erxx5dwnLVadAIu3rKgeAsOODqJteNYJuOW55P8CE3T8ioOAIEZZGYtEllwrVNQYPXAhTYKWwRMbN7S7y/Wr6P11t+jlTyvj8+nyOcynuTM0SMKfjEC9D/PPaQUZDYCICc8aylFiabZY4qIoK2dBoOtvPVLoHeDmEDYt1sSPIJA0cpSt4Q8+8r5AAtMair7qtC13oRcZmU428yOQXb0ufuSi81e68V31rB/RxQ== 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)(346002)(376002)(366004)(136003)(39850400004)(396003)(451199015)(66946007)(8676002)(316002)(478600001)(6506007)(6486002)(4326008)(66476007)(66556008)(107886003)(8936002)(6512007)(186003)(2906002)(86362001)(1076003)(5660300002)(2616005)(26005)(41300700001)(36756003)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VBd9M5Nrt2KQ7oLzcOW8O/7F1dCb611U5mJ22TyP1swhPH9fEIzTFy+XU0tFrbsIZcXBY/E6eSGLXKmlZG7G2H/UkSOAQt4zqOKbBCEOWDX/FFE5pdag0WzlTNeVYEFP2kMFVMrX3RMIYaEki3WiduCcO7u0Yf8dIwqDHP4iT/xJNlFLpvF+Gt7SmR4NGlcNsLNVf1jtp798AIdRAZ36vpaRACQczxjMhdO64xIaLj3ftebu3iGUmPdE0dgTy2fBrhrUEH2URVG/lgx6iodiVZJSB3ACQTIle/m1BJ0QIfahlvL60nBKAvI0MFG6/CzJtwu76pHDQ9zAuWLwjH50g+5B5sFLX2JoWeKW0OatpzqG8pn9lylXoslMn42SusM7BFRTGrc5rbaVqrk/GDWyj0KGk8KxbISXSaTSxCQtNDPPtCY/Ug4UjNkrg/QWLX+A59wwqXDjRYTi7ogGW/vRveWC33roT8hCAUjjeyvfEezOsj94e8Px7/UAHPrzkJ2t1ad+lVYdyGe+3B3LQVp0YJhvg+RxpAH/GL/TQHwgOvhOJ1sZvCHG0Dhf2DRBvvHTtFYRnuccLRHUUMl4zXnowCwhK5FiPhXNLT1pFbRgHZzG/Bu6fJUJ/UZvLdQKL5m1EzqozDO/pA87wHE13znqYsclrErXv6+GAvSpx9CXt3f8C+uzLfaCE7uqiix07ooXQP8hzWYuyZA8/Vdho4X5qvKtCtTNcyCOMY2aBofcGOUJScackjlq3PBYkZkFRPLI8iUN2P3fI/eLoH903MCH8hXwkgUEa5kv+oeQogfKVef7S2PB0WO+KesLm67YTQJf3/qMJi3JB0Q5SKCV3GmTZis+1NaGBtS3ko/6UivfS+b9K4HgWtZ7Ddxt1VPIFxTEnpQWdfVPlDh9I6NoY0/BcvitIkGEueLt/rgnS3uRk7Q1x6844yLh2CFwPWc5vOiTFQ5zDLT5uWTSvA+UgPvg+1UnNu8s558mks11voGWndNtnnh3u49L8num4dA9ZgEW7pmXf2454ma4WT+GTHMoEURKVNGeg+oifay4AfIJFCIq6M8+sDefDtKK4sHlRk/zFCAObmsIEQ6pc53WD1JI9etCck8rj4VnnMEidGl4VY91Ar8pFvcuVtgq/prJkxrdRkMqv8jTCRytvsMBmwnbTnqmSIKhGx4GP4scCa24DHzRg3ltRfYtng+zXRQd3PEwTVTMY1VvyhK/KAuAeOblFponCxnPB/EvixozuUbRWRlGqxuQBdKiCdU+feOcLlKvgOirMH2IatR/8m5ks7oUIVwt6CO2Fi3lFucYkJV0WnhsDgi5plr69OBvXaFjD/cDDhsO3VWU7Kgbvn3BR00i6oStB9R6Ltr2UvKDqt0E/OMzZiTZneWqWVLu4YLi0XRHRcRap7/u0+ioI6rqLMu48C0swukim4ApmwQlb++3H32L07zhmGl/TKqtOaTygouet8xXn1F1jEN5EshLwuSMA+oHVjvs8xYvpjkGKqY2WvZMChGG2YEuxPtUTMUewVPYh37uI1V27DwRPtDkgT+OpSPZP2br4b2MIN3t2y2pMZ1vjAJj5uPuTXO3wBOWaweLiQ8q6Yb7XltHpKZgUMJRuQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ee471045-ca3f-4b73-dedb-08dab4a35b23 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:52.9967 (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: c32m9CWSMKAoNuAgy+xDx7zWDrD7trls4lePzlwh7cJXjIm5qET26HJSJKtI9AJ6hapr6MxaIWP+uZfgQ/u3z9o9ohh8lCcVVJzDKdawcWA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4337 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-ORIG-GUID: G41ru4roIv-4ABu9MbdXQht8vBrn4Fmb X-Proofpoint-GUID: G41ru4roIv-4ABu9MbdXQht8vBrn4Fmb 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 Reviewed-by: Martin Wilck --- 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 e9b19fa939eb..f19bc3a7ef59 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 Sun Oct 23 03:03: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: 618711 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 C822EC433FE for ; Sun, 23 Oct 2022 03:09:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230108AbiJWDJj (ORCPT ); Sat, 22 Oct 2022 23:09:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230058AbiJWDIj (ORCPT ); Sat, 22 Oct 2022 23:08:39 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32701733D2 for ; Sat, 22 Oct 2022 20:07:34 -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 29MEQLhV018071; Sun, 23 Oct 2022 03:05: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=uUBZYOqaE9VdbwFOZ94L4akeroQTWGS6NvOmHvPkkP8=; b=GBc77VrETC4qQeIpgNPaj5jq1D085uf7rY7pRCqddn/FCOR3UvSJF+0u6HOnZtMwhoet X2NTlqXseKSFm6ljQbimeA2Chh7NGPxGzaGzUKkDmA3N6KJRcVgyDqU0qYL+pQr93MDC I4iMDdE6Wfprfy7P11DJpMbm84Di0FYEtnQ0f1w0u4PeYe+hohtXL4/5v4/nK1l4xmZe hx/KpltJRsEkTLybdFuBS/tFNHVtl3lGtP9+PIz4Cx/llCsK1rjCwvhljS9nQFP22h3T cyfUHZ5JkVei8yNTp3EsWI5Wst35XX+mVRsOS26VemKXvlgvnm7ioJie6Tmkwq/2uAvp SQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc741h872-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:05:27 +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 29MJW0fZ032103; Sun, 23 Oct 2022 03:05:27 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y30aud-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:05:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dsACtTV01l2g0cziDau+MxPijmzoDbpw876ybeWQPJ9yvxgyIuJWff0fNsB8kl+4aFu/KuD7w0qO88lq4Bma8wK9CcITYuXDIG1+Bp+Ufd5jZ9JRLxH/fixyjTlyWWZ523udNujofITcdJpBBMIaQFKJIXLRuR+HORsOL8XpjfeXWpEdCJxganRzmj/JEfTI4r3wmPrZXz31CZYQTkGfB93seK/JDLZxF1g57siUd9z5sKZ93Ze3mZkXoZVzeHAHWNj1IgSTrzBnAIHjNUgD/Jd+H7M0Asg1CnHf5TXpcm8aLPNWTTiOG4mS/UJFA2E1dp0hiz3ycXXIzEjBTzbn8A== 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=uUBZYOqaE9VdbwFOZ94L4akeroQTWGS6NvOmHvPkkP8=; b=X+srNL4j097naYIBdMNNeQcEjj57rpc7L+QAVHFqji5/p6V1T7xleOkgfttv7eoSmoowfsD8/RLPCTsZdZChlp5rO6NIv1oNX9i6pkbAek36Drm9cCyxCIHvn6DTQRB39kGLFhUlUtX7aJKmS2QBAwsoLfj4poce+yD+cUVIGdLKMxalNVuHiabt/attFN5AFcJ4HYdudG05t4JLWqRewrFEAWsACwIQQ47TWOBrpLu1Vw6sHZNVXK83fYj+n1rYSq0tVW0/tb1yMix78ayavDFhj1rNHK87x9iPkGQrznlWo+IMYf12yccMuc71ae/6QgX+r3MCK+E3+MqTubTUKA== 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=uUBZYOqaE9VdbwFOZ94L4akeroQTWGS6NvOmHvPkkP8=; b=p4UCBA7WDD2gpkJBy7OJIeSMcocMAm0WEdm4CPA0AvcMk9irUdi+zjVSXAtTlV1jbXONWkQ22NyzWmh59gg6a759MwqPl1Dqkb/VhCUI7hqijIsWpoHEWRkUSHnZM/x5hbvuvMaBA8Lfts6uicEQ/LaS9F14yUtJaDkVYY5wTt8= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BY5PR10MB4337.namprd10.prod.outlook.com (2603:10b6:a03:201::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:05:24 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:05: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 v5 30/35] scsi: Have scsi-ml retry scsi_report_lun_scan errors Date: Sat, 22 Oct 2022 22:03:58 -0500 Message-Id: <20221023030403.33845-31-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0090.namprd03.prod.outlook.com (2603:10b6:610:cc::35) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|BY5PR10MB4337:EE_ X-MS-Office365-Filtering-Correlation-Id: a1ab1380-7216-4f23-806b-08dab4a35c0d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bMEML46bNcvLrYm20mYV4sm3D1HoGJebj96fnMnYzPYE1pCrZOqDZG+m60RKysjwM0sEw9K65IN5+euGKRaOP1tFrNzspDnoTPv2FfiFTW2vGgpG/jPi5qxtUEBzw7lMewM2rut7c5JlM55hDcOUR8YQq+2YRAFZZ6/Tl8Z4ZARzsV0791cS0lGFbQRTZ5RiluHzOCyJo7O/xpqIQ+U7SxZTSrmb2Vc+mndQBhXkb+aO6TE2nP+srsDarhjbODUDyzlNiziEMAeLCLKk/jwPW+VRkNytSiAkNQ1yB1zWjIYV4YV8aki007WzAdj4Mw0JT7T03qzzrUgLnMSW/nRxrnIBV92p4xkFSziqKl7JhLtkjLySOZwmTAvo8HBtC1bQWYtmsum0k4oQRv4VXqlkv4MKKcXEGT2lHktoLKvNywWxJY/pMcTL7f0k1LFWzwMb2Nv/wVw+J1W3y/YLHTqxv0ZYTCAY/ulz8D6FCZX325kJfmkQGksCzwxIREN8Ing8fQao7IvA1tX/00VedVY6KZVW5k2viRxh/91JYbNgI9JdWViyn+8Fgx6vQHk7PE78nHRwwQ+CiVruabcVNdbS3N0XYLgZfwKobPLNU/CkjqYEc5rbdLkP5OU2Q3uRvUYYb6Shy8loUCQ5He1k8aJk1wMZnVFQ6Q2Hd0WFXR+2B25JjtsMhZDorrHHk6fziFy0oJJKTxbpJxa2ITk5m0Ve8w== 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)(346002)(376002)(366004)(136003)(39850400004)(396003)(451199015)(66946007)(8676002)(316002)(478600001)(6506007)(6486002)(6666004)(4326008)(66476007)(66556008)(107886003)(8936002)(6512007)(186003)(2906002)(86362001)(1076003)(5660300002)(2616005)(26005)(41300700001)(36756003)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3NuyRyZdLnUpkm02WKcBRi0YR6Du6eLKLVw0SsZtycYKS3cXqikkq3pcQM4gG5MWlNwFmcSzEM2msdyDNXxFuaO4LdnUaewEYSnk8Ft3vek/gbNPI/vdZ2KzwPNEJEFe3fa15zbYtZmLQshZdG2GpDSQHatr3Gf+xNQMcI2TXr7vRWg54EQItyJ/++b218msErT59dW9nlp+WdOcDS1PW/UBpXvBdI89Us8h5VBlNMW8QcEu4UrYaqIJNPHxkphRElBV6OicqFu1GdEBjVOutbscV/CmtZ/g8Yu9wGIhXLxjxxclNTJCiewBrFanxlx8YJP9jQeK1xFDwQ/WQU4pxTU7/z1p3E2YUv6n7VZXCPZ76r0uTkzaH4QPUq/edzgBETfAUSLj60yfwMXl+STq4QpUKcxC5lM3iRhNy+UYRJUGmzQodgMMZFidJqNdWCzetsgPUuHaiytXx9d6jL48FQn8ItpTRKJuDAA5twsFsErOPD3WPHrmOCkDjZQ+h4syvQQ6TtAsr5BwRuvc7kvtlQun7N4qTEgpQSk3abPfLpGA8+z4QVahTs+9sssO3N1TOiAhD85bOv6LsM8Il9uNpEMjDrSCRiCzs8i/Od1f3ZdWjU6lLWF/b9OmpHhPMXUIbpOy+itlu3kRJ4uzqrCEhDm3Ea1D4qpv2LWE9rEu6cziD9cbygnFDq7nq/gNl0FwCykoQYcECBOKYfI5Cop09sTWlpTFGsfhWy6hABeQ6ol8J0ws2mxQOHWky1Nq7LmJpij28M5ptsoA1yObzBct01xlbDyA/zPlQ801Rplj3d6zTZ0orDpvWEI+kMXUl4hgmScS7XyutvvUOFpEKUaYIw4r9AA/7PCFFPtLnVqcUWLrolRme7ucq4V9P/V7C4T9xjBbtfdNIi0kdDYc5y7BGBL+F+LDXtP0LrB0Hv/T6uKzQjXEc2lc6SSFFRlc1ZnMx3ERpJGmrfgOBOfuScHTgmDXMozThfv6mKu4m9VjqHyouVCFiigDuvcJxwhKGO5C5VbDv5UbCuHXFJbuitpshtA1kTTt/US4Nyw4qImZTorX+8viiO0iyMH4IVhihJCAm+raQux1f1k4enPhuFvyLXPmQrUEpmuAn8F3XVxhW0FxDxCMZR+Vgqj4CG7qeBHA3Ns/qeSWR0aWKDbfaew3WcaQXsayPds/SJNJ4VcbVU+Oy8eM8KTKxq/VzKYpeTW/ApPdDavwi7o7zrqUD+CNywBd+Cn8K+zYJbgr8+HzTjmgYqr2R9cVmllzruWq1kU//VdRe832nbi/ZAgA/CRmwPRVmRuEnsfs7rH1vMJK4TdkVa8gffxNA2PhDFqJGawTxd3FqEDcQ33M2LMH3oXq9fCuRxlRb7CUeHbmKGTgHB4fvPYFHBHBwAln5Q5zXTddv8duPBHwRekOgkSrPy6Gby0aSWg5UHVjiuzmBaKAV1rrgWfvorCDVlAwwnXEe/F1V/FE1tseepERpe/yo3gNMnXvuPGoRxVAgLXMA5JZnEYIpjLWLP+H+RlvwIAnkPVaQIY+NBK1wYVPOZt+VWfgLr/jIshgKWBO5uEO03DjvGLyRUpUEwao9FU0heFsnG9x94ABzstv9tA4dRh6yoO1Bg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1ab1380-7216-4f23-806b-08dab4a35c0d X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:54.4497 (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: FIV13asrvTAw8CgFZmDl/tEzuoAvrg3IutAWaQC5wNorToBn/nb8wQ7SiMit8oJbbTGi9dKHiqwfTL4omnACmspvlyCGyFmQhPQE8UWOnIs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4337 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: 7-BHvOk41MFZ9-1fP-WOCbb3qpIAtR8I X-Proofpoint-ORIG-GUID: 7-BHvOk41MFZ9-1fP-WOCbb3qpIAtR8I 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 Reviewed-by: Martin Wilck --- drivers/scsi/scsi_scan.c | 68 +++++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 29 deletions(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 28d53efc192b..1da0d2687c6e 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -1425,13 +1425,32 @@ 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; + int ret = 0, i; + struct scsi_failure failures[] = { + { + .sense = UNIT_ATTENTION, + .asc = SCMD_FAILURE_ASC_ANY, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = 3, + .result = SAM_STAT_CHECK_CONDITION, + }, + /* Fail all CCs except the UA above */ + { + .sense = SCMD_FAILURE_SENSE_ANY, + .allowed = 0, + .result = SAM_STAT_CHECK_CONDITION, + }, + /* Retry any oher errors not listed above */ + { + .result = SCMD_FAILURE_RESULT_ANY, + .allowed = 3, + }, + {}, + }; /* * Only support SCSI-3 and up devices if BLIST_NOREPORTLUN is not set. @@ -1500,34 +1519,25 @@ 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)); + for (i = 0; i < ARRAY_SIZE(failures); i++) + failures[i].retries = 0; - 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 Sun Oct 23 03:03: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: 617782 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 9907EC3A59D for ; Sun, 23 Oct 2022 03:09:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230153AbiJWDJl (ORCPT ); Sat, 22 Oct 2022 23:09:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230111AbiJWDIj (ORCPT ); Sat, 22 Oct 2022 23:08:39 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34B9274364 for ; Sat, 22 Oct 2022 20:07:35 -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 29MKuvtj031538; Sun, 23 Oct 2022 03:05: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=o0iv5aU9sogEU4zAFMlzIPkB2hoejsOJcTx6+TJ7MP4=; b=PC64lEbDHvKa4P2dHhrWQkB6zfgQuCoT3dOxCnckWFBkFK352O56eN7mKMSGtkrAJCb1 m8FvpSVzhJoux+Y/RjU+PqTAmkTYlaZmAlaI8mltzaC1qb+ZRb44+VmqGUE4P05fXcZc Gyz02ZZMwPApeFFgBD85jYw2FCjMmJMEnXCZ1U1WgZ2S4EfUyKeN5ehDiYJx8d/rTxiq Q3DgRI2WbDGzhflh8BX1J6Cfj+Bf3vYSr7jHvyd4U6JBipG/cYZkP8vu7NSjwTVcujRh 9gLSSdpeD+WbAcVDSSXpew5DJzcATWCQn2Wj2Gwrdu1diwt1NDI0jJ6MXkmdkH10xzy9 0A== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc8db95ns-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:05:28 +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 29MJW0fa032103; Sun, 23 Oct 2022 03:05:27 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y30aud-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:05:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LLtB3u0rxu2oZcQaCBCKkc2PVk7PxFpPZFEzUaYCAFz4Yser2/tCrNct6F0dM/eykND3c0wPOCGKDvg8risDdqv91nHHSiLQzI7DCoiohIHOYzMRG6fz+7B5FOzksZACkiBwJC1hA46KbvybLH2+NxHB+AsyEBNU3/nyIKgpCWFTfdNkEh1ZDiUvgdIbHHOrMfBs0IFn3sK20siiRuQSx0g4GGR8jtjqnHJLJtWoq48Y4GUeZr19wzquzQtMniIrjFRHHEZBSPIcqxXKYSMtB/NpcbWGoz3+GeduwPqoPYZm0oo488nC5wTh4X9eCV1P/PkPTegua4YfknX3YRFHag== 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=o0iv5aU9sogEU4zAFMlzIPkB2hoejsOJcTx6+TJ7MP4=; b=BpT+9VqSEoeC/FEbn4+1NmBXGs7tDCcZ/HIZ++x+VEOsgh6J9OaZdzWWVDGrNsLGSKs1Jrae8nWhAqD8CTNoUtV2NTt13Wia8zcfP4qJJAUJM4GYhgbdyd/0PyPHtmdJYBjbWOTOUvQ7TcIRo7xIOuQu0wo6KYvK/IZ1Wk5u3zAnYTABkClygn0lXTnjv83KTZGzzF+63F4AlrLTbbJZz3Q/llDS81bIWlwf/z+vVH2JbGFh9TRyrGWFa9xho8g4Ed2uPG+K/9DkJC929ppVegEHaUicYnALN+N1s1c96VP73PUmCRyje6rU2LLcJXsdIhIpPHXxP+lxuOUIKABqKA== 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=o0iv5aU9sogEU4zAFMlzIPkB2hoejsOJcTx6+TJ7MP4=; b=kB42Bz38Gy5T/SIqx1c4BfSszQ1oHc/GeYhEonxBQp8Fa14GUcfmqvJtvx4ZdLAQGi9GZ/enUeJg0Sf9Sukl5UfS3IQjfERVDA6wvhrJ4L2epT4EmlxBTkjzown0SetV3qJf55NS+KvlzBi8FsA6ZEqzuvYbjGFvbqIKxz6XXys= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BY5PR10MB4337.namprd10.prod.outlook.com (2603:10b6:a03:201::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:05:25 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:05:25 +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 v5 31/35] scsi: sd: Have sd_pr_command retry UAs Date: Sat, 22 Oct 2022 22:03:59 -0500 Message-Id: <20221023030403.33845-32-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0083.namprd03.prod.outlook.com (2603:10b6:610:cc::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_|BY5PR10MB4337:EE_ X-MS-Office365-Filtering-Correlation-Id: 8e80f561-b754-4e09-ad4b-08dab4a35ce1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: owObU2zDyiLqVbOYoRJUw6bV5VvxjHH244j/YF2KonC4dcd5V+RpOzj8tRNRsNjpOFO94NCq4hZIzQIu8Vs0+wnWMD1nL/WBB+8r7FoxIgBckLMubqYjaQXjix90iHXkLmgpHQz7fYdDf2Xt1qQ3m+MIH+dkdRH2n/oeu4atXleCmlctSRJEoP/aAqA0sFJeOVKdMkOuqCuSkvj8eKMmBtneLOtnZ+t3ATUs7X+o2jWf2Q/fkFXqlDrgshR+vnCqErTTyiNhkfncD5egb9C4ulp0XNRTuN9Pv1HvCqoBQlXGXIQXLgbZeGHWOU0aXo/c84W5tmkkzVBL1GjVdjqied5JMbtVBTC+H+EeEP+hIMDT1efGxKqAfVL2yYBpOAgBK2RiRJQvBGLlo+6MF+ZwooKgYUdV2BVDtE1AVFbAv/1ox82gxk1vSiA2YB5r0Yq+4rh4XJgcgk6I2tmVbIzt9AwwdmhbuAv6ZnbSL6pv1PYxYFi7V51DgmxUL8W9fnrDy8Ov4ouU5S5BCJwtWclqhiX++OsZ+3SQIaADEe9IxLPOiDHGJo2z5hQuoFaqDN/jzsaCPzqtavRjIvr8lzSgpGn7tQTcS9cHylhppROGNfJSjJX4SfStPa5aoevZWnKqTgDFnl9+WFU3kbZltMvWBe4RrlXc0pxCUMbN+CAOjFxuQ20NGuBvZRw5ah20VIq5LOh2M4HbnoitOANqripDbw== 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)(346002)(376002)(366004)(136003)(39850400004)(396003)(451199015)(66946007)(8676002)(316002)(478600001)(6506007)(6486002)(6666004)(4326008)(66476007)(66556008)(107886003)(8936002)(6512007)(186003)(2906002)(86362001)(1076003)(5660300002)(2616005)(26005)(41300700001)(36756003)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WRk8WAHPDEmgjwYt0iKtLWVmUtJAa6wYkcf1nT4BVHDVslG1hqBApzIYJiDEzYDLkLz0kJ6+6qqC1fFTKFRoaTvIBUEWZueJi9u/MAuVnU2H/lpDMh5/irKQaizIAwd/uci4YO6dczl3Ymje6R32akbCtYBxIuPhajBw2j5TfyA9qS78EEcJeehMzT/Mrql5CH8kqf89FIG6OWpYBLpj/LGcgt8mXUSdrQWRStTCk6ZxY9OmsTNZhhgP0jZh975UUy77Z38ltxzsuWgIpCMU95eHcItFTWtVxmwwjGKIbslab0gBOiPW419DLTVTPRof1/hGjRFFGZpJ/ZGuE/H+1ZkauTu4X8ht64w8+b15pPgjwddfyp0pNZ6+QvwsWaDQQKTUpVl2rWindInpRL7Vl4/6htciEaEbqxu2kNKL+f+gNcMRJSi+9UGhqjho0IyUaYbhj6mv8nfzGrolQOGJHwiwrxTJz3Idye+d9zh6fpyOJvxew16gz6wJuZb7GRK1J4tZcOJ4kGSJX/6Ged6uxt2JUxcItQq3GqOCzBOdvwi/Lgp/YdvEuoDn8xdORQO1F/kpdYp5PdcsqwDEVY+ho4pDj1aDove8TDPNxYanDqdZ24zEk5XOSWAiQ4g81WksqMQPoW27oVTp1HJrlZXLHZLSC5F/YssThMihFlg3iJpPLynfP5BHg2sF8L+0QQvyGubLUt2ogFOG/LYQj5PZ38plJaGyaXEmS5h2A5YXgYiBnEP4VOtaJBnkFxVfx8qXXGkZp0K4I7nLFySizIuYHKrZP6rArJebnWlX/sU/0RpyCGjnyAoXJm4rlkZjs2XLUF7RLooY4b2gZaBAeGDss10P1Fg9gCxlfSBiCizwd1oD/cKGO829MQR045TEqLIJd91SIOglk0eWc6yWvLJ9iMgG6EKvfZEkn2wMOBvSXZbcX6pLpk036aCINkaDcOXucUpRjoiY3jGjoPcY2iPvq+vEx5j3fGjavVASVzWIbBEh/mcv4o6XZC2EtF9qxpRRCFMK1W1j8Mkz7rFo4/EfEgk2puob/mKnjJZVPMb4ecp9BigryQEo/wxNRFjmR8gXDyccybsNOwgZlcmYMmg/4dmDW9h7xgAEWPTYDY+MGEoNB1UEwh35sTVqmNXFqKy7E7m2Yszcdoyr59HAQRGpPEJgSSjMyEC1xXXLkHESCSSWAYLANpyajk24kYtS3v/SHsUgUk06BnSlfcUOrLpeEqmpPoPWdIn73INdvnpDDbHf1G3PnTVomo+nzWp8AhXoZu9dstwaeHwK6ZQbCvouLvjrN3wduT82qbGFOILEf+5Nm25bDvLl46ZEGJ7q/3g3gaF8ptph/iDTvlxSCy7dsi+MOMqc2sQNvhrePQjnYyUCkhDqZapuN2BwP9qxOqUy16ulXO8nLFegQxNUIFhBYzuBHteWGdnv2mhoSrHcY2845qqxT+PvjswN2WGkg3xsgsFhDEjU89R7bt/fHXZAIgp+SIPIjuVSUtzZ30Fz69UCOrQrCTBIF8zxJ8A4E2EkzNIe+ux/p+QPW4ge1g9ZpCd6swuZRjx6vPka7r/BhUPloEqm18kL0b9/sKwCmEGqHqnb5AFay/khxK49pTkUzw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8e80f561-b754-4e09-ad4b-08dab4a35ce1 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:55.8871 (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: xzDjdsPw0GSjPFZmS5tEj8iYH+KnD7iM88aTToec8eqWXwt7Kiogt27mPKz+K5BHHdRlOeIW38aXiV/8Ep+jfMgYH5I9h5Qp7ru/wD5pxoU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4337 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-ORIG-GUID: RibLGN5arFxmr3uZAT06b2pd3_gW1Gh4 X-Proofpoint-GUID: RibLGN5arFxmr3uZAT06b2pd3_gW1Gh4 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 Reviewed-by: Martin Wilck --- 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 424acbb812df..3c05ea3cf109 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 Sun Oct 23 03:04: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: 618710 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 8A859C04A95 for ; Sun, 23 Oct 2022 03:09:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230157AbiJWDJ4 (ORCPT ); Sat, 22 Oct 2022 23:09:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230123AbiJWDJD (ORCPT ); Sat, 22 Oct 2022 23:09:03 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F56674DE9 for ; Sat, 22 Oct 2022 20:07:41 -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 29MCsDV5019473; Sun, 23 Oct 2022 03:05: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=Lgqcu9C605h4D3Olmb5BRSzDBD20UOEPPLYwjxtLLwI=; b=elh4LbHFhQ6w5maHlxPfPeOxKpFgYAp1J8FrdlRCt/+3XhFEdulHsg9w/aIOAICVhEfP OXFECqYyWSv/lhGNYdgQiySRGCQPUvRTsS02Pt++XDz8FP/jhW6QVK4Qqe74QgYC/4AN Nc3PX2mNCJ3/ZQIWLCKJx/LqWD3zVOQ0vKC6mYMiWiXRxzVUBj+kc5bBBzAnvjv/CZPn LhCB4ovZ92OXLY6JrKOArz7GMRzLeu42XhuQf9Hs4Sz8e8sEc8sk0aq/8uacvXEXccBo H3Gs5J86D4FCS9i3jWLkwOARTgEi+OFHHPsnrGl2g+pEH0He2ISC3qvAz9kt3p7aLLEc 6g== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc93918js-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:05:28 +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 29MJW0fb032103; Sun, 23 Oct 2022 03:05:28 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y30aud-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:05:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QYNjBv0SzjoO1iJGS7rbvGHoYYoY5Ji89mMulJqobDiuA5kGDbgUizdbNqcNlg+38jSxeAY5x9wNdmMe3KNVsdSUJTIx/ai/CC/5TU6geTOBXKcvMpuHtjJf8kARGQL9fQwcrXLG0itbjaVTjvZxspONoQWeWF9rJ4+7rUUL2qYtPo5rXkZx/DBUpg9uamOMp+JwOmMzi2qIPGYEjrY7G8zSQGIicuRld4Ln/ficT8Xa1qdbzYya+v/fcIbomHik8REyd71XpokGOqGBT9gT1v0rIW6oF1ORMukCfZAwOB6n7fM48gz2xRAFeHt2PzL4jYRpfd4Kj2AIIEOW2Rl3jw== 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=Lgqcu9C605h4D3Olmb5BRSzDBD20UOEPPLYwjxtLLwI=; b=bIZXP3/HagKs9C797rs8do1ObEPGTAGW2KJmBSuFXKpFsWLeWu4nlYg7eIaX7beRyYYp97INW1QIuYI1sDafHfQM2iD6S1AHnHQs2SCDB6Q/wnmkSpuY/BAbXraTWe9kOdec2v0tsfN6RRZkGwU9/MH9wHgySHnIwv2edb7ga72Sk7iWNlKSmrYOj/qFtGuTB4jLSWjhJy3SSBVlbsrhVYrGfnP7A9jgPyUEci/pjokdyBgA9Q5ksQ1vfthBm38TahHV4U2O6PrmPDks+3baVvDVOY/AhXxWrX0qnvL2CpCAUwaPLp6szT9pi097yEg5mWdnnWLRmWqaqQcsgsEKIg== 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=Lgqcu9C605h4D3Olmb5BRSzDBD20UOEPPLYwjxtLLwI=; b=SIEU+32KebM1I04xlywqEZcPS3PEYTRYiluUIER4PizQrQPZh6CQCeaoTtHjVNuxnk1x0MEKG6k4I6+9QJEumlOTvD/evN6h8oLyCPT7QVAtZVh4O9Zgjz0WAJBz4gwKBMumvog9txeHqCF5dmu21aBBLPkYyCOPrLW5DgFdTDw= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BY5PR10MB4337.namprd10.prod.outlook.com (2603:10b6:a03:201::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:05:25 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:05:25 +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 v5 32/35] scsi: sd: Have scsi-ml retry read_capacity_10 errors Date: Sat, 22 Oct 2022 22:04:00 -0500 Message-Id: <20221023030403.33845-33-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0240.namprd03.prod.outlook.com (2603:10b6:610:e7::35) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|BY5PR10MB4337:EE_ X-MS-Office365-Filtering-Correlation-Id: 4ce43062-cb95-452b-73af-08dab4a35df1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +W+C93hF/lgGRrBq09uRveJeAHXqQHOcjht4kLe1PdCFxWETh9UWB90dqlhOW+PgJIpsUne8FMcXZ3QWeMFktFZ7A90ZKyWDIG5lQiRtkiOcZwi/YI9Eg2+SQQ8Zjzpys3dW/AaMIOYP8ehddK5Zg+p/u4kQfJu8+ipE3c07bduNCqCoczAvXA64VEBdx8t9TuiWxuTdmqxxufbjZuw/+FvzrzslMY1bz+Qr1czaBptafIIb7JULET3Gs4d47vZ1Bt+4aVkakn050wyxDYAtkwC7cH4U86wubVE3XhGGuQiCBHj7wfaa+2LJLmYj3+tROkHfutcojRtCgnTRQTCljFcSAOaKW4MBq0b+nhn+KyMT0bJ+kn7VWmRWBqJSXWrQq9zdHwBH/xj/cm90xtEzxaYll9jr38FNLgpf1sl4/ePTBFM2Wl9iwyItRbIgMRQA8EZTad+UqFiZyxA9jlIvke98g/kaXZmaLWD99urgvq55I2Z+iCwGFZ9oPe2D6XJ+O2aj+wBDZjctZmFjC7eTlBDboHLyWbU/2+G/jPYCANYJEZp7EnstIizREX+p69lbnM+En9X1HLmJRWNhRxLpIB4r5HU6RnOEalFY5/AHdGalaVPg9zn06DLbNtUENYHM7cRSIs6jWkgw1UgOda+/+Y/brgqNckZDzuJmZwZab8A+KRhEuV99kHocCRnl+dVfgF2/st84oDs+LkDu0Pc7JA== 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)(346002)(376002)(366004)(136003)(39850400004)(396003)(451199015)(66946007)(8676002)(316002)(478600001)(6506007)(6486002)(6666004)(4326008)(66476007)(66556008)(107886003)(8936002)(6512007)(186003)(2906002)(86362001)(1076003)(5660300002)(2616005)(26005)(41300700001)(36756003)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Pd1tkXTnf5md49VbeSS50ckfqxHmnNK/l/TdJCXXi6EoBgofDZ/CjlMLuyDEfSTrCFtADfNLnFb16oH1ngLRMLoh5a/d16aNdUH1238/OP9k6qzl+dHi+Tr4wojSeurK+qL/oCCrHp1RjqhVGc9jZ9v5ztCNbEVVsAjwGUbveYcWv+nthVsl3vKXmq89baul4PH0H9paLCkPIzuqj5AEnRgi3aZ6G1mM9d6sSBLm7wBeH2TRO0NkDNW7F+lgT2yxMezkeQtPS6QLK8QxWuNigB2syGCIOtjB19biJnpCbw82TFR0k4aSLWISuvfF/Gtvupp1BqsobL8uvej+MoauM0iWS5UYJmcMTgR0IWxYREbsNGFvteEuszdYtoKGHFVvo/tZy7SV6fv6L3ThdxGp13l/Q/U7CrE0HLDoZNWpQQBKmRx9dV43XLfbOpuOILHOEgtJs/JGseP8KFsQiH0Zyp1ypr3SmnG9AXV6QfM4Nk+ypFFrxx17IimXG4l+0gybAEWIoP6tZ04EcEtuMtWvyW9znDKS7O3uhkUaFy7N12Nl596MIcBia9izXOfpXemIr+zpnWn5xHGwwmRdGUwV5iYCzop8MFHordgTfJgGxe7P9pxW/FZ2HMsLBRo2/b/rkUmT3IDPyHulRg7H8xFWryzCJrhr0h5Axm14gmC0RlRxVz25upnI6rrr4rsQVf4eHPkrK1f0xbV2jl9aKtzjwbMUph/+QtrdXmGwYsLp56rHR2zFZdjyrD03T4oqNRQgyCs9nB1LFRIuR0KszB9QXasmiDnxn6rPNH+7w4+ucX3iQE5o3M/CK5DR60fcY3oUUdbHjlXDWxuN+Uq/2qhRZDgHDATzspaAxy/lqh7j1H8OyJ9715tpidZGhrzybIqO4WmwIzLjyo0Qj2nzLDPJt+4/x4uDNFkMKYOnnCVAKt9d0AJlVfu7mlLVYCGVijtRHUctBXQ3W7uELn7muSbqlUVFpmbWMHB6qIqWKYO38NPktIlLNiOmuqrKwD0//X5u8Yr99LJjz5En0OL7Qvj4rJhvW5BobU2OfmNloD9lPrSdNHg7J2NjmgKzgoNZAtgeOs4Vfds8AortPX5wX9f5BjLuXFND7Nf60UIRAUzFh7jI2xSfDaNVIcRd1QvCfADNXfhUax504Q6CupJdO7p7dqg8nhh6qf+sj7OO+GPnWkdlWP+MRoBi41bNAIGyEu5BdqtiS8oxNSkk4lob6PmHlVZDMs3UbFXiOW/jOfTpApNy1p4TkLP784nM5XvVgvZyxrJ12r5I78C18SDej6USxkYVG0hI2vpYS4Ru8hzknjhqiGzSUSluURq45/2EbD0p3vd0Uj7NFb9Bi3KI6esNQNQCDRyON0uMF7MyYFtoIVEfYTaAx913LLk4loVeK5NqSJQEoWTILUalLlzAvqku/BMQVn4qyBnZpiULxtrolIhgPgwvQ+LH+7/aKHoQmd+PJcoY8WWtqRIhbEWxPjr8RnAa5VYmWngHPWlsgmgydmsQeLR1eK+7k9YwWzmUSHeha5gmpZpTQ2yIPo3sealONM8OOu+/asn1qgt29JTodSiV65HVIkN4H3EJXUH+eB42uWWYayKvzEw/wmGNDMWVcw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4ce43062-cb95-452b-73af-08dab4a35df1 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:57.6213 (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: kX/1+hpVw0Pkmq1ZEhcuDO0wkK0A29uWYsFLGWzjJDCe4w4RSourIHMTR9l/4VZ0wL359k9BV0zGvvrYVSUFz2HMdhv+HKD0zrY6fnijCaM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4337 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: VAX0zsxLtppTujlV9UwkmAz9Gs7F47er X-Proofpoint-ORIG-GUID: VAX0zsxLtppTujlV9UwkmAz9Gs7F47er 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 Reviewed-by: Martin Wilck --- 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 3c05ea3cf109..187b4fe2bc2b 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2433,45 +2433,59 @@ static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp, static int read_capacity_10(struct scsi_disk *sdkp, struct scsi_device *sdp, unsigned char *buffer) { - unsigned char cmd[16]; + static const u8 cmd[10] = { READ_CAPACITY }; 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[] = { + /* Fail immediately for Medium Not Present */ + { + .sense = UNIT_ATTENTION, + .asc = 0x3A, + .ascq = 0x0, + .allowed = 0, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = NOT_READY, + .asc = 0x3A, + .ascq = 0x0, + .allowed = 0, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = UNIT_ATTENTION, + .asc = 0x29, + .ascq = 0, + /* Device reset might occur several times */ + .allowed = READ_CAPACITY_RETRIES_ON_RESET, + .result = SAM_STAT_CHECK_CONDITION, + }, + /* Any other error not listed above retry */ + { + .result = SCMD_FAILURE_RESULT_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; + 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 Sun Oct 23 03:04: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: 618709 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 36F92C433FE for ; Sun, 23 Oct 2022 03:10:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229967AbiJWDKA (ORCPT ); Sat, 22 Oct 2022 23:10:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230129AbiJWDJD (ORCPT ); Sat, 22 Oct 2022 23:09:03 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BDFC74DF0 for ; Sat, 22 Oct 2022 20:07:41 -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 29MKvujD001390; Sun, 23 Oct 2022 03:05:29 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=bv2QDst3SvZ9Om5sDv86682KKPj3G+AqO8+l3f6Ty5k=; b=CURP3F7qUGy3iguXoadcb/Yu67lzwYHvsAOInDVBne37li+hLn6fCeIcKas4Uxp70wxO hA7qLtevNJCrT2Urs0WmyIJNkwxLrTFCeUovZTgNJbNTILj+E3CgLohTHRGhA4i/cYwv UWSIfygciOU6vIbY7iU7sfc4+oj3rDeKE3ujzId3bq/CMgfW9y9LEuOEzfQLv5v88VQh VT+zo4BlWu+G6qGjcW59ilnrAlmCcZztsw9dRrVVggLV+cOcJcE0cjSLhhbr6Tft7JFE fDO1TgiVz6HFgYHgEpaNXfgsUkaHJVOQaQWPa1tUnYn1PUteMmAI9xd+q2Jn+fmMf4Yl /Q== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc8db95nt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:05:29 +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 29MJW0fc032103; Sun, 23 Oct 2022 03:05:28 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y30aud-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:05:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KFb/QlP+eXWTEkTScw6skpmApFdEDwe8WLLRi/ENkZGxrPyzQFoZdqSr5l/vbPvcTw/5rBS3KdKRHUD0c9bSaUbdFOdqNsiT+/51KKdYXkNAE4228WXdYJbmHm/RT0tyX6sMWXn7vmZk+yhn+21Cb4Df+uhTCVHejGzOserS72nMfYFdZZZ4LCXQn8+3glDmDKZ6cc1pmsHl+1SxeS4vZFJbvtHpQqHeSO9C6oeq5uVxcpnXNgkBelW4l7qYXXG8K8sn8GBVoUpcG7wBHVMhi9nyWjnQlL/SO8FW6A4znWDvEdtf3c3O3+XP5qZxpRbrryE/iBw/+c3ySMJ9UP4DVA== 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=bv2QDst3SvZ9Om5sDv86682KKPj3G+AqO8+l3f6Ty5k=; b=JKaGF+5UaUmQoGULUsjZ1tepsrlrGy3EYnzL97W5kNtzOrP59IMtbeo8t6VogxB+VB1M1t4P6k+I5I/fkp9n76WPXcbaWC1Kzw1GQ9LeAcmRsAIX3ebjDMwLq73IpiITIOdPXOVQIDg3MOrTnV2WO9rVMf3rJxZLX1Trdtn7HDjqvy3sZwzmvoxbMYKCZv4iwQDPe67sHa9M3DGGmtnvH7kEKjc9HuEVR26QoMUvN+uG8mi+CKUMHyOlle4ugQG2xgb8ywFmKajEikFeUovSlrg5R8gyUjWqGJdP73xQvkneKNQxwDXzeT8MR5kJk70GSmQ3gOFMUfwvLlHtiCKqEw== 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=bv2QDst3SvZ9Om5sDv86682KKPj3G+AqO8+l3f6Ty5k=; b=sCI4vJwCLKfkgsbSLZ5he1XQfbel4Rzl3KPhA0Y5uA1mK8XoVrEy8ckAHXQbfMXdLockmf+wz6eQXMuDd8TUwcZ/hn9elyqFXpqlKysI4L8bCFbDDQjDOiItgx+WBWAsQdDdV0JFmTPZKA1fBf4xjwOHj4OyRzg7uKGCEGg1LdA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BY5PR10MB4337.namprd10.prod.outlook.com (2603:10b6:a03:201::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:05:26 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:05: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 v5 33/35] scsi: ses: Have scsi-ml retry scsi_exec_req errors Date: Sat, 22 Oct 2022 22:04:01 -0500 Message-Id: <20221023030403.33845-34-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR15CA0021.namprd15.prod.outlook.com (2603:10b6:610:51::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_|BY5PR10MB4337:EE_ X-MS-Office365-Filtering-Correlation-Id: 8a7de117-a906-41d9-8c0d-08dab4a35ed1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o+NRyLWnvyQZq7iXeJEc4kI7p2kxCfP5FQrZS0QeR3isOcRgO8+0lpnrsnEZYDyqRv6Rt4GlGqLgYA4UiQGkxqK533cJkVb4OYAsM8dKr8FoLieFjOmzzYkWnk63BBJLR1UbIdx4wys25SD0Tu5i/zkVbn8XEgjwfJBzUkSKv7o2y6g591oO3mqu0LLZcN2TojYuWmW8ldI6E7ZRCEgOaLaPqtMHKDwtWQ0yHYUr7PPRltBXb4iGwnuf/0OvNoLrdVGaeiUxaQ+0Lx1f4VDA9jAwI0frbzvs0VZhinm8LZDIBwvpjVAFH6WXrPvUlTkblrTpXuIH/vdVR5fHv6pjeKxypeBoidPP9ap9/N95l5odq4qmk4OadHkktHEIegpFhoWzWfXUsWbXISkPPSa6inBlyUoo9viEYHNa3w7ql9SQtCIce5Izq0uNw7xL6pTQRg8j/FtWSbuXrw5ulPDf1utaREWmKbXtHh1kNEMVQ2rKlDR9Aowx9XYPKTJbaspgATf2einfAjeWRkWPOBF3BctVVsZGiR74lsqweP7BEP+kHZ/N65raz4Q1x4G6Nx7/JG1nszK3lrhyRW+KCyiX5230fWpaj8ZaMI+4/2qzEDnBnZokuTTk+nqB/KZOV5I435tjKAolN92/3AXDPFWnnuonS3xX3+is55K/yzPjpeDH/JihfGEghFGCpTIk6j8ZDPBASFF1lf3Q5plO9ECS2g== 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)(346002)(376002)(366004)(136003)(39850400004)(396003)(451199015)(66946007)(8676002)(316002)(478600001)(6506007)(6486002)(6666004)(4326008)(66476007)(66556008)(107886003)(8936002)(6512007)(186003)(2906002)(86362001)(1076003)(5660300002)(2616005)(26005)(41300700001)(36756003)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sPNWBPLBqTp5m4n6MY/Fc/KdoOlaElZDUeiUP7fVrWDIQgU7MRkhfr0dew5I1kMzn/o7uqnxf1y696tdiM2qMZTQpYxEmHlin+IbP9KngwJpg5Bnt3gb0Tb+nrwgUurwTs2d/2X36RGvAB8UuLJ3Br8iDE7zzVBJj623MeiRjHOAEBUwcbE/tX2zOQopWrmNKP8HVuu5jnl4LyMyxsfCwWhgYnrep1gKJIRW7+l7exu0EH1lxCMUY/2Qt3MW03Zti5hCcqVXGrv8uQmsbvpWP/zySppJKkA8G1wAW3WUzif0QSi3GhTo0LWOa4JQZVz5aQFUZUjTjieXzJ9WJfcgsFDZNzya9Lk014CywPqaR9RO2uxZTQmxcAzRjuM1xfwX/kzLYNBeoMZumwve94aoi1MUjcsaxp/nnqPYm+2cdeSWwpnrII+Qx4t3ATKrqBXITP+yL6T5a7JaFvOWVGawjf7uFDFO/QFMQd3zwIDB47dUjL/JbWTm7aoE5cQNgrfxAKzVAYe8HYXKR6ga41jyP5gz7D0f5hyRoRUZRc6o2FbumHmlDnQWeYWznJ7FRBn2ST21E1iZs0kRFbqrtORjCVh26FaUVsKHSME9m6m4ZKLzKkhwvKX4xXrAxMmVv2ftuzYZBqlKOMPV6ZnhPMv+6d6zE5lgde5QnM/IUCJmFSUpujHGKllgQsAHkJsYT2qef6XOxA0b9/QthxzckoNPaqJIPHGqlrd4zYyx3hkyDiENX6ZO8huG9hq2dYzW94/FSQHpKPBkjcT5priDGGlmw4T7edAqc/3ks6PeLEZ7LTtZi1hsYSbY/Vlw6V3hJBXCgIpg7GLwmVF79YJokYvV+mvX5XWE+Xh17NRjcO0XFgknBJ+vLa+TSelcBDHqfTWIHdVIJDpO8vKOmNIN/cM8rS6z+ULwEfTC/P59U25xIKtVAiHxGq8y8UveE0phSgKfHt2yjJQ3PpSikmUlONIHnjxmtEaoe21CayqFgRZ64KaBmxgCBnFHkjHy7IF4n/Z0LkQVyt+mCYjwtfN29sjZEp5qUig9GiBHb0y6RG5MJKYMD+8PFgS5/HOpPquzRgcvtLQT2oRTw1HiJa5OPhPa5+3rk35J+8Jam4n+8u9aXXOPd/VuzgQpmZPgoyJnlBKstON85SGnRdUujMOMky2ONr+QfqDTtNb0BrqXsQ/tuDxx/Dg6KnVX6cW6GC3OLTLiHQRcLXpBEhuvyW1vmzWE2kdqfF0eqNviQkYuX4naUtBM9g3AQS9KuCqUhNCjq3WO72gcK8wDz+SHdlno7b2vjjfIHkJ8KHsO+pOL+n9qFpaWJ/Z2Ykk+whsfJxZl3ahNvx+My/ev3Kcf9nvaumz+0K+pS5EBI6oGMgkwh3seVqEqg0gt1mNNVertU2Rw9HmzLTPmS35Aox393bkgp2AZHmqrFM22/rXmX+eUjMxFuvleuDzE+9n04LKghKdkP+7WxRuaZeVwBjmhZkQsNWJ257lIbtV1bQ3tHUsf3fOGJodwtJpGJDS1zHR9BpNFj7DzNlS7tHUGaWjwocZ+GUi1/CGK11XhclDR1MkVYBLht6i2wDlAiWCCrBIRqOcRfRLi2U1zDivqMKSllt6rEhTD6w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a7de117-a906-41d9-8c0d-08dab4a35ed1 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:04:59.1681 (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: GeIRfETez4TFHUBhvnBQLUKVoNKPNDcaUF8NCTSs8ZTfaFsJlNXEdIS00hXa9u2siNG/UAqAUIWAPQwSriGlX11LedHR46BRmGHljQ5nIM0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4337 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-ORIG-GUID: O3JJHfQI9K_k-hf7TzfSIuX2Ux8J8xKE X-Proofpoint-GUID: O3JJHfQI9K_k-hf7TzfSIuX2Ux8J8xKE 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 Reviewed-by: Martin Wilck --- 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 Sun Oct 23 03:04: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: 617781 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 BD4B9C433FE for ; Sun, 23 Oct 2022 03:09:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229847AbiJWDJ6 (ORCPT ); Sat, 22 Oct 2022 23:09:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230126AbiJWDJD (ORCPT ); Sat, 22 Oct 2022 23:09:03 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFA8774DEF for ; Sat, 22 Oct 2022 20:07:41 -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 29MKulHK017954; Sun, 23 Oct 2022 03:05: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=7qvoNDFMae1B9HAqFmNS0eFjffE6FFjbKNa2a64ShMk=; b=GEm1cXovp9qM7J1HAcwUsxo0TI90BRH5B50+viFdJwZPmDGwfTFggulkfqS6WzH+RWfS iQOTFIzUzjJ4yyUtoTXmI4/g1JmGYjIUhZbu4mEZIH7RAFa3KoWyrQTfXswDPnlAdc7M wOTgfoV2NEO3zdCENCv8YaLkaFQJlVBxdSBKp9OEwZK24w4RGrVU2jPCUjlqN4ycr6gf eC/GFKCzAWL9dtPlb1+Ma1VR9HGsMMsjtvq/P2mrquU4uUu5qw7QuLq3vUC3nohyBurL o3C80CkzytJxkYDsywKbcNFoTHstbqQ44kX+P2c/m9x75i5dtJ4OonETzstU4mLcCOpq ug== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc93918jt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:05:29 +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 29MJW0fe032103; Sun, 23 Oct 2022 03:05:29 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y30aud-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:05:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n4oh342T5hc/pVHPJFFRie1pK0Fgf4Cdgp6c2gYSU82e8M34ZoSRNRsz/GcqnqXYytgSFXL3EMHh4mzoFSmW9cpGiw8AAzEqkUT/Vne5bLOrHTWV7jlXxArJm7LMtdYKDQ4dnXuU/r50l/z2yGWnNhyWog7AeOvKNrssNuZ7+vqESlS87FnfdVNYrgoUB41O0iGLFCoxcQv6nOmyI0eQq4TRgvYJ79qwH4w7wD8D+7Yg/nqHSHAK3EtiKweBsI6Qs0ZjfelTIjbA886HLkkbViDnvEF6id+uD/tEg1pIJ2dvlp6+bL2SDM76ChFD40SD8wgYRrAZH3MED1EsBD6+yA== 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=7qvoNDFMae1B9HAqFmNS0eFjffE6FFjbKNa2a64ShMk=; b=A9wj9/RF/MV4YPSZS0Au08tVT/o6mLLHrhAgBhD/yj15CbpLXqG0fEV0g/EiKEhpF7R73RhDr+nh9g4jjZ9TloWYkcFQy2LJohhyOEQKH9UBQ1fWAv02p0setrpDJkAtnHgDQPPALSllwpNdq4bYLamnMH6jD4dLEZjyb2FoMrlQtcc2dnJdmoqG+9f0Gd9ay6e7ey17vpMYN8pYGkEtgqH7DMCRf8VDL0hadq4+elfH4ZpH78IixBRxuMFT6E7Td5ZFnolThXG32JmYYksUD/LpzyeQHl2lECKG0eClUljk2YzEZ7fnMwSEVb2GxPA9oIqbCIOye+m98dvzKIZyaQ== 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=7qvoNDFMae1B9HAqFmNS0eFjffE6FFjbKNa2a64ShMk=; b=eNx+wMDNH2+5h9NS+oxfvmAvmxvjj6VPxdjK8jrbl7jgClD3atCQuXvzjzNcTVkOPKttG1G82XFXfDRDz9NHzAZopNHlSzcFCRa7e/gYxUs+FmlDobGdGhFxa/Ds38fg0C8QTkP9kHcbKdEU4LWUBDq4k5yZ6zjECsv6riXOEeo= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BY5PR10MB4337.namprd10.prod.outlook.com (2603:10b6:a03:201::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:05:27 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:05:27 +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 v5 34/35] scsi: sr: Have scsi-ml retry get_sectorsize errors Date: Sat, 22 Oct 2022 22:04:02 -0500 Message-Id: <20221023030403.33845-35-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR15CA0021.namprd15.prod.outlook.com (2603:10b6:610:51::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_|BY5PR10MB4337:EE_ X-MS-Office365-Filtering-Correlation-Id: 5879230b-eaf0-4ac0-7d8c-08dab4a35faa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UPbgck7nP0H1QoUDRvcs3Jl7ef4B/8r+VFjX4Hlt+r8J9D4oNgRPUfY0mk1A/Kz1yBt5F25uyhIbvn8hzuPOcTTseAFK55RXaaOUr6ha46v3UsLU1oLuwGzIIFiU+Uobh8lOLqTZmyt8l+5l5DyyLq6S3vyk1Yj4IX3dloh9/+n2vp1FY56U1S0U6CoF882xbcqIPhIFHUch4ceBDv4GzFcKN7cfhFCYYWuPkLBUAKn+7Zn6ohqiHgHAPlkeD61Aul6eCJnFNcLcd/hCqfPHQ9bZ0Hy6MZPKEe6E3i6zSn0tfeF/yfh5ttoQmDh69ZVP7LHfAVqDZK3PYx+bpyT7S1BYewIpuq5dhmamxdT1o1HuzlySRh5mvzh/lBJgtgdR+WhmzT60OBjPfqr07YwBDyPvs3VlCZQS7uZ0a9z9vRbs8SvqN0ZUycGKgy5paZuS/bysObOklKCZzztnkRNjSo8tY2Onogj3lpm6NWEq+//bUFeJ0WX7I7U7pcvBM0wJBfN0JLf5Ya8HdGVUIbrmc0/+E16G4TBH0NttZD35v9NyUj9ecHlWtG/Rz5xZYGoA2MMG/8zm3KYUa+DAROpYcw5XFW5ugqgZ23Rhl54POHxHt5CidTrEViJu3foYXgK+4CpiJ3aomQmnmmOgfyEhX8mezM5u/vrd2P5nl2DtAHsqIZxwJRW1rhUsupfSwVVBfoUUtjs7b0lL3xh8KCT7eg== 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)(346002)(376002)(366004)(136003)(39850400004)(396003)(451199015)(66946007)(8676002)(316002)(478600001)(6506007)(6486002)(6666004)(4326008)(66476007)(66556008)(107886003)(8936002)(6512007)(186003)(2906002)(86362001)(1076003)(5660300002)(2616005)(26005)(41300700001)(36756003)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7ZzNuNEcoy9yz29ZZlsRgngytDnWJRLqr1t1zq5QBmk5Nd52ONxvByiNmi43/k3UzgmANbpmp7SFRzMNjJruDMVvm4upL3/ttt0bUBYVIN5wuC0OsJcufbx0Gz4MmMrtrN2o5dxI7GCGYhu1Flo52P5VK9e54k7J3zzFJcGZmg7560f6woCrk0ziHGFo4J90cSYE8ycJ5ViM0nCqKdv4L6DKcoltrycFQNq9IJ+Lrlfd+dTaEdNlRSCnMBa1I3cqOCyuqUrYmgFpnW5xMEj2TRbfD+vuyfh+O9orVDBryFokJmNBDn8i/Grd5WCiDjzRXpS5Md+u6L5pod/ErmzlC1cAeGZzj2Agyc6QEdGdKxebPtUkMr7aD8Yec7u+ZKpE9VCuCmgQLahtE2sXNlwdIvj259i5JFGWklrLcM4gi1plipIgmIAivuU47xcYB7CKzhw/t9i6bWXOqlZEsKJKh8pAEZXBV6uAQocIpGFUIIwb7xyxbJJQn+udBbhX2SqJJYsHIIzRGh96c/ZDDnvYWpRkTXHAeFW6iPCGe22MbASD8M4kJcOC4ZHdH+BOEMF+5kw8jXznBHEKjq6cCtVE6oBN6FyonFGCTq2WyNdfNyE9V075NY+ABKZZ2CkCEGTmZ0WDHd/8F0VbS+/072E8OvSSxSdc/vBaFFFuG1eXalWFWh5SvGkfN+1u5PfwtKF7uk3jHLVaLBFJWZY7EYKLKaHLoXvH21uj1XxMPidqx5Or9VsBKFka4ZhdLzAmww+023zuZRcdEbbeG2mu12KjVrY8fYSUQaxMcWZFFPF4w4CWMX7ZBU1ulrXE/v/dPBjc1346Be4AYOtIoHOjK8GtodsWmqaLlseVsF76jrV1TlRw+LVTr4hmtdF4gonbO8a1uuAnr2hI48RZfvPMa924GTUbDaRzU85y6ZENHPZ5L4u/g5msJ/ogZiVb9ycEkNWLIKyejJFUtjm9DIMeXaQB/NnkfOCGOdXxuqlxzcCv5xtxqJtXmeyOc7BBlQ2TdFTZCgcNotBOazqzT/TWC9ndFM6a9hhxEjWqjCDkjVz+qycGjOdBZEoJMj5X4EAA1E+TEzccepI14fIE8cl1roQl895Ed6ommOP5XcmfG7AntvgIh9xzO/+woVSFykjwQIUQQQvUgiNhwMg87Pi9IA3+bgg6FFbCVYMY95GxKJWTP6lLar/v/QDhSLHChYedGOD2kzpTiPwlNqnLX981xMM51gBPcRGZHS/6JqwlqEdDqtA/3x1SjMrHMqx+faK6dV6kC1qA2lYCd7fkaNt42ibeDNoM1u6oXjSD8Xho5o7nU0TnP0FNCzf+7Wmjo1ChSclSYKOO6lt+WmVqRGKbzPIsww4LnAFbd1xAjVlGTREXFA5d3eJ0K9W2sVygr/AiQsdb1RpScVAJC445GldudX+v8cKrnxLkmZTmzDRVvjVXUHyaG2HHDWcZCnMhK6brKHYRhG/SIt4jTFQeXsaHGmYodsyzpib78XrARZy7X90hGR1D0YRAahJRoWWYC/xAHv3jAFUCfWi1OBV2A9/o7zhxg8eCCytly8M3zeaAfTaCXpsP5fH/5jwq6tPMECFUehjnbUZ3U0BMpjVMoX8PchqYnA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5879230b-eaf0-4ac0-7d8c-08dab4a35faa X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:05:00.6524 (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: 0m84v4iGbyWTK/QLld0vm11XVcUDyDdFTjAY5ZFKXYJb6UJk1ElExsUso96ykLsgv3regpmh3x0QG0Dfb66iXIBFl3UxjOIJdHBSjrMwfvE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4337 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: 8nnPb5SZXpYZiljng0UB1tgDY9nkyLH5 X-Proofpoint-ORIG-GUID: 8nnPb5SZXpYZiljng0UB1tgDY9nkyLH5 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 Reviewed-by: Martin Wilck --- drivers/scsi/sr.c | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index e3171f040fe1..44f1b62a230d 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -725,32 +725,31 @@ static int sr_probe(struct device *dev) static void get_sectorsize(struct scsi_cd *cd) { - unsigned char cmd[10]; + static const u8 cmd[10] = { READ_CAPACITY }; 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_RESULT_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); - + 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 Sun Oct 23 03:04: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: 617780 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 3C6CFC433FE for ; Sun, 23 Oct 2022 03:10:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230038AbiJWDKO (ORCPT ); Sat, 22 Oct 2022 23:10:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230024AbiJWDJQ (ORCPT ); Sat, 22 Oct 2022 23:09:16 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07E7373C2A for ; Sat, 22 Oct 2022 20:07:42 -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 29N2tC32015615; Sun, 23 Oct 2022 03:05: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=jX5kJrGR0eQrgYNm0xW+T4IYbQSa2eltMNKAoyURwW0=; b=dzNxBk7js+0IpTFW+VDLX84gAl+au4iNN0TSVx1b2ExsxkBeK/Nckyl6K52w1mNk2KAA Qz0/c2y7KfDM9rxv3ah5daU7qGZE8g1945TxODrj1R45NkZHuYYNerUytXGi6GazbhjF k2/nYnMipLMtk/b1Ftp+O8SCq3R0IqqFJmLYhOP9W2r2l0jc0bGkvrUpdpyoDn8ytkDW 3Ayfjw++KoHSLIPDn/ZqVf2DR7ZGZvZJXDYaiCcGT/nsa2paAmWK186z6qm5Xe4RWcVv VK0S7mJOM1qIs05M32PrG/ZoWSFbKNoilAetx8IaDjShL2VoZ+ntajRhTLEX5SiaaTx+ oQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kc7a2s4qr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:05:30 +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 29MJW0ff032103; Sun, 23 Oct 2022 03:05:29 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kc6y30aud-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 23 Oct 2022 03:05:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=if0zCE3MPi4urDCHI6kMHUHJozs0/A8lbzJ0jz5WI1azRjFkOdjK8sOFk9dwequeeGgVOKWZ8fIHagyHYZH1yRoaRMO17lO0I21Rddr+YlZ36C/k2r/P/gnGlkj32i+qSHaXYrDgCYqDJWuTPPkpOJQmsJgsBl+y9tnqnsWiR7ZLidcyJfmSBV6Vb9PetBE++an+yemZb/nmkiPIF9pTh1sqCi5bCrLHYgVUdtHSjNxwJ1XGtDrf9SmLI7isy74KYxk30PGa6/mqLYc2tZWGe2MsAAt1c2ikdrAw2CVQDt/G7257OrMsjU0ai96w/7SjaaDhLBW0fEd6DJYaGchq2A== 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=jX5kJrGR0eQrgYNm0xW+T4IYbQSa2eltMNKAoyURwW0=; b=Jck+K16HHwvKMfC5It2jJeNmHLS85PYw7McMUiVBdmmv6bUBwNk/S/oPHGGTroeTDGJmbVCASTSlXHKpCKQUs3DeADG3ziMIlKTLeS5Fi2X48Z4Xtgx0s7ssmoYv1tsVEzfb5klIMpH9Dywz8fPLmXF126uwYGnOrXrTVo8l1aBY9QuXL2AATITJFHaaaE9XqpJLgR6naYzkujK9B15GAugT9t87uuVjs9BN4awrd/OpFjFSqK3i7fq8RRm6KC33exbcCngSwja2HKGUnvTFAIJtxLMHhQ+0iFwz1xor2TDP3AZa0rRLGX6IT5xLURscGsfhp66iB+oj7ifPPs/9OA== 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=jX5kJrGR0eQrgYNm0xW+T4IYbQSa2eltMNKAoyURwW0=; b=Tj+xR0KrDevH7KH5kGHzNf4Wmhy+jEwa53llSSPVTewq0IMB8aLUQlGH3Y9yjFyrCojvrSwlKPTgPCh+5CJnhBVEzehoFBnUR65AO4wkRB2+93r8PXneATRmwFAZBm9vGma8gK8oZVUFFNRf+6LWFPv04flYptQukY1mv3B/byI= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BY5PR10MB4337.namprd10.prod.outlook.com (2603:10b6:a03:201::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Sun, 23 Oct 2022 03:05:27 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5746.021; Sun, 23 Oct 2022 03:05:27 +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 v5 35/35] scsi: Add kunit tests for scsi_check_passthrough Date: Sat, 22 Oct 2022 22:04:03 -0500 Message-Id: <20221023030403.33845-36-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221023030403.33845-1-michael.christie@oracle.com> References: <20221023030403.33845-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR15CA0020.namprd15.prod.outlook.com (2603:10b6:610:51::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_|BY5PR10MB4337:EE_ X-MS-Office365-Filtering-Correlation-Id: b4bd9e0b-0044-48cd-1f24-08dab4a36094 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: syJMMC0Wpa2rakmxwJpd8xJEdQpWiSrm3JyfiilERQnyrzfKMZj+l4m2bv52SyMLJbOylE0mun4sDESPgb1K05hcQijlQzkFXZ/oL/SLr0OcCxXtlAwT28RZ7X+LOpxOJARuvR9Xc8DbsLtj48WWpcZ9sLTYuUIsd5aB6R25Lth1Bwf9HF9wHcdkgpEBHKSMaLicvJdeZSgbOxBois/+Ywg+r4Dw98QdRi/kLMMYxyJKDW6CEwzJm6fdlcfXhN0QOfgKMsVsei0lF6iWMP4EJDU2g8TA+3mhelhyV3SrByNMCi/opuf6DOE7sXmvn3VqQmaX9w741yl5SVj6gHDC+VhCm+NuqFwQwyX7fCCWjQp4MsOivRJgE1SSHoDi5h1m4jfVOsuwNvcwu+9hlGkZbxomlZZqDEar6Bj+rOZdq99F4U7xbLUea6zUovqeUVgj6aEc8AUvpUaMe33c7/1HoW1wDhNwRC4XNkDg5hvCyANPu5XpCAz0EkJGx3XuJoNRG3QknilrdfdOJLYYTZrmduCec4yydQZmulOVZl0fKL8NgTB5/iSIaKu3BCyg8fQFa7axNyWD/UBpBVrs7Qi7bOwKNuALh4NFtbh8iuV9vqok4vR/Mj9SKyZ4hbfseewIqXzDlq9MRzluT1V/nDzBkxHLCvacVgXeMAGxCTGJ8LnmVaEg0M02BVfqIx4W3FlSrC5JtuqU6MD9FPG+nZClXA== 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)(346002)(376002)(366004)(136003)(39850400004)(396003)(451199015)(66946007)(8676002)(316002)(478600001)(6506007)(6486002)(6666004)(4326008)(66476007)(66556008)(107886003)(8936002)(6512007)(186003)(2906002)(86362001)(1076003)(5660300002)(2616005)(26005)(41300700001)(36756003)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ko/MKfimlSAP1PxRwLhTjg5jf5Zd0/f48GQIhh9IwmNjiKaIg5ZqwLEoNhhfgeq1/Y+pF2wqrQ/aoix4Ip9itr3vOAJVPeZ3QTUjRTr8ka9Ur6dv4SZrjcQ++RN7gHBP6o+L5QGOSNx8mzLi7L3oq7uq5K8liaNmpkJrC6q6W/R8LRgd6meV/QN1OpK7XAoq/dcox5e3jeO78Qhl1gkk+WwlZR33r0RIoyKJ8L2M7g3J8QDAHoC70vtLp41/pE08yF6r5cmXzv1gHY+Wkhcq32kj1lBIba3Pe1OLgN/XwxKqyI+zeLdktD2zLJRaCTThtsOOV5ZU/6KKFGs9l+0ME79tIvFxJQxR/RSnSWmBHGlLxLxtxWWx7j+9cCwNfDUWGFxbwe4vBZN08iU6A+iXt9D+pvQ8QBzLMUx115n3jHU5ovmgYsnKTBkfEFp5yJKUA6D5RCydB9LlluLAd84VIB8qX31oXTF9VSjwSCs3kHhFbsJfIee+3F+HeECounOHqW6lBa9yO9cYKL+yVvG3E4OmUlfyvZVDA298z36SV/TVFG/qgb8/H3Iy9RUcX4jQ2y6bqCST1do44gJTMj9TgJRncSH1t/x8vS2NUctMwRF8jdH6OrVWKduLh7RBzabFXUiCkriGNu6WNnQSqxxwNjAXTYNSAFDz5/Z0aucjsNmluR0by14LHAk/PWuM3YEfXebMGC1RpRlioRMUNx0vZpkMPI0ppXtYNdE8YIzfl8Z/NP/I3bLiZH6Z7ZuypS6Uyi/G6HYeIIiwRqSR/L0fo6hLkS+sPKZNR1JrC8y4HWT7dxLhya3GKRjJsH4V4K1vR0tK/R4yuVgBLDYXMTxJiKGRiZWl8/kh4t0bsCbncictYLZ2klHFyuhf8l1unErV4UrEl41KCco41TfWx66yQd+snV6FTtoV++9E9d/jAgijavJtpJFnfXt2rqYex4Vk6hl9PLxX+A60GBFHR4IuE/K/D170u3MqfJyiA78oEE7/P4UepBFRSeCB50Fnbb/Ya4xYi+SSWHMUaz0zqf11advYbZsdpppNs4ZW+A3+WLD72LyO08CtZI8hsmSKvCMwmYuMO82enI0d7QOe97ZmWMm99DiBBeSo0pNra4pjXGU2dJRTLD7fIB8CSILlg2CUGPBTLL0JLQ1IXrbS5vakQgDz6b0ia6kpmKo8rDGDweMUog6M1h6ZNrUV17wn1UYkC10UnFvxrBBKoM9monpDLq2/XKOPpU4xg16+JhcGPEEJAlVbV5Ts69cC5/pMglWc1qtsPIEYneX0K3UniuYMRU1P4jKG0eXfQmuVwA/qHGHMu9ExsSzyxNtsikL9gmA8QnIAm+GFPxhD2eRjzK/0ZGVyVitX7pvuF1jrVODN6zxmZaCyUS2ctDD95LTRkize0fhgMgLGC9nZsCXMzlRcOCdn6zqVWllRGBhFfQ93LS2FFsVm+PeoAJjBWTuda0Eu389b4Y/JBOk6ya26/LXbA/DrAwNdmCL+iSDH3g2n8OB3TU9BXv9btiUZpci9fgVYu6NqzoPxPIZK9WJHtHbBSl9Mo+35eTEh29TLBkE7ebqF/exdqp7sQ9N/H+VgHqSGn+NoR3QwNQBUJZtlOmB7Kg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b4bd9e0b-0044-48cd-1f24-08dab4a36094 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2022 03:05:02.0585 (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: qOAVuw+xh1J3BtNhwa012satT21rnL2eBUPJRm8bJt/3I2YDlESvr+Pn+0DuK50x/RDfTzxQCtdRsghZxTYajbBX0lewdtO8hp/qvviLzmQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4337 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210230018 X-Proofpoint-GUID: CrL2aOsV4ZsXUvLzL-mtoa2858j1TaWh X-Proofpoint-ORIG-GUID: CrL2aOsV4ZsXUvLzL-mtoa2858j1TaWh Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Add some kunit tests for scsi_check_passthrough so we can easily make sure we are hitting the cases it's difficult to replicate in hardware or even scsi_debug. Signed-off-by: Mike Christie --- drivers/scsi/Kconfig | 7 ++ drivers/scsi/scsi_error.c | 4 + drivers/scsi/scsi_error_test.c | 171 +++++++++++++++++++++++++++++++++ 3 files changed, 182 insertions(+) create mode 100644 drivers/scsi/scsi_error_test.c diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index 03e71e3d5e5b..40ddbb691f08 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig @@ -67,6 +67,13 @@ config SCSI_PROC_FS If unsure say Y. +config SCSI_KUNIT_TEST + bool "KUnit tests for SCSI Mid Layer" if !KUNIT_ALL_TESTS + depends on SCSI && KUNIT + default KUNIT_ALL_TESTS + help + Run SCSI Mid Layer's KUnit tests. + comment "SCSI support type (disk, tape, CD-ROM)" depends on SCSI diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 19548a1d69c0..87ab763b7b19 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -2616,3 +2616,7 @@ bool scsi_get_sense_info_fld(const u8 *sense_buffer, int sb_len, } } EXPORT_SYMBOL(scsi_get_sense_info_fld); + +#if defined(CONFIG_SCSI_KUNIT_TEST) +#include "scsi_error_test.c" +#endif diff --git a/drivers/scsi/scsi_error_test.c b/drivers/scsi/scsi_error_test.c new file mode 100644 index 000000000000..23a2e7edc5eb --- /dev/null +++ b/drivers/scsi/scsi_error_test.c @@ -0,0 +1,171 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * KUnit tests for scsi_error.c. + * + * Copyright (C) 2022, Oracle Corporation + */ +#include + +#include +#include + +#define SCSI_TEST_ERROR_MAX_ALLOWED 3 + +static void scsi_test_error_check_passthough(struct kunit *test) +{ + struct scsi_failure multiple_sense_failures[] = { + { + .sense = DATA_PROTECT, + .asc = 0x1, + .ascq = 0x1, + .allowed = 0, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = UNIT_ATTENTION, + .asc = 0x11, + .ascq = 0x0, + .allowed = SCSI_TEST_ERROR_MAX_ALLOWED, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = NOT_READY, + .asc = 0x11, + .ascq = 0x22, + .allowed = SCSI_TEST_ERROR_MAX_ALLOWED, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = ABORTED_COMMAND, + .asc = 0x11, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = SCSI_TEST_ERROR_MAX_ALLOWED, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = HARDWARE_ERROR, + .asc = SCMD_FAILURE_ASC_ANY, + .allowed = SCSI_TEST_ERROR_MAX_ALLOWED, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = ILLEGAL_REQUEST, + .asc = 0x91, + .ascq = 0x36, + .allowed = SCSI_TEST_ERROR_MAX_ALLOWED, + .result = SAM_STAT_CHECK_CONDITION, + }, + {}, + }; + struct scsi_failure retryable_host_failures[] = { + { + .result = DID_TRANSPORT_DISRUPTED << 16, + .allowed = SCSI_TEST_ERROR_MAX_ALLOWED, + }, + { + .result = DID_TIME_OUT << 16, + .allowed = SCSI_TEST_ERROR_MAX_ALLOWED, + }, + {}, + }; + struct scsi_failure any_status_failures[] = { + { + .result = SCMD_FAILURE_STAT_ANY, + .allowed = SCSI_TEST_ERROR_MAX_ALLOWED, + }, + {}, + }; + struct scsi_failure any_sense_failures[] = { + { + .result = SCMD_FAILURE_SENSE_ANY, + .allowed = SCSI_TEST_ERROR_MAX_ALLOWED, + }, + {}, + }; + struct scsi_failure any_failures[] = { + { + .result = SCMD_FAILURE_RESULT_ANY, + .allowed = SCSI_TEST_ERROR_MAX_ALLOWED, + }, + {}, + }; + u8 sense[SCSI_SENSE_BUFFERSIZE] = {}; + struct scsi_cmnd sc = { + .sense_buffer = sense, + .failures = multiple_sense_failures, + }; + int i; + + /* Match end of array */ + scsi_build_sense(&sc, 0, ILLEGAL_REQUEST, 0x91, 0x36); + KUNIT_EXPECT_EQ(test, NEEDS_RETRY, scsi_check_passthrough(&sc)); + /* Basic match in array */ + scsi_build_sense(&sc, 0, UNIT_ATTENTION, 0x11, 0x0); + KUNIT_EXPECT_EQ(test, NEEDS_RETRY, scsi_check_passthrough(&sc)); + /* No matching sense entry */ + scsi_build_sense(&sc, 0, MISCOMPARE, 0x11, 0x11); + KUNIT_EXPECT_EQ(test, SCSI_RETURN_NOT_HANDLED, + scsi_check_passthrough(&sc)); + /* Match using SCMD_FAILURE_ASCQ_ANY */ + scsi_build_sense(&sc, 0, ABORTED_COMMAND, 0x22, 0x22); + KUNIT_EXPECT_EQ(test, SCSI_RETURN_NOT_HANDLED, + scsi_check_passthrough(&sc)); + /* Match using SCMD_FAILURE_ASC_ANY */ + scsi_build_sense(&sc, 0, HARDWARE_ERROR, 0x11, 0x22); + KUNIT_EXPECT_EQ(test, NEEDS_RETRY, scsi_check_passthrough(&sc)); + /* No matching status entry */ + sc.result = SAM_STAT_RESERVATION_CONFLICT; + KUNIT_EXPECT_EQ(test, SCSI_RETURN_NOT_HANDLED, + scsi_check_passthrough(&sc)); + + /* Test hitting allowed limit */ + scsi_build_sense(&sc, 0, NOT_READY, 0x11, 0x22); + for (i = 0; i < SCSI_TEST_ERROR_MAX_ALLOWED; i++) + KUNIT_EXPECT_EQ(test, NEEDS_RETRY, scsi_check_passthrough(&sc)); + KUNIT_EXPECT_EQ(test, SUCCESS, scsi_check_passthrough(&sc)); + + /* Match using SCMD_FAILURE_SENSE_ANY */ + sc.failures = any_sense_failures; + scsi_build_sense(&sc, 0, MEDIUM_ERROR, 0x11, 0x22); + KUNIT_EXPECT_EQ(test, NEEDS_RETRY, scsi_check_passthrough(&sc)); + + /* reset retries so we can retest */ + for (i = 0; i < ARRAY_SIZE(multiple_sense_failures); i++) + multiple_sense_failures[i].retries = 0; + + /* Test no retries allowed */ + sc.failures = multiple_sense_failures; + scsi_build_sense(&sc, 0, DATA_PROTECT, 0x1, 0x1); + KUNIT_EXPECT_EQ(test, SUCCESS, scsi_check_passthrough(&sc)); + + /* No matching host byte entry */ + sc.failures = retryable_host_failures; + sc.result = DID_NO_CONNECT << 16; + KUNIT_EXPECT_EQ(test, SCSI_RETURN_NOT_HANDLED, + scsi_check_passthrough(&sc)); + /* Matching host byte entry */ + sc.result = DID_TIME_OUT << 16; + KUNIT_EXPECT_EQ(test, NEEDS_RETRY, scsi_check_passthrough(&sc)); + + /* Match SCMD_FAILURE_RESULT_ANY */ + sc.failures = any_failures; + sc.result = DID_TRANSPORT_FAILFAST << 16; + KUNIT_EXPECT_EQ(test, NEEDS_RETRY, scsi_check_passthrough(&sc)); + + /* Test any status handling */ + sc.failures = any_status_failures; + sc.result = SAM_STAT_RESERVATION_CONFLICT; + KUNIT_EXPECT_EQ(test, NEEDS_RETRY, scsi_check_passthrough(&sc)); +} + +static struct kunit_case scsi_test_error_cases[] = { + KUNIT_CASE(scsi_test_error_check_passthough), + {}, +}; + +static struct kunit_suite scsi_test_error_suite = { + .name = "scsi_error", + .test_cases = scsi_test_error_cases, +}; + +kunit_test_suite(scsi_test_error_suite);