From patchwork Sun Oct 16 19:59:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 616398 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 ABA18C433FE for ; Sun, 16 Oct 2022 20:06:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229643AbiJPUGR (ORCPT ); Sun, 16 Oct 2022 16:06:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229720AbiJPUGP (ORCPT ); Sun, 16 Oct 2022 16:06:15 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDA0932A92 for ; Sun, 16 Oct 2022 13:06:14 -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 29GK13bO014899; Sun, 16 Oct 2022 20:06:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=YjrAn5VLPkT2+p7vbcDBYRL77YeE9wnvFdg3nj8EpRU=; b=K7l5cLpFtAq8l2ohQfC/4vS6sjgmoeXmZta1aUSyGe0FtPfvXzvtqd4NH1mcGQITAsx3 1Zba5WioRvZnvSLkNHbsejBrxM1j6g6C0wgoASr/48BQU+gf2d7WNoBwPYD9B6Ols2cQ sKah6Q+cAKvNKjpIaBD2zWfEKEU+nAtVqDtLWsuLYXyPM9KNdL9D11mY+F1bZ3gpAOAL 01VY8wMky3oettO51eMQiVBrihBfyZaZ7vZZoFw5zm3vann5SZR7H1mqAWlBiS03fvqi It98jU3cG93X6zXav/cC22bCT8zvZAOpGdlyas2FFuZZpIp1aeKnt/KtoEg1kt8Y7Hph jg== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k7mtyt2g0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:06:07 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 29GCBwgx029658; Sun, 16 Oct 2022 19:59:52 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2174.outbound.protection.outlook.com [104.47.59.174]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hr84hqh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 19:59:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FMhWU46EDsAQfzWJLdEzoWsEmHpfyw5N+J+vzhlEPFljNUkqR3bzAscRczdi10ApgZ3nZ4te46ToQwcL6Wfytl1NblvBuELUb8CDu+/TkG/H9GTEG70J0bgBQIqYKBz0YEyAFXlaDzkdk4k4J2H6buNseH5UpBBlLB7yucinYkXgBw66jcjzChGGI8GxUL5WlnOs4TbOwdRhUzU/opeHLzoJT0zExmrWTGVZPejyNBCnW9DNBRbUBYh9zpvHleBzyfHyWJUd1DT9PbxqHwWX4gGYCbwLSLsz19ZzX+3Yap9Y+3+pI0D2qEEukGjQWxuM8xTrfwKSbnULBWWPHwspIA== 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=Kwb9P3qzWxx8o0RclJPUdTAkQOD+stQTJOxtgySbzbWUu1HZNAqsVc/ULDX2tOyUYyccPIHa5rXBZogx1zN9XOMwVZiKhsZ8w7+njvv0NBFIZeCoVSNbf5Rv6ok7q0gFNN0lPQvMGfV7oN+NdASPYHHFwrRwcwodOHWSVsZo8PklF0bNqpvY/+GJ3POlxmRiKSL+og/SeWBP69+srrrZixOcgS85iSqH09Hpx1x+sI913EhxR3LCSB+ve420HfR5UbyU2MUMaHQSI2dqmajzrgIDCqshF6ou4itayI0mFkhJWSIECpm2XOfwoX5bRmXE7hnyONVPu51BdWIcFFYNeA== 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=WtVARR//Q5moElaqti6+PWzozk2ADCImRIdQUK5EbIenq4ZMIAJwcnzL8FxDuxGRyLk/WFg4tsdgofbKEbHoIT9HNJeFqyVVkXlPWqfMo1iYLvOIPodpVxZvRwzkfGFX/bL8j04o+zx+haIAFut8rKnpHGp2EFn6H2qL4kiN1yQ= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by MN0PR10MB5909.namprd10.prod.outlook.com (2603:10b6:208:3cf::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Sun, 16 Oct 2022 19:59: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.5723.033; Sun, 16 Oct 2022 19:59: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 v4 01/36] scsi: Add helper to prep sense during error handling Date: Sun, 16 Oct 2022 14:59:11 -0500 Message-Id: <20221016195946.7613-2-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR08CA0026.namprd08.prod.outlook.com (2603:10b6:610:33::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_|MN0PR10MB5909:EE_ X-MS-Office365-Filtering-Correlation-Id: af2ad53a-f8d8-48b4-fb26-08daafb0fc42 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jc7FhHWKL0pqTZUUn9ipCJ2nAB5juCiVvpE0DO3WJgjdLRQRCExmUN/IkONF5U2h9IHm75OoA5qcLlRE0WIxmYVBV8T/1gqBsRM1G+KPwZTu/xUyp8F5NDPEb82KK4x1cmN7y0iWLkyj/fZSYTAF9SfRNgnvverVXeKLPEbz1wuwbqcrMuvKdnJ34199EqvxJqV07M8TVOOv6HZZWOy8IwzD9EEjrFJxLi1qFd5MkLQQiCv4uuQtu8pIA/vcIlEhceDGuvRvJzPceurhz7hU6+GrCF2D8uaVgFVcg6g3vNc/ORCncTU4m/gBzBrKw5CTlSi3ew/edtVyL+gcZF2+aJh3fh90kvjrisvlCi/Q5z0O30BgUE5XhntPwhKNTDxnR5SV3oaIHu6yDtg1z46rP3aU/P/ZeJPYVTYyJKZTZNrKIavDZ22BMRIsEmLnfuD/MEcPc6TY5quwegv/Qgmw4iAwhpMWMsa7I+b0tXrdFJjA/L6632q1vEEj7IqGqiAKVcfOblNMMsFSRi+kDNNMGAhhWxuhhu9H4xKuTUoM1z2sCkc2fMqASNOJsyRmGmPalC21nuZ1ZbcLWi3K6xNB1DrV2jvNPq6X6ziZcJxXnae+Y/NsQyF/ieFKe4e2x56PBqhr0itp0GRYdG5fn5nMmz7pnLQKMQU1vVTSb1AmVwuRcaAs+VARiYVKCGfsvyEGAJY/oFlPIO9nKbNK+lYHFA== 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)(39860400002)(366004)(136003)(346002)(376002)(396003)(451199015)(6486002)(316002)(6666004)(478600001)(107886003)(66556008)(66476007)(6512007)(5660300002)(1076003)(186003)(2906002)(8676002)(66946007)(4326008)(6506007)(2616005)(8936002)(41300700001)(26005)(36756003)(83380400001)(38100700002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: er1QHryK2F8TFrOI5IKjkKiHFps6wAbYDSfvH4FCL9FukrSg7vGsyr8k0Ydj6hwoLTl38Y+FQ2ruU/mqQj7kF3y9o5ZakFIXo8l56qEtiKYge26OPvOoscG5cXFuWkFsCV69T0rQc3LOzBGlWn4im0E6hpHOZXtjlZMQjX+gkwQzgdYsWZX8xAdEWjmvdHOUOJMTjT1nmC/Z5zfbZ9QAfguHIJqf4h6W6gkN5Jl1aqe8+Rxg2gnxo1GTw2tIRWY4FEwf2e+LQ7XZKzw0P+47k1pnN8qeSL4mm8gRXTJH7ODXMwkJ4kolZ10d2H6T+LOleoH3rgXOA2DLmIBcZCX+lA+nhDbKQ8Kf1/nX15RR78pwe+H/0MT8ZXCdwsR+v05mtphE9eP2tZfpwnoDzBDWZ04NknjTL/dEeTIx7b7dD3O9zGcL/j92rFQMD83HgbNUI75ZVNkQn/nxrgpUgV7zd+Zt822L4t7vSSVlS3SH4yntOj1OWuqYnIcfvyKDrSEojngu6bV2q4OykHLmRlfeU1b23eob+FRNvN9pXCGpQLmwSGKntLb6TBaqRqxWsJsRyfinDBqv1GAjS0y8HJl12/xF0nBC+Z8Ti2mifDjo41OJarn4FnaC7dvspb+hB34O9Ak8bXRCkQeqwK83vZ8KJ8ZvyBPHiG/8QLw2iGCpL562vKGMp/ayJi+LTN7VkC2cLs/TPxIT7zOgKxUHqLdKjgKHvTvQTnH5UtSFy7CLXC4nVNtVyG+X7T/81Rva/ivgqdNV9q1uaxbpyzzHRMToO2nJqes4B+d7wHReAXALrijPKyUFfKSm3hAZyUoAvazPln+dk+0tDmNW/xzObfUk44ba8XyRaqfm2HLCpyPEzlw7cNQEFSXLQyuy06DavCAAFpro0frzyxIYxRC3DoaHVHq8Mv7xZzFuS2I5jB+LA38eKaBKrzrtJaLryL42sxAW4f9NWawsUOFk2dqUwfesN1pS4DojkLO4Ir0y9FAjSmE1xCLBimb5msMbBP4Wj3W5C/ecnlz0aQLTuhUMXJXf7gi68+K5zXvs7GImpoMchFUJjL1pC56a3KHy7+FNIPodmtAbTxjRa0GvNMdQZwhLePFs9+wRRf6DcYZaKiiEhZWzzicEm4bYoNVcET5YEk15FYGVUUiwPIkT1Oh8LxTRRj/TgCliRJ8QVdkuq+y4MKUkzLt1LP8d3M7UlqDQtHAjj7g/VmqokXpxiSRD9Xh6Q3PHjZrYsIScflWY6acd9L5gGP55ukembZ6d2U/ckYtZU37hqtcGs8SC/wX1op+Zof/v9IYHyblFuwnxy7Kou50XvaM0dn7FhZ7XTiJJhIfkFaD3rWUDM1w/RYGeaS6aH9Sfq+gKtsXFQYEcT26nidyha9JjMKODgAQdx6Auw/TXPYdTfNw6M35PEpDpkp6e+FFr0zFhfAWE1ayYqYfsac35iCzu0DahkRaIcxXFfjwVgEi2izKcmmGkXmRTjevNu7Z+GqyUSjXqEaRo92UxRho15lqkXn0b0Gz1X8Px/YJ/yDcXkS/QhypKRuXQV0VotmtGRjOsW4cNHdmvL2+6jRfF4MAc1NZhBuvWmD+4qeLYSZm+U3T7JrjOz+yYTZYP9w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: af2ad53a-f8d8-48b4-fb26-08daafb0fc42 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 19:59:50.9105 (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: KTb4p64rAT1lqLUjLN1/ecca9uPaGq+Eotfms9EYbsVor6gL1wl+Vf4ERs/b22O973e5gP4I6AY/Uccfwma2p9mWgSP9CB2KIrHUvqubw0Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR10MB5909 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: LqYBA1OwfKMuT-Efb_XAyaNDfbHaXMgM X-Proofpoint-GUID: LqYBA1OwfKMuT-Efb_XAyaNDfbHaXMgM 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 16 19:59:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 615665 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 4CB99C43217 for ; Sun, 16 Oct 2022 20:00:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229832AbiJPUAO (ORCPT ); Sun, 16 Oct 2022 16:00:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229829AbiJPUAK (ORCPT ); Sun, 16 Oct 2022 16:00:10 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62E191EEEE for ; Sun, 16 Oct 2022 13:00:07 -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 29GJ28Bv011941; Sun, 16 Oct 2022 19:59:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=0Ej4Te9PQtTHBmrVwOvaQHo5tIR/TIb/Xlr5oL8pEME=; b=pTsMbJ7V7UUfL80VsMvTeykFcJtVODE0suX41yvC/U5KcTyX2ZLKSSZTyjvFmsuw0195 wvDk38zTfKZdWl88CoZ96GUJZpoC5nXchxy+PiWvJ8e9dCqNO9u1jGABJARMwrSXPDVn u7p/dUmOn3SByrtihWzAWbc9i6JvSVaYs0xDK1oqWoFoRN50XzPor/huCqCgg6tRseVI 3e6wl6OI+2v00LSIW17y2dXlLEa0GzvpjjFsEMr2dmna1wgixduGfzA+1l7hM/F46HBY ZmG/H19AxlTRxONBIirxMgTDbGF1IhDnsUxltTpHErfqFRsHdD2p5wMs3GKEvjmcx/YZ sA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k7mw39yd0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 19:59:56 +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 29GCAa7j001092; Sun, 16 Oct 2022 19:59:55 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2170.outbound.protection.outlook.com [104.47.59.170]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hqwmgfm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 19:59:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m25G0T8rk/fxFBFk+bEYVZNPkF64Wv4IPyswOsyWH5miwDuElY5LaebFVixUXe3xvT4V+EtQiGq8HDcuWR2guNAGRaG5qb1RR+DoT/4p8rkG3vEJd2EcL3YsSaaIv3Jfg12qKAWmsEkoxEDf23fVIqToqCP7Cgq+HwTVFsLBJBo8oEfRGICWIlifLa0GZ99++QugkD0nH+n4mmRS/OeivmPKE5wIzUvGVp3PoGWOVwXALAvR6zKTxZ+iAMuiqcmYj8PrJF2Nz1PzR5RqxXsPb4XdjBkfxSsxgXEC3tdEczN5hkzg+tuO8g5f7v2/clC6Bh0ozFW3zWZ946QUqQ4B3w== 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=0Ej4Te9PQtTHBmrVwOvaQHo5tIR/TIb/Xlr5oL8pEME=; b=Z/EX2k33DiN9eoeojKoQImQLTLJQhxOjya3Ig0m+SEHHHd4IIPxbOIpSVfEXVSRWMkFCaSI+EIdj+73OlDgqGCsws2v86GLwKdu7ykkNzIVj/+s/LR9oIFCXEMhExyCodmvQBMr6Gz8gLzl1DJ2oekMsO9oBCjQngmeXcNdXPTYr6BzXvaj+PO7he7U2EMqxkEIPRAsVvWnezcfQXACQnLAvQTLxYDaPLOgiIiW8uV6prvxemvBGXlYuzYyBwSd9gTWOYTMslcR/tVfgOncYDJUSUP3Ixs+ZaHqFEM582SK6TlsXV1/cSOUqHOM6gqP0gFMpzwMI0cENXPodr6P9sw== 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=0Ej4Te9PQtTHBmrVwOvaQHo5tIR/TIb/Xlr5oL8pEME=; b=o2VKd+tT3EmhS7WbL/WNTL3ElWBjpqJieEJJxsuwdLFopufwwxOWGPacxO33Cz7t+hnDH+EFa0RWuZ6tBjJlPnwtJsZCi7oJSRNNJevuFW/rxMHj7/mfbgQwFifkHr6F7B7O92mj4zd8grWg6BfNz533nOXq7z8jCLjan0FMXxw= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by MN0PR10MB5909.namprd10.prod.outlook.com (2603:10b6:208:3cf::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Sun, 16 Oct 2022 19:59:52 +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.5723.033; Sun, 16 Oct 2022 19:59:52 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 02/36] scsi: Allow passthrough to override what errors to retry Date: Sun, 16 Oct 2022 14:59:12 -0500 Message-Id: <20221016195946.7613-3-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR08CA0026.namprd08.prod.outlook.com (2603:10b6:610:33::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_|MN0PR10MB5909:EE_ X-MS-Office365-Filtering-Correlation-Id: e0a204f7-7b96-4b7e-9872-08daafb0fd6a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /SKGpAbofWwCHlZu+OE1mq4Z3iX2DmGQtn2a/FbhNLqYjv4J99p8RDgGLtr7F2SIdY9iRf8oqvSunKbaIYXyhe1V1HXw8iRAOAra/vWOnG/CTAPBTUMAL9yJDYZKqEMW6O9TzLleoJWaAQ7udPCx5R5p2AhIgq6/dc+18RunnwhZfpGA37qAJ6VT0HTqHMWMrtYyHjhmG6ALJw97cxc3aktT5OwmF74sjA+4cwtxtpKbPBICiMjxhAvRfuZJXMVQqdPmBbfRbAMJhdATIaOhigTslKHo+XEUuz70zgoj83Uyx7c3eLSUc/bBA/JeI506vamK4YEh1m9wVUsC1Xya4l0lMRU3isuzRlpkIzhIyo2qy/Q69Rf11Dk7CrenM0u82oeHRD+AxLDsJllWNo5zlNlET8TycEUoY+D1FcPNpi4pAO7y9imTWtOIgmQVUv19252vVACa7SmGk6bRIEHrmyzQnvmiZzXpYAX/jklybLecJfQE9df4jsk4lZ0EC6WjgOM1KnEUo0/L5jF7o8z6i+TTy8CAaimAHC4wdSUaF9JkBpOjc0S49bTp2I7Pvvx7xmjsQwMBbns6U8TzkXXIRCg/XcZmeiBbT4Qyonx72NlLKMl4GQJ7GyujnLeKiI95vkZIzhmL9pCtxe/s0/VdkhNqgoEpVHof9dq+HfXpkJh1PMX7W00TkkPbLsSDWh46lMpz2UVEvG79xYUId7OttQ== 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)(39860400002)(366004)(136003)(346002)(376002)(396003)(451199015)(6486002)(316002)(6666004)(478600001)(107886003)(66556008)(66476007)(6512007)(5660300002)(1076003)(186003)(2906002)(8676002)(66946007)(4326008)(6506007)(2616005)(8936002)(41300700001)(26005)(36756003)(83380400001)(38100700002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Djfl5CiiR8uIK3dazsimeGCewq5bajuK+N9A3KAD+51fsEhvjp3x5TZUXDAOz21Qhfipk+0jT691g5K8TDPjcJ4vaK6hyRZLelp/74nEht/vFCV9FoGc6jXYT9oV2fzdZGTPz9P3b4eEIa93KYZT2olJ7KzB0WdehCfckEu7NLn+Su+RSclw3ndnTuSUXm5HzxjHqdAxo88Py2S05ZtItG/DQ4amaHzwBJwE2nQ4qJyy/GgAToa5xVhKXKmU6i2czM4W9XRhk77Tprk5bKv7xrS9cprSWaIHwv+s9+5booLVujfhuC0IhMMHh0JsvA+GmzTpz9eIhRhAZ+1pYR53y3UFVVoAvXY+unip3NoJS8Cbq3W5YUHBRT9cBic5WysnksSuu1z40AhdV+1SZavbuVpP9jIU3W953VSDvUvRP1QYWcD7vOck5zZiT73dA+R5D6GVAW9DBCNIRdoGnb6JGoFY3yJPq6EX3Uo/8v7a3DsfAJ2oA4YnjbFN7GqWCc7T+k+rujEspCqDtzGLgFVrfMPgpmg/mmsQ88rl9DeWSOj+YbijXx9KT9tFJzZ9khU97n/t1Xg3nHR7cf0kA+e5vdHr3HeF3CMCzJjWKuLmSEFu2sP7Vt4aWdT46QLTM0aZfQCASpa6+y/xoXLPhTmqHRGuGXih5Em8QINdmCHYGPJb43hGXxvkenncomHYmtY9RvwUli+S8M1Yf3jiYvKRp0IxTo1938MbTMz6HyqWlj5OHwx/n9hpKJ7XDdMj/CyZVE8pT25dR/4/lxYcK/CbmTQeAvEwuLVRGBDHN6nY8FINCuhXoeYeAWzVZ1srvJyJQ9YsUSHxWixEnVjnsyl8GBR0FrLoBVwuFCjrUMO/NAbMplClEd7N/Ua9VyO/Pfa6iG9YxgtY+4p7TtjS9Kw8EOKWUZeEu+q5o83TUCtu+/mbHWNN8dalNK4pz8aNK0F5VfQS6IbEeT1MQmGaC+yYGEe8CuGZfzn6MxFqpb6X4XqDE+ncn21GgGZdCO2ewEwRqnBW9wueJy9gKjk3GVkzicllnGbGYa8nnjc09M5z2ghGRJT9gZc5OaPFteBiNDuHQhZNryzEP/TsM0p15xp2vxgTyy5HnNPnaVFQijr0oT/6MPzH1IwELCpRMHlTg7MFjWlDYTlfvjrHfxBaDBzysBt/xTX+Ai2QfZou6XY/sZhvio36X9qpoCbS00AQaPY7GFCH9A5kJgPXueVG5xNEE/DevWrkweb7dqLbcGL9IB0//Eo4kIbYnvzSYmAZWDsHfLBn2cBo7drOvZWsacY5pANIvR9/mgVNm6EfrYUMRUeUe4L8kkg+G/ur5FTXReAAuBc3v7Szk5wRPvkdY1GrFy8R25dH6lBircHJ5E22etiBVVVwNkAoXcA6rd7uYAWWeOMJn7aDrvzRgHdUhC1s9QbiBzhe+TlJcsK4fo8Z2fKoKyuc5F2hdYnBtn76vP6A7ZIEzDvcnPMXrStV3BuuEAXBPeHPBl6y1CKORc46l7gzl/vKZb3gPso9C8V+Kij/b/Lrab73VVgUK/ISnTMDfNXoz7ermSZzkATh/wkTdaV44QVwyuINbfQgAXrRihu+qUa4b2NmTqGmdl0V4DxeoA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0a204f7-7b96-4b7e-9872-08daafb0fd6a X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 19:59:52.8010 (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: fcb9lSVim161ZF0lgdxrPKBMfGYaKbvI2B1iuNMsVIGHoZeeFJYHPS6Dx97l71DIWZz3WPZ6V5Ogp8DFAWrKay6Khrp0jSVcPqf7tmWgq7w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR10MB5909 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: ropGJ-Gn0xaZx4lkcxCbqMDJnr0SbwDM X-Proofpoint-GUID: ropGJ-Gn0xaZx4lkcxCbqMDJnr0SbwDM 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 | 84 +++++++++++++++++++++++++++++++++++++++ drivers/scsi/scsi_lib.c | 1 + include/scsi/scsi_cmnd.h | 27 ++++++++++++- 3 files changed, 111 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 36ae7cc5e7d9..2aa162406107 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1832,6 +1832,84 @@ 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 erorr 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; + int i; + + if (!scmd->result || !scmd->failures) + return SCSI_RETURN_NOT_HANDLED; + + for (i = 0, failure = &scmd->failures[i]; failure->result; + failure = &scmd->failures[++i]) { + if (failure->result == SCMD_FAILURE_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 +1938,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..c08e083ddab0 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -65,6 +65,24 @@ enum scsi_cmnd_submitter { SUBMITTED_BY_SCSI_RESET_IOCTL = 2, } __packed; +#define SCMD_FAILURE_NONE 0 +#define SCMD_FAILURE_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 +103,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 +350,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 16 19:59:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 616412 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 A3F75C4332F for ; Sun, 16 Oct 2022 20:00:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229851AbiJPUAR (ORCPT ); Sun, 16 Oct 2022 16:00:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229831AbiJPUAK (ORCPT ); Sun, 16 Oct 2022 16:00:10 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55ED6220FD for ; Sun, 16 Oct 2022 13:00:07 -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 29GJXnrK015579; Sun, 16 Oct 2022 19:59:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=bKN/3na6/yeB6BRg9V7tGq/OT9G+2mZyp24rh/u+TKE=; b=hgybD9ni4OjlZZj4/P5Fjcbcn7n8NoB4IrvjShEbCwLNoyfOc1Mjo++RH30Lzd1mKJFJ Q8+nGomniaE7KGilGxxOGt2pplRd5o7tiSt09K0neZts4E1L6RXjyH/KT0cu/uBVNEvB sEycKUNFpV+cX+R5qyXcpGy/L9wOuqavadM0EZVem09ZVDHdKIzZh/gGj9qVVwPc56/R FifRXX8q9FyXFOe6MB0qx60+LqHn0y/cqx6pFvEY5Tkv4UCtJ578b5q7UmNUrs7mpVFy oHUIQAz5oE/xNekZs80hM4yJJJtGNP4vEXmgVj8bGgQmnQkf7CrsjUbtUTqLiibkOFdX xw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k8jt2g79m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 19:59:56 +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 29GCAa7k001092; Sun, 16 Oct 2022 19:59:55 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2170.outbound.protection.outlook.com [104.47.59.170]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hqwmgfm-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 19:59:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SgbY94NAPfXV4svo6Ya0UtFMi6au0OT9C6RROJHJ8SS1Q/Gta9ZPqh7TWiXrN+Dz6rGdvIprejZXrOC9fMGVKy9Z+AltYuzd8Iglzbxou/7g1v19geHDa/anNqxGp0gfY8QA5wUz4UC2XMEn8ze3QuqdRpJzu4S9uhLWBWbco3EH4ooIiX6HaqYZl4EYiPGoeDQaOJFfA13FcdHzH2DrrEs0LyTnr2gPS0I7+MUQ4HucjLjlEhRBvdsJNWWXg5t5VG02WAglpb+uAGCo0b189Sc2itUbGv7y738xowZ0Z2zTttqW+B1CKi74etQwveOPgHEbA73bDj/jgvPnMvabxg== 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=VBYPlr5kygy57BQPGn1sACuKQBb3ThcgEva2Xy8dWHCHNBbqsJ37OE5f18XmBGrGWfKdumgI1PU3B05hNdw/w5SHpNExw9VSmTIHOWLKIiWLoSbGBWiwojmK90SeSfvMJP1HmnPa87UFARlGAzUoEKB1fIqdziXzg5o2ZKwiD/+9eYIf4YTLPwKXsDiq7BVgBrlIacR7GawnHf8MwRM+vS9+KDw2x2VRa+5CsFRHUPjcq/YVGLv+OGfaFOW7MfzlyBdgjNlRC/LpMWmXGygk2TmjAmISYoogY9f1GA3mawWxcA5PIoEcTNDxvw80FsrqOvj4y9U8JxgW8i8uHwrdrw== 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=zAGeaPFbwhqR1S2qhrnQKgA5y4YJIaN4GKxpcmPCn4z0ILonUdBezNRQ3WZYId7QZeLbG3kUgVbHOHvI67KMftk/u27b0MVv7jsGryeVPsBmA6nz+CQzVIPVFXPrEmxu+W/OHlZHeRTDAbzsTyHJ1sO5gKOf/o5HZwOnVO+mJig= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by MN0PR10MB5909.namprd10.prod.outlook.com (2603:10b6:208:3cf::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Sun, 16 Oct 2022 19:59:54 +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.5723.033; Sun, 16 Oct 2022 19:59:54 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 03/36] scsi: Add struct for args to execution functions Date: Sun, 16 Oct 2022 14:59:13 -0500 Message-Id: <20221016195946.7613-4-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR08CA0028.namprd08.prod.outlook.com (2603:10b6:610:5a::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_|MN0PR10MB5909:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a0bdcb6-e7c3-4ecc-00b2-08daafb0fe3a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ul1+Od3FYODAU67JhRk9LC2pOdsAnLeqvlCwQjyTkmWWHKMn6Q+Sp7mbHhxjcWL4yTmP6x4zQ/95PrRw3doQWVF9+2ggmUqdxRWhEVsRKPCYidfU4FEd1/HPwVCg4a6dh50jWH9JPT9OnB2es+ZlY57woVvHHWiFPOVLFNu2H8m/5yHamQmjHANQ9YqdBa2Bz+O7KrfCDWCD90DOtQEoF8cZjHCVMFq6jg2cxwC6fTzk3UZawi1CzQcPgy8u2TJ6xx94Cd2iSm7mFTIm5XM5LotDF9bPnuJi5qO7SHFgMJggUSnifGC7Wsd9/kOcO/zqjnbxqRHSWq7TEZ9Sg4t8Roh6drdXlb2tQB1syJ+Q8Vo4yTveqF6JkS8KBr7cmNHCiWGsnWHNCdRgHGeMrvTi5lOmOvFcnqVlYOl1y2cjFy58PSTATO/v+qqDs5bRUHmqQwtO8jz7L/V2f/yZ+iQlEcLzo8ZJIYtTR1jlfuxDzmcJsVrCuvEuOXI6eZaVwdp8hcNAJoRnGEcln/ccUOmuXQLKGzgg7fz2dNiKJLzDCDgajV1AKnFdO2EK2/Ml1XKbEAMJvie9cUSylpnTcjMN1cYJYKbrp4WK2g1op8Md+kuiSaaprXUPCA7oZLMcC3LNtfPJIVDDLvoZVPEPklcKmtjvg1Ecm1iQEddljRAdnEm1q3nI+nPDVriDsJhYS00gOOLb48Uf0tA1kn+F4SGNYA== 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)(39860400002)(366004)(136003)(346002)(376002)(396003)(451199015)(6486002)(316002)(6666004)(478600001)(107886003)(66556008)(66476007)(6512007)(5660300002)(1076003)(186003)(2906002)(8676002)(66946007)(4326008)(6506007)(2616005)(8936002)(41300700001)(26005)(36756003)(83380400001)(38100700002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0GerLQtULP6+T0le9adGawHaC0DiqqQ2sruNiFQ8anoM8hF1aP3fOtL2c4ETxSdVTBYNCgnmrDu+ADkm4ZAj+8dBB2KYYp/W1ncZp98JvfF56gFWvsA+f9asnBqPIHwg0JQzhEKlowUQzq+EDB0ICb/SbEf5fFv0cfOVEhmjDwaCufkBeOdN+vTpuw8bYCAWC5Xr9950p8PfQknII5V655AzFWigp5NMOtY5BxQIYtWbQEEEiXbFBQM3GdZfMECyY5dAPJ1D3btzDo5QmiJbijoiqo2vNj7HankMmng9VqtThL8QBm748zwJNmEeMHwDHqHS+GmnFqqUlgXzatOFmuZ9GIxSkfUpnz3Fk7G6/rremQfWr6qE9RMBNInNpR2kjzfs8gUcxjfVPWN3CFi8tJ6CVhvMn1TLm5WMSqnbJEBy1B3fINT0iiIvsAh7ceRTg4pb9UUZ7Hef2cwcFoftjtImK948hrye7vfNyGzEuuSH3XX3x0Gg2rDUOyS9juIe4w/sGraXtntXiF4qzh/Fh3PRxKL2hKWOrQF+8l1joRNBcHPSy9IHU0qh0SBU5xq2QVV9G+msY4AL8tqKl4eJqORTlsX1FTfDvlI++odhD/zuhNVZIvs5QCq3WxDZIx3dZQpZfuoT0ri5HNo9Ny5koAPiZakb80KsNR3FDFqv4FZGiKsEkhonwFYG+a10eGGU4y2mk1kIKo2WhB5BWhffafzefZhv8lt9R6X6TLxekzzBwVVAdXoNZY38PwldiHAe+6JiW4+sbf4HsmBcYdPIlxVwBxO5HC2B4xXho7gKbwaTIHpMTQk4CLy8NDCiyY1ilh2y5i/HKA8PSeD4Bj6uUQsgwh1puhgBP39270gBgjrbtIPOWOHlpJhIoPX3bfQg5ZOEju7CTw6oVpTvH4+1nedWYmwneeYpUs+5b+XvPnzXCcGNQjFe+HTKewP2SvCp7rSndrh1lZV+xaoEMu2HKY0fDp0whIquo+NYYpssEKdDdzzOJ/4IYg5jeMwNne2ox3AHPKrBfBf3XXNvFnm1Eq1rzinIOTQIpJjEcYW+Jiqz6ehmDz4g8FHzPWy1OBqsnszTPKg2IOP3j/CBxKt8YPVu2jgGcc47CRjfB/dtfYkz7V1HNQGhFc7nFddUto/Oz0szMTNerFifX5zKGYDaJqkZIcH896ewu2kOdhKWbSE6AWZl5zgJV5xjnMubiw3iX/duYrYbbj3MfoBaJSWzOT6WKXU1s00jPa/ZFQKG4VjwCb7MzL+dmHWytKdPoyN53ridhywyRDl5J0Qi7sR5rhTyPx4uOlUFyYemcQlrE20X/G3sT0M3WHopE3Cfe4WhaJnrqjVxIw/JEV5IAlCBnJTA1ZDA4+g8O6enZ4ckqcHNJPCQMpQQwN/XGit616IlTavLr07I+btNy1jHGarDCXNgSTZoNJNmtTiIOFxULh1FWCZIkE/ugBFW5o/ZCe/BKMsgOejy9ube8BJphyCKS2x7R6oOtfDKkut/Eh22Ctpjd3Y8ckEB+5ZMXg25CQqz7suvmGR30RuRDbH9A0gAz+DlWxKjojWUeuDtTKb40JB9ba3zpRosUYI4sLGtpQoIMCvcWSZEft0ACOJzs3o8nA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a0bdcb6-e7c3-4ecc-00b2-08daafb0fe3a X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 19:59:54.1915 (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: FWZfE9w1yNZRQTO+a8Z47xt73f2cP4jsENhjS0kT4P7vw25oLau7cB2cYX3jOEg2Q6nz/7scxC421NroCttiHQGCX5noGpgx508av/Kf0O8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR10MB5909 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: VrzlRefTBD4OjqV_eR1Fjir2WeLTRJU5 X-Proofpoint-GUID: VrzlRefTBD4OjqV_eR1Fjir2WeLTRJU5 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 16 19:59:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 616413 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 967D1C4332F for ; Sun, 16 Oct 2022 20:00:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229838AbiJPUAN (ORCPT ); Sun, 16 Oct 2022 16:00:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229824AbiJPUAJ (ORCPT ); Sun, 16 Oct 2022 16:00:09 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D05D523391 for ; Sun, 16 Oct 2022 13:00:07 -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 29GJXnrL015579; Sun, 16 Oct 2022 19:59:59 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=OGhTxiY9v6JW2WgzoKOCocP2/KyQHql2ZvPx/lWOO04oFT4Wbb5o7pfRfpb1N8m0pelE D6nW549UueUFf8JpoKpoPQWpNnyI1MdeKJLCeQaoqJyY+6sXxksTiYQ9nn/l5O96NU7Z GjbBm5PvFMl7NPnqqzhpb7G83E6lNa1f1LgnBjUmfpLLpt4FJuA71SLHll338c3oJeXB Ii1qxC1jWy+KIPZ6OpY9ARnDJbieu7cYIJV+E3h56AIKRajQUi25CkZGFe8KNNmGr3QG 69SSUry8HT5GWsUb26g+gpmlBHT2NJKEMM0VmHJh4aFEID7Hwjb3HswBqbQNkXGI6Iy7 Gg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k8jt2g79p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 19:59:59 +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 29GCTMgR040066; Sun, 16 Oct 2022 19:59:58 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2042.outbound.protection.outlook.com [104.47.56.42]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3k8j0nc0ux-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 19:59:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DndOC21TZImkxUDEo7INRv3Ptg8sct06cyzzcXoydajIF/dP7Etqy/o5WNSQBrDDTJdV9HMV1FNwYKeeMjYxX9jPWtpW3xpG8rH3FUG55fi6eEJZM5Dnu+sATawNVuOqKhdafv8yokAfaqO+Yr6DZ6WnpS0pv7JN4Tdy3G4IbEI8Vd41elgyCx0so6stwJxQke/HCHY/gdRwDf+1dCJ0WSxRotOi959Ap/XUbETXp2LRlZ5BOfDN4E06+FLoDXfBfOUVTcswgdiMW6h/3+Ump5JTAhsILGtDQVGhx4j9Gv55cEDb7lN7KKXC00NAV+x4prlIG1wlETcLWuTXlZo5vA== 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=HN/2iCLnV13l9luDDCabTEC5Rv3NT4l1TqV8Bc1QPYNkQa47JMexZ9klY9hvKmLJc3Y3BNH1paMbi7CyrrdUP/N5v9lZ1vkiiScKlSGlaTurTqpEH2OLay6ODufimXM+KmjmmB5QTitsFDB9ZSdUO1JsG3xtTuyx11ENqYRSYT3opleygZxRZ9oMkvjtzfj3WsSrLzby6CjHkMZAVfh4Qv2+VQ97k9ZU6bhDmzBVlTtM4mbvOZd8ZSvEQOthJUPzHY+ZPj64Rdoy4ovAlRVgStNERPzARm79K3dpng6+Aqyj0YFtzqkYOWB9LVh9kKSnvLODXve+si7FbikGUg5PSg== 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=VwPCycBnPn/WNJIsQPHvCsBXb4EkRqE81Cj4zc9huBQ6MMLP9Qt/2GjbctDAXFPU5vz+bu2tDY4teC0iwQV1X6JAHG6EakLNnsRACs+5xVpvZLXpOmv98cIPj2+6aujz0H+hmVYuyslpIqz8QjkIcXSMhTqqe66DL2XdiJ68kME= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6727.namprd10.prod.outlook.com (2603:10b6:8:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 19:59:56 +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.5723.033; Sun, 16 Oct 2022 19:59:55 +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 v4 04/36] scsi: Add scsi_failure field to scsi_exec_args Date: Sun, 16 Oct 2022 14:59:14 -0500 Message-Id: <20221016195946.7613-5-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR15CA0008.namprd15.prod.outlook.com (2603:10b6:610:51::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_|DS0PR10MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: 540bd1ca-35e0-446b-7b46-08daafb0ff1c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VSzYzn2kTRONyBwE3Ijqx2ZvwWMuF6nG0SRNQ7eSub/Ajk5tmbA64N86HRPz/MJhrXCIh9sWav3MAIY2Op945zO7siFXZeOajPmlObmpl/YLb45OyfQk22LmzrOClt0MA2VDmwVMcOkR7QokWSJB/eak2Ykl+OzS27TNKPiBCcSqDk+rgjZUDf3dAybbhisK8IOY+CUwk10fpR13qQ3gGWdSNJk12DlR2PNZf1I1XmuSB9h+KNA8mtPS2Ur86+HDvOoLo/Lwyc9BWGBDx492tY1aQgE1RFaI+FFW0TmtC6XAV3vCZImhe4eNJjINkh7/Tm0t18XJM4XLeXIXfx3aWrQ7Zcx2jIV8/Nr04AHHhy08uziZeYm8mqKc/3pDzz/At8F9n8En4/iOzhjPQAyp1mKfGUjX4H5jrD9kFoHbNyZOi8zc/xZXg/EXU1LYS4ZtTOWLvBeeM9jr/DjHYoBGuI19iDLtvtEwMbhjKpMZi6eHC/PqHCm9GZ7GlGPi8UbRlEFsOliNBwzFyLvmbA/7UrTQc8/dLqRgbFfi9pO6gxLE1Yt3cX6QnfUa+XRlK//aOUZxfXzptp4MlfE/ObmUBfIR302vUh2F/dPUZ3qC4L1qmJRtFT9JWHezSO3AyXuKtl6vz+NQQgezMljOhKNatCk5hRTbJ4TIhmmicxk5vQVQMnqYoAtLrr4zkTzb4/gGSnSn+xriICpeewEFc2/3HQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199015)(38100700002)(478600001)(6486002)(186003)(4326008)(2616005)(36756003)(6506007)(316002)(66476007)(107886003)(66946007)(66556008)(6666004)(1076003)(8676002)(5660300002)(6512007)(2906002)(26005)(8936002)(86362001)(41300700001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Mf4hgJhgwygrL+3PQ029eV6Ndd+liH+wqGEMR1/BSuHZYrAu5519520M/UBh7XZ6r5olQtH45fCxaXuWW5eGMfrhnaT695TY1rLkzgnPI7HVPWW1HgB7kdhK46FvFo7s1+CmcuC4ooBF+ZHUlW49zdkPxYp1OR000EWDnH2tFZAKhjl3mSciFmLCNTln7ERJoDDUkKwFC0VbNa0iEVkxJKYpPe+7AukWIBru8qYzhPpeICvSqdlfXC0T84Fn0AElsClBVC/3QNfu+/o8PEPAOI12uboUj68jafrBpL2DW+jymzTSGJWMevfTYjditCu5RXjsYu0xf2sNcfUJRJkW5H9GkGmznVg177YgGvmCMexHuRmFTk7VwRUSstWF9KvxqGf7fW6v64qf5/PrNUb/8YZWXMGoibzeVLq+L5oyRSfh/26MjbJkfq8sMdFj+5tVNAXfJjFX6Bzj54uglp7eX6jtZ9p9FkhdlzTlrz7bnzk8deJPYg98+WxiHT/E27CG771Y8T2RQFZkXWaoZSpvEEV5tmVmYT7fwAdpgpF0yy+YyR6xY3joEk8niOV9bHaHfx4TMbaD+SdFW6djjvcVlq5GYRtHHlEr0WvcvXXSB3ZBtMRWVHqj8qFeFofgo6Bdhg0FAeajvPggpVQzS64tU4sMVo09noWWXg0t4ZQRJXgY1YNULQbtqmG/NgBxcoWpLqOTuyjM5au7jq+7DwBOaAyOMpViYWjiIklXShazVqtKdKjuYiGoQdQ+iAj5pRjtiKb3tykceOcWQR1DN1hwGia9+zrW13zhRniiv8UFqu1FtCTOGwvLvPjPF0Dn/Ko54T5VENpCifgWB86hqG8bYrVY12tMM6/Mvx/IOVs5IgVVqFF8oIP2nxFRzPvXXrcU0pn+SjQeCYHLLQwxkJg+0KBie55fQES8Mn3lHs/ieveGKc9FZfYroraoL05FgW9LNqnORSpmhRrEPodozuavZhzdxR/3n7EimLMS93/wE3nXL5UJhZGU2ynSPKtOMl3Nn/7us1dU1ZldtrU7o1Gvd47MjD1VppNMF9X/0fI3mM/D5gt418MB0E8vkCiAnVCemkOeZ05jnAH5JcRnUlENfEl0PgapzvXfhE/8RpIeJXygOgZgB4Kykt/G7HlhFhNHK+FyCIyspEmFAoVBhDU0RyWP2iczdMxTHWdxn39JjO+GrtR5A0VkvD7mc/N88v8brnAJ13BS+dkccuN6VHgXYQuuerAiK4VxpLp+64xRbnjPlanBa5e+TvnIHf5eF/B8n7yu+ymq53xapyb3+kOPGMv1P1kY3c8orUvfJWu9x4ZSkj/dagUtbhl8eVlJnHYLLuB2x5tdpk2iY6ZOosmB6cNTKFle2eLKOF2SZ/qbSDO9GkFJfoKgdcdhubT/fZgXF08ejM1hBzEB/5ni6aI/rhjvdvtCQipFXOBaOwQnl9eCNHR3hq7Vg/ujWnNSgZemMsaVqJcte19Y4XviVu6b0mhx9NZk7x1ruifhfV0fLJAU0OT5CXwZrdAUc9/5T5l1CyO/LuljOXvdHsYdOcAHsCRjW7YKYBkrwXZovceQy42FmS2BNB/k5lpkL/L7Ghj0D/uw3lAMj9QSy7WFt9sspQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 540bd1ca-35e0-446b-7b46-08daafb0ff1c X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 19:59:55.6601 (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: /g8OCv7owCiMKG2u/q4vejFu9T8xcKIFvh9sj2QoDOlA2EKKe8dweIz0u8FDOaok+CzjNNfMy32gPIMNQas9duie3/iFNnidblNiP8kL2mM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6727 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: x8yXK7ba0KL7IGuqqI9o9qpAO71wYAbI X-Proofpoint-GUID: x8yXK7ba0KL7IGuqqI9o9qpAO71wYAbI 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 16 19:59:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 615664 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 302DDC433FE for ; Sun, 16 Oct 2022 20:00:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229861AbiJPUAS (ORCPT ); Sun, 16 Oct 2022 16:00:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229833AbiJPUAM (ORCPT ); Sun, 16 Oct 2022 16:00:12 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6376223BD8 for ; Sun, 16 Oct 2022 13:00:08 -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 29GE3cfF014633; Sun, 16 Oct 2022 20:00:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=gLJqvLDnoM2LAwyzuFcx9nVzpbqbINSt3ruS/6SUL1s=; b=mRNLj4vSMuOR1rCIBkdKcazmODqM+n8UKCUs8G1YbBuNSbuuhgGJ7zvoZ0MN11guU9xo DZvHzb5AB/+vcGFKyGoWP9VFbmtxvA6FyTNndQd9m4hiH9OaDvniYfD862QLjaWMd3cd 5e7k0zk+VHiPzKbJN99uh9hHeQA87mf4atiStnIJs1ivLP/TRFSwu86q69Z3qzPsI2x5 je17XMVxduZvyObFCWdm2BfvOgc05brNLTyLqwXuxNe7ILvFisW/BWag4ouYP5Wn7Obs jvOSmNB7nG64ptRBl8vO8v+oll6o/cDXz/BjtO/XeQ2Fmr6D5DvrcPQyHxl86zuACHmL vg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k85mfs5qx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 19:59:59 +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 29GCTMgS040066; Sun, 16 Oct 2022 19:59:59 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2042.outbound.protection.outlook.com [104.47.56.42]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3k8j0nc0ux-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 19:59:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JyUcBX92MR68M3/K7p890mqemUCCenh6cAM8L5Bi47tBz31KPns4RhUABm2RH0MuRK2IdomFKIMAaGpefSK88wqSUMl1YK5DIPm20aSZuuetS1sqD9cM/KAx9OzpbGgr4mQ7MoGRyqSlO9tIyG9hXSTzcZwJoq0Mi9vZdS5N7W0BBS2NH9md2SgqC+uavSCfYA4y3j4ibccO1UK7valZDVxTasdtvqrCU6c4nK1piooGMYPmygHfGwKVhCMniNLh8Ll+y7qLTXldQdLa+TDymjz49JEZXHpRV3pEkyKYWrQUDmnzitNTu+o2XTXRpHJq4NEKeBUIeHuazamox5tiwg== 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=Yz12UWw+tsEtxVNXrm/f4E1dWIGAxbpUuovkMlXf6R+YdNyP5YtBlnnQBM44koPJyGzW/zKrKTaKzXu1h8Ni19QkkvEUGzxCOj4HG7CuqHdA8PfPK+NWbYpfT/Fhy3yrIznOfkRAAzdmgOEtSNRe51u/CxAMicjEV8OTOVNZgj7LnxXoQ1MYuR+tIs1tf/xqkp5YdgOd+LoKJkqlz4+L2La03DhWzyIwBtRRe/+hMHSzJ8mxEInuGtvwgeUJzxqV/jJGHHscxQMBF/AA+YI3TDpZnpGfwyQ9vBxFZslRssP80nSBk2x92Zfa9OL3j2naqd4OAWk21iGZhvHcOstffQ== 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=O9FwnYpPDT/PSN41FOYuMfRnLuUmx5njP9dXvhpUmAPg6RLGuF1t6nje4HP2fMUVMcTVuqQ4lx2LcbnLygbfy3+/I9ZBjCCctyGV+s4fACtacOB7bMYQxSgrItjMGn1QQxpeAUkbPtyN+iY4M5fNS/Dsrevdp30BImEvLIC7H5s= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6727.namprd10.prod.outlook.com (2603:10b6:8:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 19:59:57 +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.5723.033; Sun, 16 Oct 2022 19:59:57 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 05/36] scsi: libata: Convert to scsi_exec_req Date: Sun, 16 Oct 2022 14:59:15 -0500 Message-Id: <20221016195946.7613-6-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR15CA0006.namprd15.prod.outlook.com (2603:10b6:610:51::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_|DS0PR10MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: 7d62e7a2-ae18-4f31-313c-08daafb0fffa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: z2IOQEnjs9DR8TqxBYCrd3TFtaRO3ALGYNR0TAz9M9hzINDMB5SmIlLhHi22z5R7waQQYW2XJezyYEeFa1bg9Z+TUt4K6J3d3M34OfAHIyg/LmpX16i/8OHN6qyDXy7/rVgTUG/8HBfzEk97oC5dpVnzVSiTXD3lrM6fegM9HXMQGSDx38naufLMSf/cZioGDNuIM9gUaISIvUepc+Y6TYWHnkCHgJ5vNY4WSySTlfn9jPOhBgIyCJr/8AKX9jr4cZtUmKwfOY09dFyBxz8qq6VqvaMNe9yrVBbrb/PE6oE+x4m/EtoYzkpyogChVU+AhlJeM0ktYiGiS0Zvz4fb4jDjobm7mWgsST/fHaezXo5zkaOCzukeH5GXnPyExYWEQ1RzCZsjh8+aG/Vol3hhiu5TzMVuKdGxCuE/HSqV85IZmlT9SmI1lXXFZFDdG1wI0Ky9u63mXjftvVzl47hdaxB97jdjBeaHs9+U4mpq1NFn12GEUZcuw0BVzDIGlqXaYssSxdkpPc15WoCYQeUkslCKXo+0sjc5WsUi00bptcSbv1+PW7ydOXJDq3QXI6fooaglqocmrb1lmWUb9avJAcUMgmfq2PGRNBsVHdwE762ydWteVEyrsx7LqCXDGwEWBd7kUHACXUAQxuZ/fczyt1su/IKGqv19jtHQQ6rh0oe8ob2xP/45UZdgAtJv1ECYp0I83pEsDBchhxClE8xcbg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199015)(38100700002)(478600001)(6486002)(186003)(4326008)(2616005)(36756003)(6506007)(316002)(66476007)(107886003)(66946007)(66556008)(6666004)(1076003)(8676002)(5660300002)(6512007)(2906002)(26005)(8936002)(86362001)(41300700001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BVlCUXrPvPd16PAJDK9e2wA4YiFuyzAlftriDWCGXQUXcTixMh+As5hx12881TMCtH/vBCgYmnZpFo0/lMtXEmHPxQKhFAC7Rjr/m7Q/LhpAdOwshfl51rc5hcjKC7tH53WBGw4SeggASvsvkoPLLCYbxXkZkrBdFSDJDJxWbw3caeJJy4SKQOOesrxyMt8rimYA+BA7NYijdFiqqHUhlGxvB2FxkkAikrQ8VccPxwY9WUNe8crofR78AFPDujG5Yk+/heI08I7LBr+2V6a7Y2UPwN2ziNUpga6IbHTDJJitmB9NgOb8Dpj/gTRvevrpLL7dgXmsvrebOTrvYWK0bQ/zJTIcEaLxSeqm/HTAFrhiGYXd/A4+E5WsFJJuDoi7EKGI71Kw1vn4DGCpf3nyKVdvAFuXF6CK7pzu5JobZk1H9J2cQK67g6jAHdeTfnV8fqGf+jfqkSh5/7tnlPpMDKH6X0bilaGC0WkWGd8yPhf+WaYV90i4haPHjlX1LUKhh9lNp5okxh25mkLzCGfdSxkWKdVbf6vIUIGwwTbPcEFxCfQZ94asOpQ8Dwv5qCzbaKn4iEu29kpDBZ7JGymfovVGXDIQOfQxPJgGBHktxdp3q9gni6imfKrM9W7443oZV3rTo/nDyZj+GyZU6DeMb21Fdh/7DlzWiwnDzKMYdsdPKtZOThRUW02JzWpUnNYzB7ZdHLC7UXSP3pqmKJ5K944JC1wvWvzahaH8DQQiooNk4LW2ZvghQ82DgYTw/07ifjlFuHw4nQg83cU1ZIXBa0ECA0BzT96LLcw+2bAV5FQkIClmZgR8cIE1x61HSsIpa6I+vtggJAJFzEjeAaGuFMqMO9yyt9jWaN2ghm+/WV/Rf2xfwO4um6Bbayglg84uHSJ4PJP1nGu0pJFrtkvELyO+aMpx2nP2OCfaQuTxJZMnNNwNpTmpkYG94N5AkIRVa+9s/RKMAx02yL1YEnF52BMKQKsTZmOWEfqf0c5hv1SRJD4Kg6WOm4KE2FEBsLWHONxFrBLrg5L0ulNIDNln+NL1GHSbAY8O5y5nmvDPbzSSt7Jb+9hlAAwKGXBSoP6Y/6HxxR02wIKCBzNstaKLcelxnDxxcM4F+41cPKXm5at5P036W5g9kHIYUWZPK/mzSOWo07FD/QRChUWYKjiSVzLSaQPbKNTbWNGdmoSEQ7hG6eLfso1s4TKzu1zmc1dD++bQ3ctAHKOjD8gCxpR7kukf7XvZcJYzqp0r66Wq07mHIo9kKz4CUCSpxlvWJnEAJgFVRAuH+c1cLxfGMa5ELKy24s6SeZazg+wPupAyhiXm08N1Jm75NgsyZG56d4ac59aovkKU43R9WhUiRQ3h2v+5Th3iBcddj1231qWWHhcZOmQMqgr8vv3RDNj1AXY4y0iPO66F1A49Fdf/Aj3X4F9A59OMos2nFdSwqnORue9XjN5pS1wzIjied0LK4ZcdUJhZqwBq2METU28DiNQFGiQlmacpipXGGdRsEvU3HmOZ5+y5IPrbO0ck1LYkN2fhO2ApsP5JZ2V5ae71SO0ZO9+SKHrQ16MBSWudWKkH1abSen0k3X3WgegCQ+12miDBweqVtfzBPfjWJE6VFb/PlQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d62e7a2-ae18-4f31-313c-08daafb0fffa X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 19:59:57.1287 (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: y2t9NcTk0u5LIMm216j7K+D9RnS5oJ3K6GHN1QTkH3ug0T5fOxqVED/DPqBPEXQKP0RvyIg3n+tRfKjKs1kdfGfABRK9UPGyQBUhvm91s8w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6727 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: hne6fEq_VnlEF9X0leZqxHgygvO6I3qB X-Proofpoint-GUID: hne6fEq_VnlEF9X0leZqxHgygvO6I3qB 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 16 19:59:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 616411 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 6FD88C433FE for ; Sun, 16 Oct 2022 20:00:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229863AbiJPUAU (ORCPT ); Sun, 16 Oct 2022 16:00:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229837AbiJPUAN (ORCPT ); Sun, 16 Oct 2022 16:00:13 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ADAB2409A for ; Sun, 16 Oct 2022 13:00:12 -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 29GJ28Bw011941; Sun, 16 Oct 2022 20:00:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=wx55CpMcerkKOO4XlPesewojj9SabUqzqSEDbSnVQfY=; b=21TPFYgFwCwSwj4esI4UbHdXNiXRnG2jSzFux1kESn8DEKW8sHjTl3TVQa+s8ZkUNKps aLrDG140suDLG3ZBA8WJQTN0d/GYvqy9qqs5O9q74mKwAk9HyQ4geZMMUlRDTcrDBrG9 pYM49m72VLCXgepUIdxZjkzwPiQRPRhGjEPa6O2jyIVmivBiAIIp3yTtRZEAavhAMkxB 64CwKuUpXdd7l2nHk+ZhIhvNffSq2hpRH3kmkC0COYQftSwJb9CRkVaQdrl9xGzALzCW P3Tho7OxqxYcYs//RYAG3lSGJf6u3w24SWlcosdyH/rTr2bmpOFMhZA3Yy6TcfbmAQ+P yA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k7mw39yd4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:01 +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 29GCTlin040878; Sun, 16 Oct 2022 20:00:00 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2040.outbound.protection.outlook.com [104.47.56.40]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3k8j0nc0vu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iwDRczEX2hhJgkhcGnWPIsoYe67UDZINHj6i9jgrpp/Gre7Ylda0XBaYFNHG3Fz2F970sZ92NwuAP7l1ExHiNjMwNnmzhdAnwH8SAq7G6onwvXVZ9h4Z6gMYzvOLXyL4/nLqgtiTO80XXwjfdlyG1SJuz0t4dX/IPfaHH1hULi7ERbaQ1iTIeFfkX3vsBCPg7yM1JDito4pldqWNPNhSoM2YDKVWkQx3DFW70h1IYujFT5KtZmQNybWWP4m8aGvokh3bLb5a19U4mUUpiLFyei1GDaqX8CKhBGjTPkJNVvMYeiriQxpmuFzkphYQMocEXghkU9jvsSb8Ej+ES/gZag== 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=wx55CpMcerkKOO4XlPesewojj9SabUqzqSEDbSnVQfY=; b=WHD2/24aMSHbejOO984iYS4RThN7y+wO4XcO7908tYhelZSKegXqibw2R0xT24B/2r8cmyz0DZTNh1DCYaZ2REQeV2GdgDD2eSGUuBuaUQaTQ0DIGk+B/kKnpcaNJ0w6J8dt3Bc3cT+Pr5u0vG3Crn8SDGb1lM2sqR5RUKKxuVwHfg4ir0Hb+zd9+MYj01DfGq5VpzF/Lz5HZuEwyg+/yMNi5JqjYGZhtfpwQogzN331wqN5WFK6Y9h9cDvtZw6grOqSFF8xxWvZmrTgMP2MS5IwIaWAIHBtLOBX1dECu4/2rt5Mi2mJysfStV4sCXxrl9vHUNUFTn6ZLq4sGfk3nA== 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=wx55CpMcerkKOO4XlPesewojj9SabUqzqSEDbSnVQfY=; b=EMjmk8gyHWL+sxejjH6Ld5uL+NLjO33/BmsEB8qMD8QT+mV8X/auN0brdqCoBfldvMb2B43QSR3dvWVCywDSfLVcapSloTa5+VsNzp6MXMI0PcIFK0cnur9mmoEKWuepyVmZbq9ObZu0/Hvib3jZW2sVaeVvVoS0YWJvMgspXCA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6727.namprd10.prod.outlook.com (2603:10b6:8:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 19:59:58 +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.5723.033; Sun, 16 Oct 2022 19:59:58 +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 v4 06/36] hwmon: drivetemp: Convert to scsi_exec_req Date: Sun, 16 Oct 2022 14:59:16 -0500 Message-Id: <20221016195946.7613-7-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR15CA0004.namprd15.prod.outlook.com (2603:10b6:610:51::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_|DS0PR10MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: 11418e95-b344-4d35-d0b5-08daafb10102 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qnnCuRnG+gg9royOcIC17V0zCQTU9ggsCkyT0vqq5e2dVn8PKincCKoeZeUBPJGXS+dRClkPXZqfzbz8xozGaZQ+ohNG+Pk/nxr1/kTcksHoiNPjnz4YcWguKwkQBxZehhpG/1d5vV8PBU3M+tjk7rk5lS8YrlAr29ffsZX7fC0WScieDfOBBZcNA52laPc6G6liipKYkjylMi9tRkmWzFvItwO8ExtXojQG2MNMCQ+o4P1NdJORuSo4G4+7QiqnBv7cV9/szAANCmet0VuDW96DYhbxwHRD05U+S8VP3pbURYHVY56gCa7JUifekHYlqPq4oTHmaYyhb68LvFDSlstBjqXa9MxjrOlOfNJxAKTAojIthoQhPqPMtua38+sgtXUojh0DMCE+EsiH6oG6LA+AaINJ4+nkJZZem++q8HLgYTQGFZOWb/Ri3fsUHph8lMvA5BDhixltJMjGeYmgTUWLccXb2BLSiw1sD/mV2LrUvxNUOtq9NmigtWchbI1Go2tO3cQqQoPh7tjkdpXFC14rxUAD7d5PuRs48nkvNQyNdnsnj2GRR1JnPJdgRjiyQpE2US6ixT/ROTm4Qp3PNYBFGyUQAphOuS6G2DVGK+r/3CfmmM8TqQVUQqVE9FjF3RizIK7V7Zv+kc/tr8+Ss/XfJrkv/n/QaM34QJ7xWVT95H/DV8NPFWn3TE0+OyBwaQKzVrKmwtnp7CFmFsCZZA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199015)(38100700002)(478600001)(6486002)(186003)(4326008)(2616005)(36756003)(6506007)(316002)(66476007)(107886003)(66946007)(66556008)(6666004)(1076003)(8676002)(5660300002)(6512007)(2906002)(26005)(8936002)(86362001)(41300700001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LN9v4yrrTyg9XW7Uoyhdjm18Zc4Kf/qCPZoJ+pCIr+nqDVDi8KjIuZ9ht6ic9hUBh99iSD1FMO29WVpdYiXzU3GAyUYhVxJpFcmryp8bawewtD9z50gIjCGpZoFfTr+rW+6wctlgeefDKgQ0OcabA7ZU8IyHVtWNzDvS7F1ek28BH0ISjGkqR/5RDvmxI+S/4d0beS1susk8hNjvn9N6y48eC2lLJQI6MELuvrv9FzS6/YIyBX7KbcaiicF19erU8ybOM6V5vWpcVi7DSLgGtcw+aC1pm7Z2XQb6DBq5QB2d0Db3FkKXIa1fShkk2s0L/Kgdj6EWuhC8z8DiXpgbXeH0ac89yvo9QToURneQc8+xmEhY2RwchcX4+DHcbOHNPle6M11fhOapWglh51cmh6mCRInDAUstuzDZnCcp/ra8puzNfetGnOlGDpTP3nHEzwUKxcj5qyRW+to6G70WjY6Ixv3yZ4MPmU+M6NjjFW1UU0tyz619fgmggp4oYVxY1gUWobPxF9VW/sijjlLO95XT7sI8C/lO1XxM+z731PJOuPPcEQLA5sPTkAORaFx4eE003dwVRCkDTdSfujc6OFgA2tcTzjeLIx+fD+ak6qkezyEoOPZZAWRcBhfRyoPsKzcImtUZ4zzyfOiHFp3rYD9+la/7uCoofF5O1miDeJWFaln72wkVvudXnRM2uCHjJ79Czc2ZyGsofiZpsItef2aMuCBlihkVWr2luaSD2QiqLL1lHGWXjpakosQu0Gk1w2qfPaI91rVlJKiopDrWhwMgTrMgzfZH+4tTm+KLNAkW8H60tenYJTfZOt3aOhZTKrc+XcrjYMjH8lMu2vcznDOCnZtQ6AVZxlnd36sEeBZ5xOf9QLd9w8TGW0wwV8EQcCvAcbrQwX1lyOQnHY5zd+EL9RPzQxlzwI4lNXSLjd4TkncafsCdfsn6hlwagGv6rRgnx92txYCOxAbGiW4QRMjCoqqvbiLZPj/752juNIzPvQX0nxqWbr4IHGhAMKq7MeycdE64uAwBtAUrnxIUqmxg9PbZg67/JOFzxyS21bIyOcp3Z4+NzDnnpE3+EwCpnJ9rViL7lSgwSfyieOskknXNVl3DNsIR43ucrS0oymE/q8d2vwA6tfChTDC0dJ8JfXdJR6yUWEAUO6IioivRoQ6iRiyNEQ6GOxjrruZYbzoxIrykJWG7rDhiXA2INGs/fbdCoft5w+ZPufw0y0+bjMlgutfNa/QgOcOMgCyzHOyiq+HdrphZ3ngoApxolNBwoB7farfsAXUFcmn+ZSnz0/CDJ7paUryN6hik8nQb/VeUyWPEVzjEnvtAPi6HoeOZ7VK7Z0z9PS5dLl80CaInn1VpokbAFZFJXzEotNB6CntSAFzYkUzRrBdydPLF0xrGyVFiS8FwEAgk+WdN1ZvW6jJsmtUAIuRcr4M/Xgpn2TUc2R7J9pQSiKDrEmVQfIQbMicNnQzQcG0yuQoUChKsS4X+CO0UgRuajtVySwfd6X6cLLwgCpLPa9b7zogjf9IeLO5U76bQtTeJKo4pvdjZ8+eEc5ckmrUaIQf0WVYVsu7BgiKdcKddB4X2VG5L5M2kgJEM24+bn6NxOOzHDMeawg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11418e95-b344-4d35-d0b5-08daafb10102 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 19:59:58.8786 (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: talELjnCfLkJB/gR153lCLbsfSVjma9cxmqFY3LUH0z+f6w83LoMpV9puvn8jOAN69uB36p9c8zYId/vW4rElf93PDJElC+y9FeDPjmjouk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6727 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: _B1MAXabBsiydrmWOJcr-E8cLLKFsyWb X-Proofpoint-GUID: _B1MAXabBsiydrmWOJcr-E8cLLKFsyWb 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 16 19:59:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 616409 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 41592C43217 for ; Sun, 16 Oct 2022 20:00:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229889AbiJPUAb (ORCPT ); Sun, 16 Oct 2022 16:00:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbiJPUAQ (ORCPT ); Sun, 16 Oct 2022 16:00:16 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BEB023EB3 for ; Sun, 16 Oct 2022 13:00:15 -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 29GJ20ux011562; Sun, 16 Oct 2022 20:00:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=mLO3Spkew+E+i1LsX8SIRp5psan2Y90s9P0m1HdmK0U=; b=BQzPFz2WNk9uwVVH9q3Ta3775jGadtp0eGetWzyH2VPEzmamJqgtB/vG+yKztDJ3uyA+ KkFMgMFkn7+h56DzZMyPxyW+W0wWZ1US5LdH3gPZJ1ssFPy/h740uBGHmMz3kbwbVeg6 +o1YXGujjV+NldEKvZWdA2K2MpJA92NxEa7UWvghXA7yeT4dtvVhkBYHyFKewL04iiFR /pxBQxL4/PAKasx63ER00sbMNQXeeKKQesq+XEbjpjT44MIUDMklrQksBJdz3laZ2ui+ VyPTXq926K/mVkIQY+oZvgb3sNNMOGuoGB//wpr1dG4BYFhkDFpAhJKhY59fNI3F23ak 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 3k7mw39ydb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:07 +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 29GCAneF001181; Sun, 16 Oct 2022 20:00:06 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2045.outbound.protection.outlook.com [104.47.56.45]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hqwmgmf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eeT9TCNgbWhdXDpZ8nR0ojzMTwMHK/xfBy5fQ3sSU2yUibDK7pMxKeNx3AGpQftIqnDrhQnK2hWRwHwuaSqwdltKeVIwahFxu7KzdbbR/KX/q/Pj71fP4AHHIjiKTG59SSANLT2CBZrsWcF+srMxTDlKZLaXj8vozCGFuRvy5tOnQfGuUMkgdQxS8s9BQx+u2HtpIfhZ6zlMbML8t2J0NmrLofgmteYJkXyAmz8PpYscraikVPIUS9nXKrv+134aT+xGnTIjoP+zNmXiqqVe/5+zb7Gc8PGq9IO88RG+ZxtkuOPJEhyQNXhponePMr0stEmYfKscay6NSpUmy6VWhA== 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=cnlATWfqfdrV5w8xcfJoFfQIdCvMgeq2eO42/+dPD0UPrO+3MdCysG1MWvnHsqunW8dEFWChYN97ThWNJ2AyQS3XkGD/xeaHq7Y7yYgvMrUFTosaunShG8xPentqUs3iJCdXv5wGci8PI1TqZvUwo4o1fYrxYCRoo7uhggD/nUsz0fC61ETTGnQ73JtmTn9361+e+H23/bMXiY2CCFKdI3kfYK9bmrd5aKFe3XZaNQ5JLf0U9FXp7hIJqjuc2KEAJbbOkz0ZmDkcMCPn0+64zPv2deTScgziaxlFReqT9YYNPYpbTr51SkTdx0RtHn5ArRkJOvn4B0OwXh+6OaO+ww== 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=bGqMuq/9Uhr21ycShyBe/vO1+B473I/Ia9SunQtHhrhaY2FZiSU3ETUxRNamRFgIntenXwfOQs6uXifKaZH7RbBeq4appPrHZWTIAYgKfbYviDj62A/p401iROu+e3TlYHmh/veSNjP7qhbR5ADaHf2uWn91c7NpA5vMs+K53DE= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6727.namprd10.prod.outlook.com (2603:10b6:8:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 20:00:00 +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.5723.033; Sun, 16 Oct 2022 20:00:00 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 07/36] scsi: ch: Convert to scsi_exec_req Date: Sun, 16 Oct 2022 14:59:17 -0500 Message-Id: <20221016195946.7613-8-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR15CA0003.namprd15.prod.outlook.com (2603:10b6:610:51::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_|DS0PR10MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: 25d5bb1e-ca42-4d44-c223-08daafb101db X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xTYEyEf2cKo3G8KQuT6p+z3uUhBm0mzKiTaTgWxcC8KBsqlJCSNi9LeRe3KqpTJteoT5MxwiBH6sEPkf1oA1NWpTvoaDWvxHSnQiYCQndbW1s4hrNXyFuvdrX6KJe7WtuZVPtr1YrtKQMgOSEZIHFXlg+W/s0l+dXL4/FVBw2S3Zybk2eB+Rg0BcawwKzAbB1xnPK/qwRvE4xDEgz3tzmMRIB7ur4hJ/Htodxrmdv3DRXCh9lGG2bdhxKAt7ofQ7Yit/hVrALvNDtQEJ74L8NoquBFKpBth3siLFvujFFjrQpYLOM2PGq9dSPlKst97VhaZ4WO5OD0wl0YLSyXoGI4uFd0P0I29AxdY/0gJeY3RKj2ydHaDnwfLRXGfmcAiHfhxcyIPx/EU3uHcmJtftajhzDNT5XumNwgKczKPaK3+bzLedKopoDZvTQrZlCnaf+vDmleA7pY5M87aY5UhFf2z6GvkcnBT27YnZ98cQsX2LZVidGIg2PtdOWV5aw/Yb3ClUv4cQIzB4jbcSst8TrpMapNHhSWdv+A3IIaB6Hh88/3AIdzLO7mczQLL8Qywsopv/8hevSqCnQsFPYNpiJphTl1bx6O0JOkLWZWEDeo9X2CicXUhofzkXEN6Vx8RjtozIXZcVOM/29fzyEzXZDlw7WDZsue9IADFvUzKfYgl7uxBBVcGvWjiW/PtiSo9z7yOno+/E+pLsXk4KHWk2Dg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199015)(38100700002)(478600001)(6486002)(186003)(4326008)(2616005)(36756003)(6506007)(316002)(66476007)(107886003)(66946007)(66556008)(6666004)(1076003)(8676002)(5660300002)(6512007)(2906002)(26005)(8936002)(86362001)(41300700001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xowOSyT0dwE5ayMzv6zwBg/TcmB2La28BE6AJZJcWMRPWeAC362niWnjU68IYe2SgdlFPFRuHHLwY/vmARsQ1UyJ1Hw1eAYDFoPmX2o2Q6DYcZQq/ZRM1I/zIrlO30a2oO+MhEZm0BH1W2POP5Sh+UrTyDmEmSKiIJQdD6/WkGhYBQtRzd9hf0/hKgXSy8soAwLxbSgZNDSjsot2h3T5pEmMjzoA4CZIAWeXdYdhDKxWml15rWszkdSiI3yH6RaD3vRfvfqIAM63nNMP49/AXUM8WhapkOnHRYbqIEw1F1CuV6U0/G/w87tfomvsMRCQ9LNYVWfgfqDLAsUxgxk1imI7VmP8Xw6xAY0Wttnb1eirxMseulQEMvxboZkH8ssORHVqG/vi7YG28AvxugVMtYNKiwPkDMpZ4OEOCYJUXp5m5rvV+ucnN/6aOtNsg1aDvJ7meoUgueP3Tff7RkjoY78vemvcXeUsPfITKXAWXEz2bJXZOaleOwFUWrPWY1LNeUWQVYSAhRBr5zLyHCM4vpBh4CEI/CzY0kcjCAoX42b9UuTHC+/xaIjrs7UPTXsRM2Tak8H7IWI/SYW+n9gvrvOgsGZyW1wJYe5B1QNWVx4WXTHgG2KJT6Jf0Vl2RCcIIqqQ98Dd7J/bu7FrZhvoqvbLQ7BGAT4bFFEHa0HmFC0GVwk0xWS43BC0R0QPJKuHFKIMORzrYT36DwFmc0cvlxl8sVG0eamhjQ9QsAMuJvU2zYImf7z6Cka1pZ5b5gsGEQU3tdDqAJ5uJl58MRX/b7e6atErmHJelfMWwlk6RqpBj3KN/Qta9Bdw7B4lIzDzYhpHM8xAsnPUEJuJNLK2DY9gQkrAPFMUCtK3dhMn+yvVwGzSttl4tCT1kZYG6j221hABvzntEhTl8egCZdTN1IEgHXK0wVK2GHF/55LQpxcd+qdj8hJH0Lz7Hrhq+W063xAbESgAbFTWRolWCTdBSqJPWPh44SckUevAhbdc3MZcqDZTsAQgiiIZSm/m38qd1pVlKo7OMaC2HlcP+MnGHLp5svYz+Icrd0Cl5Ljnx/bd3zLsbEOuuWG8dKI7pyAZAu0sBpItkT5iW6kGxMlItXGV9Sn3/DHIHguJ49L+2uGmgLcVK+pzHUIC7oS/lc6UuUBmpCN2sA3m5tXMoEy0cpokC+qO+vgWBP1gtTLtAQnewLgJUX0YCipK7ZElz5+BXdPWyeTCyi+vhyrXdxxEgfk0aS3ayHpHVOwpRUOh6J7Kx58cw0NJbhl1Pavnv/J3qtimLBi6tSCpqaroKHPMkzzHkcRbZBz2LKZsbakOlOOQfwWxnU+fnz2rMRzweOojSkfTFiHdECV9zAciQBOb0twNzp+9d7bDJvJKpnEWBv1f2kw1cCaj361LmU7D4wsqacOUJ/2d7kKdMmnBUpFjdwuLbZ4Xg1kQhVpbeTV9krCz4v/O/ebm1aipXTQC7tt8hJosVYO86e86t7aZWZM7VftttiMny475fjHX+ZJKM1iB6Gdcy4LemveCyNXKERpavQqu0toMhX+jQCeMt6Yegaa4iKNu+7aAzwIMCAmU4MJMVIrNdmsHKjlMcOziDPRKZwkXnfZ+NQxnM9aG4301dw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 25d5bb1e-ca42-4d44-c223-08daafb101db X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:00.2691 (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: VAZf9T0UdMQMQlS12XTZaiRMrBmtaV5jeOQZmvUYzp3Iv14BOFSxZiDX5j0a9CPHe0NQQyuISRWW+YJ26+Xqj5ly7HTxFyJmymyK6aSXIGg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6727 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: mqjdPPzFaZm_wmgcr31CjQVeWyowQXJe X-Proofpoint-GUID: mqjdPPzFaZm_wmgcr31CjQVeWyowQXJe 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 16 19:59:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 616410 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 DDB52C433FE for ; Sun, 16 Oct 2022 20:00:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229886AbiJPUA1 (ORCPT ); Sun, 16 Oct 2022 16:00:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229831AbiJPUAR (ORCPT ); Sun, 16 Oct 2022 16:00:17 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B9C624BEB for ; Sun, 16 Oct 2022 13:00:16 -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 29GJlr1W004935; Sun, 16 Oct 2022 20:00:08 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=GUozCluTPRkFo380I6aBidznBAGjTzR4MDHNfAOXYuPL5jvsIvI8HMoN3HLYcAFNOND1 0svBPP/qGuws3CQVmyX1+MV9P4GMH028Eck3FXIkadcuyctX8woJLeSaEdBV2ITVkBYT Lb4QDn4uktuEoVax8cX9tteLFtphyXsxSqm+fyRQL8kYF+h0P427xsQwonRkUyupBERY 26blIMg75jnN3dCrrElyblu4T9ikM2RjIDPAbFSFknIYVm2VU6h+Dh4jRrgdmJR6aXk4 rzH2gyPZaeXTVDEY3ra5H/2XNQDb2Ej4uqIMV+F3HA2Wq7SAzZFgO1G6Ejm6SRi4P4Vs Vw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k8jt2g7a1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:08 +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 29GCAneG001181; Sun, 16 Oct 2022 20:00:07 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2045.outbound.protection.outlook.com [104.47.56.45]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hqwmgmf-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P/0Jx2CU6m2XWZBKSWv7vAni1xn6hkzqx71Nc8bZ0KYCHSoQSZBKEsaHEuO09Od7QYJMwKGMoEt5ZsZT4VLWpmEyIlmD5QVu/7euIuTbVw1Pjh6/9demGaQNxL0dBfjZb3Pt4QPKVNQjjFltCJBsr2KPjcRoAPhTL2zn6v630QLg5u/5NpYBavZfTmw+JldmMilRoyfQe4hVY1WmgQRYqihKfOZOmz0uY4cnBt5vP2bXGXwdfKEJk2+prOn/hz/Yp101bByjAF82uCpOGVdSZQS9lK4tOEe/3GNRy7P7Y9/zKWIQA0G92J9llbB+QP9zL6B4nVK1M+t3jAzb5eEKXg== 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=cm9RXLbA//5mY5jobSA5PWm3To4Gedlsly/OxqJV0hu9aNjUL64Ea+WKPd7jIQ74cYQB+IX6TY7vqjK56lXgncx6r9eBlbVGXUWLKFy/BvixvfHQQjc73tV/L2bfFAfKgJ+Rc1YBxCJRD9LQkm+ZY33Bet59pM7SagIr6gTd0+mrS8EA78zCIDDMcOcdfIpjKOC/z52IPmlF3ULTaVt17jZdSHViLMNRPIFsxa3rijGNwQubbvktTfpjCZd9EsXoH3W1xi4QllPrnJwF6+qIRrjR371kq0/TjQkvFzp0flhqGraHBVZ/OD0CwylzQCYqn8mLWH2rOPyYbX6PZE+UMQ== 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=Zvc1yVe4EueZ94MYJxSJPlrRTlZaa4bl2Cv6nJKdMCQM1/ml4FtX+0SSPl1nUbtCQf9P8oOmx2P112ihZX53duG4rpyFT2WW3rpyAqMci0I+LL3H1GqeiwjpkPbWvbvz6JG+d72uJq9xHJSCgsN9cekT5udgx5EDeyntNT4OcWM= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6727.namprd10.prod.outlook.com (2603:10b6:8:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 20:00:02 +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.5723.033; Sun, 16 Oct 2022 20:00:02 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 08/36] scsi: scsi_dh: Convert to scsi_exec_req Date: Sun, 16 Oct 2022 14:59:18 -0500 Message-Id: <20221016195946.7613-9-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-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_|DS0PR10MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: d196c8cc-2c7b-4e7c-4d0b-08daafb102f0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IuERFHpG4NOSWrjeMrBPS8s87kqAdiqH9kXLCuryeUmS7vz5cC5uyU3NaJO7+dG/YJ6HeZgip7EUtysDRa511Z1XqLKYDtNNc1j9iDIHQiiTQGEjTFPstqrKlnBLZGsvzha2qy4Mn01gTOchkExke3yeWelYaPo4uoHB/ZMhaFebDf6m0dlftTI85NQHsvHKgRC4YmBE+UI8uV4wI7pZBuelO44RG8Ar0RZgJ3jGrAHXSyaNDXu8tn0RDm2Zj1ZiVCqtHkc8Ft88sDFfCYa4U1ZNrOn66MPrzsYqHnf62/aWKbvh82osAxaDEyeYE3klmJXjn1uf5EMgyoczDpMIsgZythqOJrS7rJnsOmcqDgqM1lnm5GTwNhOZJ3CL6c2ikoNq1klJX7p1nk+QpRSWkmswC1IDWhQ84s3SxU+LZvIyhubaUgIdcwb07slx7qMr8NSQ5vNm2mJ88HDkmGWCid53xy/AwYNMzvYFDo0hZYxvnhorVsrCN2uO5stzJEb0nUteKJX6dj1sBv4DxRtx3AqoqyO5u0vqYGCjHswsfXbBwH3yn2mKeECrQVDWAqhYtRVSyl/iw4liz4VjjQGn9Kcv7NsqEaOYnAHoXYKQdIiEL2U6xvquX9m6+nMHTzs9XNC/7PILfS9LeYpzQcRLC2faevaYFS9Z1rJJkozLbnSKb4brqfiy+mEpaXiu4lCVbVzfh6ErM03hjUf2m6LM5Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199015)(38100700002)(478600001)(6486002)(186003)(4326008)(2616005)(36756003)(6506007)(316002)(66476007)(107886003)(66946007)(66556008)(6666004)(1076003)(8676002)(5660300002)(6512007)(2906002)(26005)(8936002)(86362001)(41300700001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xdD4RE35dtrNStlg+dW3Ub/RS07AklsH2atlgnavJtPeh/eQtyjLpiGyHteycrtNZ0zA5uXmuliqT/aK0L5Fp2Y4J2cy81yJ87IkpQvx1xD1u9RHVoanAV0bQBzw4cn+DC15nJJzaQmpuY3XCdu8zoioqV+Pxbl/SiRXu/96Zej2L5R+R67rspcvir7D3vC0YMED23Xl3yRDnZFJKQ8xJ5AIJW7EtXRSENgnuUk0ratOI9tMsor+CmYsv28JKKjvd0hdi25tTVjXi/JyWnwGeMkXQmzsGp5LUl2piNQGk1AOCL/A4L9f1D6/sQvsHa6i+DHxDYMsT94gbzTNseZD45ur8z0LK74FUnqS39f20+7hz2l/AP/WnK1fdaYJFFkSjDDjDAs6nK4XQXDO/TKjmE3WbSNZgxFn4edzFpHwFrB1cZd40adwNnV9CExa/Iv/mra05+MVVAlmrUSUNlNeRECWUWtqxbTsLSqNjiajA2zYMAvOGlereOQu138qgMafW1lnPvFsEmPyXfX8u3xx6mj5K8Ug1pGi1nvCs6o7bji/dBmGOubgpQuIO6t64qDK5TERpUZQxeei7lHq7uftP/9UjA8/euCLkIEP8X5rhUBO4OzAuU5Q0dVJy4i7JSGZSuEC8tXOyuQpzT/nJrM19n5n3myogD5G9FPYuh+mw9bpVZQiE31OdvBDJgbbT0tWewLqpyEUEjQkW1I9+C1YCqDHHNwP/JfsY/EqIP1lIiWCxgk68Lj2ZP/pq2wcj3V00zOOf4RnBGWJeCEUkoquJu3Z/cG8P7cSc0TkCL7GRoOiZeNsDBkCqB7jgfVpwDbRlxTG/dnBNlJAQkgqy852OyQBAnGasNTaAzx5Qhgq4hZRTbBrx0caLXNQ80VF47rgbBW88axa7v1AOWSkzHIxxNVmmUuNv/kzldJ3k1Nbc4nYtniDll63CNrWRoIIXHVQOmChE1uuywflluoyed+EEQrzf5NIJseVse5KhCKvk/8ZKb3ApRAXRXzUGuGuJjpW4gdcvNLaDoUlcq0xFHAv7cevalIxc/HYuUegdxI8M+Wtv5hGNCXga2jF/qEIWfmCPQXrwBdSb4w5GcD7MTwN7W+FFPHDMXVdqB3sL3Sfs9TAS8CVVLl8/BN+RxvHKipw+6nsIeqkbacO4Ljrg4TMZycXpwTYBazSQfi6xe/Hvee8JX60IkMln6LYJaSpG72V8Ug0AdktT9mLSPXfXPy/l57BX/d619fOnJdLynjoGGpXFpBdNbmRTv5eXlLQnh+XNhGTBSQnqbt5PuZsOr+P8wvV1lkFkBwLGaf+n45vRpiOwnA9GHheAzR8PfST1S8lYfN6+OORAjIva19rIyYAovFind7juAfltfunJQHjJXVjeIveOw1x4dnkVl3dG42afjD9kpqgtfMqUEXumhIKbMxvqJu5Fz7F0BUks1fpTgNSTrArTfnY++4LNXkPb3t8yDzpr4f35786VH4drj2FQJLs6SbRbHzmimCDvq994j795YAE64n4yOJretMkDMvXn3sy8caOdvmYsJhzr+Bj+GwJ/nmvFsYJKOFyZqNp83HL3FpdDtrP7SHE2LEgPrF53TTeomsWtSmOb4GHN60Rhw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d196c8cc-2c7b-4e7c-4d0b-08daafb102f0 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:02.0815 (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: j4xKsKZIQDUww0lgZ72CNd+psCwjCfpsQZDe+nwevBeIEzsWrmG1NzC5H4rLYLBgh7uA4tOEqXfAAZ+oFnlCiCJAWouaVzfatBQ792siOR0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6727 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: B9ep5B2JWfe3M8_82CaFmitE53bi2U13 X-Proofpoint-GUID: B9ep5B2JWfe3M8_82CaFmitE53bi2U13 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 16 19:59:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 615663 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 0B363C433FE for ; Sun, 16 Oct 2022 20:00:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229883AbiJPUAY (ORCPT ); Sun, 16 Oct 2022 16:00:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229847AbiJPUAQ (ORCPT ); Sun, 16 Oct 2022 16:00:16 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4560724083 for ; Sun, 16 Oct 2022 13:00:15 -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 29GJ231g011591; Sun, 16 Oct 2022 20:00:08 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=GDEgeH0mLo5joGYfl3ZRqdq7omdMhaVc4LO9/zQb9swSbs2CQNOYfHByoIA2w4liYLpv 8oYU1dPu89oyrOfYVisM73CFG7Vs5PIXHGkyB6gBd49vdo5pFFftHoSSf6Hz7RRR5eaf mN7t9nfA0cblkV0Te1vYxsyE2g2hqTH6PU0YXmdm6SWlcDY7/3osViwYIQC/hZf0YTs9 Vo3z7ju29ltCGWAd25jPNPJU0SJHfqKankNl5JGuj/PP+XrEbQk4wC0QPObmjZSKNEu+ fMYjVK83M14CcYYHYLaLbp1Yh+qoZs2k29YvSuGxg+HNm6SbtsNL6mUo3u1QudM3clFb VA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k7mw39ydc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:08 +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 29GCAneH001181; Sun, 16 Oct 2022 20:00:07 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2045.outbound.protection.outlook.com [104.47.56.45]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hqwmgmf-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P096T1IiySh2arWCr5ZFYaxyEuinDcRak+g7OhhP9MBjYuQtLeXT2xoMzbgYeKxyUrmoxZdmRzMaEw/nD3AHVjlenrI8QSBf+coktZP+Uz5db0YGMRSO8CyAOzYl3vcmPIsSqrmMzLPDPRWmz3s5W1/aOLk1Lcu5WNvyjtZnjoFSXfHYdUCCip3icDyGywurxoFk1ev9PCN1Ydv5VpJZRjTAFAaVBW5GCMqlUFiGJzngSjksTkLgn8lL6KwX+y1vRh9WBFv7QtT/Lr1zu4BvlrDjBW+QoKjTKdM+yHLMEcfo9jB8cvzMIS84l2kfobOEfX9dtGvywMSfVF1+IHTNGg== 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=FCqPstivTW3HgTBpeGWs+IYzr+9b479ZxQpsUa+q9DjpiJHtEq99gFe32weJLospScsXU+52C3Aq0KCOrxykln+nKCu6qbSrdmQSPcPeoHpIdDpUdSPMJw7PvKHdYm0V+Rkv7GNZDjsAGBp+CWq1Jnwp3ptP0mDgPi1IXKXK3w6ww3whoin9A8jawid3/B2NyGkqs/ky08Gk58kgzS8YtwOOHaE9oYgVtvUyuMso/wNHgSEQHy6ZYHOmDEicYMWxcp3of0vsftgeDySFNirwzXiNgmOC+qhkv6WLWiKBJASPlVPWZGAWv9pLebuFG5PtoZGrih+wFW+B1tX3dTS3AQ== 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=XpbXhxLJjvSC9jjnchDtWh4dgjfClW++RqDsCsHzLxbUMTKmbGms21xb9awpR7y1wXpmWTrVAju3cQhuJWOqk87SaQfzKJdSUasg28JS8oQnxqmAaEl2Vr/jT2iUBKXwg+drRibW+2WQW4vKazMlHHSW7o3HJV5mrkGGosYG9qo= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6727.namprd10.prod.outlook.com (2603:10b6:8:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 20:00:03 +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.5723.033; Sun, 16 Oct 2022 20:00:03 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 09/36] scsi: core: Convert to scsi_exec_req Date: Sun, 16 Oct 2022 14:59:19 -0500 Message-Id: <20221016195946.7613-10-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0025.namprd20.prod.outlook.com (2603:10b6:610:58::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_|DS0PR10MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: 7659ed54-f46d-4516-9ea6-08daafb103ea X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P7bkYcm8D6HYsPzXyFCQcoMPB7y6TrUjYP6AYdvsO05L4AdmcGE0wY3bPvsrVpsoMxAsYDBAyA1kVCQU/6Tmo2o+k9jSGQv7QBMt0BvWZllnZS3YlrC7peKDC+V+TFCl650wGue6/xM2+3edodpc1k6bHAIPERz5yKCnPTZ8IXrD+GZrEv3aMXEYeZhSS2+snnwnDQzjeHCq18dTYbhj3CXH5k5oFqX4JAI4nNEto2Rv27UvKRsdYXCtdY7+lO+kE6KpOWIv/HamqSyq0DIpFwFi3I3TK5DYpHdkpQ35yIjvDv6asAPl8hI+stuy/HufH4eLyR36ttYxZqBAXvRQeMqbXRY+8dhD1Yn8KD8IWBUA8w3tr11oKP7w+8sLqvIdnDO6hfwjJEs7TbMYVoZwhoZs4Jj3nAGhJrED/bXTFKpTDyR/Ao1lT5Fpf2WCIT28JgjiRVz++0ZgwLhv17UezNjtfXcIo5y6BwMrA9jBZwFNafaLp2GA1fpVnoUU0wCYaaMy1El8NhFGVbTidOQk+F6Vv7zogFV4M9HRvNxILCV5EMfUXS6x9DqPJ1eBa5i7CkyVD7eASZaLyS72qlDRwGNJegvQ6dwTVp3QkJFHp7NM28D6XmgnWqaG0HEjDu+7WnQpzLdf56urcLsb1lEfp0tB4hblqMT7PSOPE2tAjFpc8yQ5vdMITLqAAjPQvZ6DWTxSsUkiCkECWntvGwfcnA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199015)(38100700002)(478600001)(6486002)(186003)(4326008)(2616005)(36756003)(6506007)(316002)(66476007)(107886003)(66946007)(66556008)(6666004)(1076003)(8676002)(5660300002)(6512007)(2906002)(26005)(8936002)(86362001)(41300700001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: U2QA3MtRODsaNusNm+kE/HpQttnyXyfP0QZKaGb55ZYP+ZqBawbMLiJprjQdTmeqnRpusn+35WKyLnck1W3rxuwSBUSvlnhRW+PckKhK49vE8x5R7at6JY42LS7K4QhpdwtlYLBue6RZ/YzeDohhLG7YJdgtkbt5y3sz+14P7h/6N5iBbTIf7IJtAMm13vVv1zfHD/UrsNUTMzKRmU84eqVUjo5kIHxLbqGKM6qH5uEL5H4iFuc7LJYy2pxCtNqAt3g2xJStQtbS0gpiRB71pnvsOjqqbsLkNirNw8wkwKJwPv+JBmA87JKV5+KW5wn3+Pv1J6j9eux32QoVhTP2tRSSFan6NAEFcnB96zQimQiwGvRVXMR4ce813WmhUg1YnzYfp34Vs3ooUSchdzl6rhNQTuYT7eW0mi4i4XvR6AiMoNZ4wk2lcTgUCKt89lH2No6WaaMoyfcniEAYeEYwTsVs7WZ1OUBWIXFf6pUbIP1YnqIGWg55sHRzx2VBXhs45WIr4vAwxARpWiRZDIX2eHbXKHIykb0TQvIrCH/1j6F2q3sOvvqO6nsr6sdc9yFZ/FSGd64UDGHeFkCJxKB63z8fI9aWlLyve6/60Q9yY58c+xLwckCtes8NhbLOGnXbchNMbbNMNZenxvWmX94obqkM+Ax3osbYEN1Q4u4FXPVfzBArDZKiYfDNFw5Th/60s9YdKzeYgIjQJyIiM0ZWGpym/hWsFI2uGxRP8UA6UitKP1XtIWBuROJVDTfa19Uxmf8COEXB3MY7V/NfQHzFuZoRKYyZ5VS3k/Frph8/T9PifvGpUCXp5On9TLRXN82CrSPd74Zm73AX7za22AibvXYY7RkwRw7iJQFOQewoN4DvPmn7N4aHyLTFBbpYM/+FpmFiFofFjFQmsuSId9A0nawzpn0TS/vSYBIFh3e1gKW88aJlYvPChKI+9TiXUFwBPSEnJ5h4CvhHGwfihDsfUP7c6hGgW/86b9O1r97Y4pWtWDPfNGGiumRuDB+bNHtdOS9latYg+ZuDnmsFkQcsFQLuvpK1YKqzYYDdG4giYTeZruK8i/Pxaxfux8nJOt95r8iqq3XTd7gerGdg+7yDNkODjz/jZFABCX0T/wlIgDC2NYMuA9o7MUYz5BJdaDU56S6L5i22TdrFMtpC+LDW0vFh/OwX2M1KVTxhEab7t7v1Rt4oMgdVfhCEidpmrlGDe1d+yDXqz5ufe7AYjA1LcUh5/Qk1V4gvd0ujKLTR1SBzctQE2k1dEPnVjOUMNZWhJvR5BhN67/BCS0wilnxOnrdBjkLfHWypIlDZ3DEo9dDuZxMLdjJoKYwUT5kdJj+RhAGSixENyw/oP/nmq4xzFO1K8+Wc2n1EozPus2BXPL3ii8SEq7dV+Hiil+7PP6PPAfe/CsXt1sOfHTNayfbj5LWbJr7x1WWoNgGxigCKiqrqLofgQDWY+cSd8igPcyD/UJ9b4uoQ2ixG9l6nQRnRupCvG8BLMinLLhfTO5HjHmr3yfvwZEw2j5N2bD0iWaeQn89ef+VNBafJYULEU2vlGAlOjbtQ/pygl6wrPu0S2q6JpsryGspX5ZP6O2K7Cmj7DwWMCCS1El167IgBeCziMw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7659ed54-f46d-4516-9ea6-08daafb103ea X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:03.7376 (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: 8Sk6QXvGFuOx+ZDtE35zecfpdT3Xr2oC8+9gIsIEJnCcznHUGzJ2Z0sRMvKP3YyBMAcdkJaUdSXqHz9L6d+zbRprBSeYvbocQsutlPni/Ak= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6727 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: WFyqFUyjpjMapQRvULUnVCMriXnOIS-9 X-Proofpoint-GUID: WFyqFUyjpjMapQRvULUnVCMriXnOIS-9 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 16 19:59:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 615662 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 3F711C4332F for ; Sun, 16 Oct 2022 20:00:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229831AbiJPUA2 (ORCPT ); Sun, 16 Oct 2022 16:00:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229849AbiJPUAQ (ORCPT ); Sun, 16 Oct 2022 16:00:16 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B627A248D4 for ; Sun, 16 Oct 2022 13:00:15 -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 29GJXnrO015579; Sun, 16 Oct 2022 20:00:09 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=LYrW1LP0TzS7jhC3Mo+UeEgQHBP4bCwh0Uf13dW9XQpS64myIEDyj1cS/5EG+lCg1hBR X/E/9UssDmrGQH8WwLrJ2Ew7XzYSyqgM3nA8ISFigVTXlkATuLSIDT9DYxPzvj2yEp7V 1eqPxAfqOpm6IjUm+Bh0Ra9qbG0iUL8SldnN3hpTwtwq8MwIV/hLm7Zw4+BQv7yOQysC uHjUizbq27FfuyA5AC708vVWViDrJkzEdgSTfK0u6pLAY31Oe+NlEsR9fF+0RhE4JGlC gnvN8FunuO3n0c9hb0R/KHuEEMvZkbbTIHFl1QRVAonrDGGH7x9PS9RzprDlsWZz8YdT dw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k8jt2g7a2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:08 +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 29GCAneJ001181; Sun, 16 Oct 2022 20:00:08 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2045.outbound.protection.outlook.com [104.47.56.45]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hqwmgmf-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KE5VXqPaXX3p30Y1RSM8hwBA/AF7qJ0e/jr/UFRr/3XoRVeCJKdhjECX5skwnAHrP0z8UsoddkE2TJn3I6y0VDCCDdKF29nPYkFwb8dg4O/ekZq1cgbvPQpyb5PtJrcVJ6yiGqa9OO67TkJLQlBh2HhzJIwvph72aBPcC8UTEtPucQmd5ySEJ29ZM4uYiBjAfdcNfmL4cmoz5pZvGOGBu1MyvLf7qh3ofUu8x2a0XsZ8tammepI1mE+BTvL96QoVVqc5fC27FNseRxO5GpK+pqYWRIx24gpk9e0z7mzyIY5GOKeFQcSasMnZujnx5MjFndKHll3IrsfOtAgzKycFTA== 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=NfKPeathFeWxIElsJeDs+ozcr9tR+M1t2pGwOMdZPUjvZRuD0Un6Da75Ftb9PR6VFsUpZyq/5K8zSk4Xm/zfRYpkIt8CsL/oFf3aRuqHRynC9pPAunVhBEUwRzsGRzVHwz7CAxGhgyt9WQcrDF49Q7XJECc5yK6czfEQnMZwjNr4tA89BwEOX/w69wz+BttC0+4HxLHjex7v8zpMxCIIvwclOheO6jsRhogbpiVPr0TzFPFjfAGWnkcKINnSxUrLB60M10Ae93hdtgbypgb7gezL4Fp1t9r6YXCefNL+t4OvOOoXFCdH3Q8h09e/YVkHWYnz29PW8YEKKzyjsCWlOg== 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=pgaDt9IvV5ykVD1XYjM948VXifBjuJtrQgxMFXujA61k5uvuuZDzhs7EV2rrq95Mb5bLzhfAqS0QSOS1CN6YCJotSs9Kf6OPZToiXZo4Yuuy6pCGe0a7n6dWzPSIMlnRK8qevzY30rJqRkeY23JHo5tm3M+F0nNcj5DjhYMibiM= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6727.namprd10.prod.outlook.com (2603:10b6:8:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 20:00:05 +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.5723.033; Sun, 16 Oct 2022 20:00:05 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 10/36] scsi: spi: Convert to scsi_exec_req Date: Sun, 16 Oct 2022 14:59:20 -0500 Message-Id: <20221016195946.7613-11-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0194.namprd03.prod.outlook.com (2603:10b6:610:e4::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_|DS0PR10MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: 85c21da7-3e5a-4790-f042-08daafb104e4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kwweB7c0aQrel2OYlf0F8Da+MBbrKtqo+gtbqYCdaOfLprTP1oQT3dUyXoRb/WyTXPthzsoSeLYIqmMW2zrl4itflLzCSYckdyt/BaqADD/+cJSpcmeQNPqXfFdZfV4RHyF//AeJZE+N4wdnf/BjHvtNR7mkbreIYT1xZbtGyirrE/hf2Gc6iPwnoOqzX0rOUH2noiCGpSa1WPj5qXINeQqV3fwq1b8GqxGoPedmaxFThaFHBTM5IVcwL0H4BguFHlrNtrzsam3pW4elDrB7lbTznW7lsIF1/Fb0+Zzu4j2ggoZrMsUHP1twbp1PoQCsBnjLCj8MhzmrXQc0bGbXTUqJJe3jkE5J5nvJEk0mJa4CnlilAdDi4y1wu5CP+Ugh7a94qHo4oeaicZVRAvVsGrl7SaOihbM93qgdeSCYFvLDJ4kUzPwXtU6GIZY4YendoXoI3xhLU0ZSI8UBgpD8EgcFDjMgB9wD9leGkBFEdAMq0molbM60C0oMijiIS0r7hRNLFTy4oopULT6ErnvrAHCYpWWnQxwVcIYVqeL5xr2Z97H4c1BXjon8NK0wyaua8YO7KtDp5eZOpN5RZyni2I2NYNHVSJ79c6Iy4l6fg/LjCnrpUCSMcgd/ifHGsZo+awKPWI7J4rd78/9+mzmY8b2BwzHBwMktXCR0BbepCJ2kTT9BiJdHfYJu2Xl9T3iuEjPICyuv6Q3zeO4VN5V29w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199015)(38100700002)(478600001)(6486002)(186003)(4326008)(2616005)(36756003)(6506007)(316002)(66476007)(107886003)(66946007)(66556008)(6666004)(1076003)(8676002)(5660300002)(6512007)(2906002)(26005)(8936002)(86362001)(41300700001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5GM+nHR31bCj2IU0Y5eT23LvILuvWRH26OLmcxGyvMB3dyP79V8PeyfCje3sGZ9P2C50RC9jfSoBgXZtJE+S94khttw8aaY5vzMXCWzasLomQ4TFZkYx1xzZF3SaQlam7mw6yRpLX2iGSqFR0BC7euN7yt+k1axggwKNq5FNvqZvkQB65f3Yfi8an5JDrB5ImWyW4hZAFfVoM2tVvv+Jf6ss7dKC/LXGi8DOc2DtU6KHP00NgzVVYKUEs5q7qJ4tLW7Hr1B07EmcLNGysnMR3mjPcYUgeaUwY6wXifKHzZMLWrYR/I3XUIQDNVGLFeQ8Y6mKjOXW1Cv7KjrzXgaUWHqXvr7fbOTMhJUdav2qFVHtKutJpDA1eepO/kVRahoRINU5CgQHTx1BgQQTwrhc5nExIqIEu9R6oVFhTSaFj/r8xiWfDU14TwAPuXn6foKTFhMzE5IdfsZCmhOAfRtlVC4pOlYjV0SXZvhqq3Y/rN6eY9IQ3CO1EGS5bH4x4UeZf/EBGfEp7FAji8Kx8tGHoSrsQnrCcJLCXYcf7UoddIasUGOcLycoVeIrLkqo47jSVccRrWN6yBDhVHWDAgITFarxSA0R9rjx5J6/BnwnZXCS4u0m67bcLT2WFL3EB29mGCF/kfoaFDrj9YmEtuNpsq/ZdPJGaMXQ3YYi0p/qoHnC0EyKRXUD419kgccqFK83GS+kxR7TBoNs+fSQl/QTTRj6izYKEIjUuHSAGPXUu8nLSyPefLFhnc1lNI4nTKP3Sv4QENq8oZxujDxCPX3FgZ8dX2C7Q/fAUeDpyRX5E5ZWiPmzkyhC3E3D8KGkom2p95EipbOKEYyjcvRzv5vbdCI8DINwOhJVT3jdq6rPjIKUTHjUOxVNKvvn9NbTeFBahykuyvmRTlzguXBjQj8UkU2gWRs+NpOxGhu4PDhiHS+WXtCzPF3oYkqmPQ4QaZlFZeGgkTUAcbtWzNiRdV2FppV6fho1jQtmUK3V+0eK3OIzkquoMZOMbxM2BvT7+hyI6UK+ylYADhIxPND1cknPosqoF0uold5r0Out5XYAglmo3aoVRYml2GkbYLyqzNaNNUkL6ur2RaamkR/yIdEESrMoTou+mafYA9YTXqsv62yEtg5IH1hULrRTNS7jDu1HKdXQzdhG6Yry//VAf/zndkU2SLdm79oRVOiyJyC4w+jorE4dIviYqnDnOG4qP3PMBApyqFsWp32iz5NJSG6fjtBXKV4GWGB1AUJD4zEg7sQObLtdlS6T1npH1dIX4TGB16AxN1rg06G+Tqc6vHtqZHChwEZc8YoeWgK6kRyWH+FvlpUq74wML8LN3gSSz1Rlhf32fhIfEBoABdqi3qFTqsWYWJEHqBeuW+VXqPSEV5J2NqlaPazsJ5sfaCYQWDBZBZGSVtwN5yPQQC6fAaHH/15TaamrFT3lCoFc+CggP8no2Zw2qtfVLCIzn2WjN020dzKRSNHZaH8HTG9fn/T5lcBD8GLVdWUO40kMEFdZv3ogmkdWjvkY8qhye2TfEaTrXkbKLzqflvF5Yz/JcqlSsnj5gezX7cP+ashTkf+Uw7oQqVVF8MSSf1wTaHu+f8d4f+dCY6rGGgWujWF4hGepxA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 85c21da7-3e5a-4790-f042-08daafb104e4 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:05.3624 (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: aKbeTQaHc+skPSIxgcFSs75N4PrEMg3PmJl1u2MsYROdv30fDU5g8QYvQupSMzS5RcUTyBzWkvvbULK2s2VYLF8ggwiFv/1KzPd3FyYzCK8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6727 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: O9tsF10Cdv-ZDcPhKEDMJiYiFJ2QgXhn X-Proofpoint-GUID: O9tsF10Cdv-ZDcPhKEDMJiYiFJ2QgXhn 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 16 19:59:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 615655 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 77EDEC4332F for ; Sun, 16 Oct 2022 20:02:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229895AbiJPUCL (ORCPT ); Sun, 16 Oct 2022 16:02:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229873AbiJPUB1 (ORCPT ); Sun, 16 Oct 2022 16:01:27 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EB4D2C645 for ; Sun, 16 Oct 2022 13:01:26 -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 29GJluMv004999; Sun, 16 Oct 2022 20:00:09 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=i9vh5+iS7Gzn5UmBIU2hW+DPpl6St3cZ0h+c/7sJvC9mNJ8pUA+TBkNVo9m6iWttvLOT g19btewST+X/aQLOY0ntxMry3OryRCnHyCD2YtxT8gu0PsyAbOyd6M2O5ple7TSq3b0Q CMDWQfKJZul/hZYryDwk2CDr7aq1DUYYelvEdDjKmqcvbhDIrvzOmzTYFti1Ac+Ps2ts sLMNaO11o+WRwEQgHXvd4WLCZTjt/8L7+6Rb0wpKBd8UjtDSCngU3/YQMwS3Bho4MXVM CppSt/tjH8BqTYKM3t7w7srQO5X0lXm30JQtc5SW1x4ZNIC74E6Zc0mAo0m0nbjQo1pL 2g== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k8jt2g7a3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:09 +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 29GCAneK001181; Sun, 16 Oct 2022 20:00:08 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2045.outbound.protection.outlook.com [104.47.56.45]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hqwmgmf-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lrTZNh5sda4W/H43foZmCgU/zayiLHgeeCIx3rHi9D0Ui4s8E7Rzav2RXZ4Y3kMTCoPELZqiZ331gv1vDc4FYEoWKFbzqIB2mQllSCd6jyxbogBLhJiMh/mW2OLI8PIuHrJsk48oreTW3Lmyto8l571s/+vyDdnH2cZLIE67qzhsQUhP8c+NQs5x7fgyp4pCqVEFNoh21fwpi29mi0Xheb5Ut2uwXjZfx+J/mpIlYXo5QoliN7ZwFycTRYBVEHG9dj4RBlT6dvTYyto7qlzn7nSttNT0NM092dEnd7i69tTHmIXThZ4/7ADtG1tAs4cSPoKuNZ1ZttN+fbPnb5TDSA== 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=WvHYM4Pe++CRjWmg8ZIF6QgOoOzD0UkJo+kYbnvvY7sk/CIYnu+TxcFVe4FiJA1uHtQe0UmMlYnSlbMRWrW4hAxcDptfKVawJZcABY9cncP3Ah/nOhKbxmfgtiw/IUbZhAN831aD31RpUCMU1+Q9teT8/4/DGqenISNdVdfjiDlATFmxE8MzSBfPmKCPl6lCunmNwMSfut67WNjJSfbnPJF1iX23Gz+vVW1/flP4JqKxSXoEY4F28rFHv/NbDUUWdj7zynHDqoPcO7hkD8L9mjwfdZ1oFY0wwqox/10F5LhFTIrtmU7LgpezpPBEZGxgSaBgZpumYMnzNI5ZqzZAxg== 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=DzFgA3Imu5mT5kLIQeu7zNdZLQF/VRxOd93LkrClyPF6B4qNhehJ6sNOGLU7K5dFi4LzG43RBQbF7ulvVwaoG7sKkF/T49SqxYjSf2Bm9TrR9owPzPQNK08hKRWH65QTZnkGXJbybi+FM6zt9wBH89vPvkxkMfxq2DDnZ0d0oz4= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6727.namprd10.prod.outlook.com (2603:10b6:8:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 20:00:06 +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.5723.033; Sun, 16 Oct 2022 20:00:06 +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 v4 11/36] scsi: sd: Convert to scsi_exec_req Date: Sun, 16 Oct 2022 14:59:21 -0500 Message-Id: <20221016195946.7613-12-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0207.namprd03.prod.outlook.com (2603:10b6:610:e4::32) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: e701bbcc-8acf-45a0-e1b9-08daafb105bd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bHcDt1oQiXbnviw23dilbRZedTMwVDnE5NMd3P2fKT3m6clPBm+IzZ5XpvF+/Y4I7wiFP/9vraw2gjcf93wqn9+U4n83EOD095U+CXxRQhPfykNE16PTsosTcpoOVGYa7nUTV+6i6ZEJllt0ZMpEi10XexUu/eBztP9Ene70JxEAZ5ZLL9fXt+o3LYImHadWn6WBIcKAQv5PyAuJUAxjPeixTIx2Wb6goN4vo2HL3eNfs4aBzS9jFqKUditt7xdCyvN8Vdak3HK5y+NwgWzA3F5RIIEZvtFjo3RJJW/myEffq69kBFChbwnWgb9nzmesF+wJKhkGPk15RnJgz43dWb3GjQyJER6pvFFjGIzJkE7MA0EsXwBRxO3Idg0zR4oRjJ3Go4ne4yv+HeWlnyJ3LP42+cPKjbwu4V5wGzd4rLa09QP96/3A6ES+k2WHGkEkOmvBzeOHipGe/0WGRJEHFxwHg92/McdLA9YDPLTEMlSaOao4PYN3JOeNoVR9LnovMqg8rcQxeAUe0LSFKXSjxUx5xOU3TeQP9vBhYFZdyFBZH7nt3VhjpV9DS4irXx2bbpxL8ymr3RDzbCPbBZMEUvSaXemIueEFk4NCG1VezxtXnLal2pCBtyzJrGc48KjfmyPk7rEM4li2WXMUEeOyB5hjfx+vj+YCQcqsrYSdIS75fPHEyS2uv2CAqo7wZoz7XvbS1hVO8q/gxlBQuxpIqw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199015)(38100700002)(478600001)(6486002)(186003)(4326008)(2616005)(36756003)(6506007)(316002)(66476007)(107886003)(66946007)(66556008)(6666004)(1076003)(8676002)(5660300002)(6512007)(2906002)(26005)(8936002)(86362001)(41300700001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PQrti6wLNTy2Ne8JYYOifTZZ85yUqqMooKiYZK2IUp7evRTUUJY/9qXDGRwANsx7UyJcmsu9T7A9XYjxQYcoKNqJHY1pDlFB5rQIOdPTs4Oskx3JJG5No2SN9cT42eciwik7cvgsBo+SL8tBN5euoR5KlrdbmjcOAurVKeN8/RO6lRHF/BMYn4lF0/OQRLq4aJ028NvcBO2lOVtW1/OebQY8OEOhjEgdLw5Pw98SzRfyQw1HaWFEgXmv+bwhLUai9+tC2vMbCvt3JZ+bUdzQ1YEA99YSz0FPHyafTTMKYYsawKhrS9l1QCC1aWs2ilgVMilDSFJCeNzuig1/clYaECdQ9HdgbXn4L7PIoEgDDk75IY4T5h2QDtTkCetkBcfJTbizbLH4toyERHoRxkl+DrRVGnvgJ/a5newIcLxRTjjj4csCEYYGsLCwHaBpVdKCxRmj+72wOWj4Zzp9uA6L59Db2Wlk320qOMgNq1qaGuLDraHu+fLpDyPY+LZ9fXqP3xGmylLm4i/mD+/FSh8rvwW8abEbmD2bFkkSOJKTalPD1nRbvIiivW+j7jIJVquvvuebp6oNDEbmZ6JEQfgpLb2tOh+Cma5/mx1yoQ24ZF034/Z8vDXUhQIt+zl02D8ePmQ/SEBgQ8IJRd6ovJthi2ZK62BQ0x1APk1ZTjtOkQSYG0Pu/A64OrnypH+aLl/+7wQJn/VAOkgP/rGlgiNh6X1mBJGYMWTHrP2qSeDt1gH7V1L3QYGychIP3q+glCjDKumJvWVKYsBU4WRb9ePdfNmu/P3z1/CzdHAXzLRgXXAHVLDGnUK/m6H8gRH8e4N27EMq3+avvmckTLDHHCiBTfAMySORM+4ZiSgPi1d9ubpp/hjSv6d3Q2+sjMOQqjoTk0gPMTuraU+bxIavvDwPagNf7kzeOKtBVf6l1LzFT3uryhlh4oFu6Z0UgYb7s4hpp89YkHzNHfAp1hTTIBn+NGfIEiOXaznkRhJK5TdMV/N66pHPy+xX9xSZM2emEMp1qAem1fFwLdup/3E5jRSN0x+fwZeHuF39tes9//iW+ZU492McSaTPvHoElQg87fXgHBmfODbjtadfg65YUa/6g3yt+XK44M3OQe4/pTTvVq+Mm50h7UbxFzR252fq0jAFzcXiAWbZqjx0Dp6ucJzZ7SAUYUQQMRW5ImuMORQh6OxEvNNXpJSVtQNuC3cTwTd0M5rvMOxRWAbTYi8FUanneIb5Og37EbJXuHNyxGF0evpWh1XQpfqrEaVIP7j8Y25g5C87VE00ITGRHuc+QFspNWnQgjcRQlT3TnY6jtHTSfp9ks9OXTv/U8WH+ap+eM8rUDRfH9BwuVBzNwTUKAPauw2AJYA5xOHoWEqeg5g7O2a9fFZt9E2L6hCzRgOHCEtviNfZcUeattJLcsRELmg9a3h0QeGpo8+3rnTeS2KWdzGX/XLlhpCp+gmsC5sfjkM4VNkG/3ayUqDjCnXeKzY7qNwtWtrxRhBAi4qgu7gAYZs6poAekib15ORkFQiFfMaNa2HGncZOYq9WxWDv2kNMrc8LbIxvEtM/54x9dtZuLeYp8vMQuspQxpJrA+qJqgU0a1Fibfdb3eqmY5K1dqAJ0A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e701bbcc-8acf-45a0-e1b9-08daafb105bd X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:06.7998 (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: sIRt7HSOVmxrLxYNCk+lJaVnJP1OYCOeF+9+TzN84ffIhkvq66RpbecAxKSQGuhuoUNanTgLsa76XwJo0yqP18GiZzSIYG1YECmQE/RLvGw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6727 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: hlPkaFvd7X1l8cWi0pDlTMYuaM878Zxq X-Proofpoint-GUID: hlPkaFvd7X1l8cWi0pDlTMYuaM878Zxq 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 16 19:59:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 616408 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 D4B0DC4332F for ; Sun, 16 Oct 2022 20:00:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229874AbiJPUAs (ORCPT ); Sun, 16 Oct 2022 16:00:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229873AbiJPUAX (ORCPT ); Sun, 16 Oct 2022 16:00:23 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA8722A262 for ; Sun, 16 Oct 2022 13:00:21 -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 29GJ20v0011562; Sun, 16 Oct 2022 20:00:11 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=QytqGE0eYqWSpPxGaYiAsQ2Y0ZK5Wp2/spXXV09H4/WXNXwiaJvE82FtAlkCSnI8XjQQ raNU+LelcL7QIWYvteXZ2Nep6gU+Lo8nt2WbD8rcMfNXEwfq/y0WDNSrjXdOooaD/UzZ rAKFWANfg4RRwduRqdAeyQgwbjkb4B5mbvpDSTe426/FujvPByBbWs9eWhqoO9qvBtZ/ 06KJxIZdFzjR+giHmu/Og7+3/nkKv8/YcZyQTiyDgwhNyTXJJ4yLrUumm/ynF1nnrObL kkLjMYoJy1ihGBLzY31tFd8j8yVw85+eqldgtY8yU1VeTOrdT3MfH0wOyVRKGqCsrws0 jg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k7mw39yde-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:10 +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 29GCAueT001247; Sun, 16 Oct 2022 20:00:10 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2042.outbound.protection.outlook.com [104.47.56.42]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hqwmgxw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NJivdTFmX0zWVkeA2MYfZKi5DEUBviMiEgDCWLJAXEWnfnxth7BFGiNIx3mJnIwwljKPba7VoIq8AERHJL+3JF/2KtJ06WjbBmLm3dPfa75Vd5deQwwBuysGnNvWZQKqhgnyRlLqSXbr3eIBuD9EvMuORwq379A4822olReGHVXq2dAXXazNkacOWPR594hZA2IEdlSuLH/EIDkp9kX5z2g9irPq72ExrrdPwPyoezhL3ack6re7uMAv6aMw/SUMSF1RQZrXKWXoaF0cGZGfwVaO5ijTo13th7XrLizG7+9rMgADfiMCjdL5UiRdw6wPRcFa2m8uT1nVyHfX4Uzwaw== 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=hCEYtyVqNiIXnQMtXHUuU+TAoh4vVNd6gK7JlqKaa0wa7zKs0BciOIIIS8L0KAF+dP98orrr2029WCHyhvabDx76DaDVcAHU2vHXVBM9sSJFP0UC2ZehlXI6NXSd4NvMGnKmw4KQkZDOlEt/kUtQ5o6i52j2nuINZe9EVEvTtMQup119DMK8gqUf5WgU8hVsiRkcu8aIF5cTomNRp1KAs3BesrLDGgbLtb2ebPQlrEehIGtznvl6r1mHOLwrRapmzkNbL57aGkmvnEgy5JrD8ZoX2+wcpQgCmpdawDDuRt5dgLJK6ucHiznouM844W37xB0p3Zfet8NJrzhhPXt5Fw== 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=N94ceMloZtqFk9lpiE2AUuW9OcsDlJzpoz8LHTX9pigF/Qm7Y2RD/xikqyRcIlsbQpEIeP3gF6Ei4c3vOlL+SvZOCAuyldy2j8Fi7SYiRzRlPpM+1lxUF+XdcSAmYIUl9tkGD1rzS3EOHo3lcfudlf+VAC3C8wZrYvxysg1OJ/Q= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6727.namprd10.prod.outlook.com (2603:10b6:8:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 20:00: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.5723.033; Sun, 16 Oct 2022 20:00: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 v4 12/36] scsi: zbc: Convert to scsi_exec_req Date: Sun, 16 Oct 2022 14:59:22 -0500 Message-Id: <20221016195946.7613-13-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0207.namprd03.prod.outlook.com (2603:10b6:610:e4::32) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: d5a226d2-5479-4c02-49e5-08daafb1068d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H8HH4XXUz26FTiTvLBq6eTZyHBMbx0jHeVanGix5GcOzvm/271ETMLKtI+1PgISZcQ9rbOCuUfVUY5YfVDd5XwtF/oTtWSG2fFxqlb9bvtVHPiIZ8IGcHancfm4gurXQ56o74AovJWYOeb3NG1pufaIsxpcy9/gfSoXig6UXvMzcbOiZ5ABXXt3zE7yx9uCOfuQaIMaMm1hbusXho6ZamBrwfKCR8r9KuahPdgXDX5sbGMWV8IUA4hm64nG0zRjezFTNMSRnrchcSqD0wH5Tqh2+JKdSMqTESF9qA4I2FY+PIhJYFBMpgCs3nX48G/xTF68oYZblYoe1pPTqiyl3zFfs/kqW9d3r3HcStpTRV3Vy3jNG5yTmJT02mM7HPklLWfxX2fqDxHuA/hljxQvhVHOVT5nIbpOintL2McuHfry6kkKVkg7zyYws0Q+EMXnH1FK4CLYfoMZfazVtOnGWfqOv41aUgKF7JhaMIUhsg/LQbYuzjGv8hFxoz82m87KASXgbRwAk4meitqrmt8jHO+VWkOu34sSfdDKQBwtYS6/fbuMLAtEI5KatfXCw9ORC9mF2aB1eda84qzdUk0ZKhV7TAcukqWdtPnedAlxJpvpOUTR6cHm6mGULKb1AjgTG2TRqxxE/UKbD5iTNt6rfGBolkCBLUEYZuStJm172zWRm0XLavH2/t0T0JpSUxt9CH1tkHVMuZNC6PksWOf2ekg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199015)(38100700002)(478600001)(6486002)(186003)(4326008)(2616005)(36756003)(6506007)(316002)(66476007)(107886003)(66946007)(66556008)(6666004)(1076003)(8676002)(5660300002)(6512007)(2906002)(26005)(8936002)(86362001)(41300700001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LO4QLAVvnVOu+xvfEfKkum/uE9bJztVBKcoe6xsHhDRrqVNUs5f0wEDRTNsDME4/QXjz3SWVgo2lELYVqGfl+kIolYyczrurn/oy/QvOFECkVa/KQGCLWP8s5Gx5vGENvXgNjMHdRqlhwKVA3/SV8snd78bscXdP4cNuT8T3EZzNInFBK3biBf23PbuqJjfqMseM17BKUfsJcMMyi3t1hNJ+NRnQC99Vos9iCtH/c1lCiTJnTEGb1puXLucdHExoFvCunG8LGhLykqqMInDR7/WOxlh4+8JYicy5wDYxFWf6kQM20kDX/lDCPymfp2wgV9/MHSwVrQHwQLGqy4bRjh0nXr4hsgxw6BZLzMFjKaNshWW1hDLv19jPMn2e1r0NVdsYtxKYfFXyFyYBfmkpJ+lc1EnROy2tSXfwWpDLu/TI/XahM1fuh8L25+eFyev8Ll1+UbL7SpGntcQKAFnxddRguZ5UOsa8ATxzqGAMYB+43bPz7urdbC5UbBBfghJQfo28BB60KuRSLrmlDjWH8dG2aVyVpUk1lY7BJecdlHD58j20sbOYRPNU3GlFMpI2J4kQJ9OJxmM/mgaKwv5fl+20jv0RuCjZyc1aHBADh/1pHAQWwwNRMZWqLTQtycv3K0V/AVq1MxziidlS4XttyD13TShL9wtQXx3pS6PfhguRRXQ9iHX1AA71+O28xBCYUG6EkJKSpUcgZwpACPPG6t1Bn3FwN+Mq8SY7cOqaTpba/TTiMWZKzC5mVapYFyd8DWnbgcgoTQicvaS7b5lfwtzt0/bHQbpr8bsK8mFBEbyn01u3EGUdp+PMW8oLU8HK4f1JTYe60QLLjNv4ApxeHpen2mVjcpLYpKn6kyORsIgbx5R/rau7gbOlup5AEdvSQ3QP/g77VYip4zZdzMnBtE4DgwCCV7KcldfYBfS0ujxNS+wb9sfkvdUoyn+g74IXk+AXpG+UFmfhMEvcTdBX7Q9xoDHs2PH8GP5NrdjajIRKZMt01rvSLQOFv1krsUoOiwDRstXDBf/Z7MrvHbH2U0GY9Vryn3l99Pnkc87aGPObwrrO1eiktIlQ6b5D/RhFeWQ2z4+6agi36/QKBg/DP7Bsctr0fm3pxMGokFf1kMWuHrG9kjRajyWH27vcK7sb2PcX+yft8Jb1bVEWjsl7hePB08ritq8R5hY4nhtliCeV8up0z/vdZ3UIoknybwm9s1jvhKxRbxStKIQUqIoxkPaiOtbtLKUqM30wFLR1sgoWh+HgiNJsRgEB0U0Q4wJh2hBDrwKFXLOwLiI+6gV8PrU9bGVKXul5Ik+9T+s5VxNP8phpcd8WKDzQ1vBZtsUT5c9kO4EhLhUPkVR7cbyPTEsSMqz76+vrhCcgNg6T2KfBvIutD+1RdiWt5/iAIjoZPW0LTLaNlef4+334VDOvSHdMg5/VzA+Gxnl0e+9QEAY/taIgGuprfSxUG7bUaY88+N38Ntr+vk4tgDC7d9iacSI8s5uMLErXWvi9MY8MNPlOQzzp1a0X883FiqlHFeFJ3e2uIzVDmLNCTOG8YKxFImTDEBy81C0bdbZmP1QJsbkdmOWVrlTXmwZUeFCMtwlf1buicnggYtZCQUOx0mquFg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5a226d2-5479-4c02-49e5-08daafb1068d X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:08.1747 (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: O8WzaO9oyu7JQoLGgemVAQQfe1AFWmVrBwTZvDPQBJxvj0GUg2OPnIoPEfEJWrjp8blFV3971+gAOrVm3VcRV1m7y6NhyvUjyerWEm9YYBc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6727 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: tuariEDTd2RvtcjMtAuYPPXr4wHK4ZKy X-Proofpoint-GUID: tuariEDTd2RvtcjMtAuYPPXr4wHK4ZKy 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 16 19:59:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 616406 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 94E68C4332F for ; Sun, 16 Oct 2022 20:01:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229933AbiJPUBn (ORCPT ); Sun, 16 Oct 2022 16:01:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229955AbiJPUBN (ORCPT ); Sun, 16 Oct 2022 16:01:13 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE9AF43310 for ; Sun, 16 Oct 2022 13:00:50 -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 29GJluMw004999; Sun, 16 Oct 2022 20:00: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=a8P7VsBo6ia2NGN2xi+jJ4Yb+k/2sWqCIymwCu5ZnsY=; b=KI0EKuLOiV6yDuwv0zbU8n/4l6EXJOqEFdqcGcr38NXAb2iV1VRnA6QmlBmz6oBvLLeZ K3dKV0BCQToBwH3rNAUjMfsu1QhVVxR/P2fYgSbOXOAcDWZFg8hG//3sZM8IUsknHuEz 0H5gAnziTR4uaMOXEtMdM+rceuNaw39KtmUqnRIdiGlTVwjEvIL7PkzMlrwyMbqKl5xw IlsMyE1yTZPwfi7Tt4PFV14guujlL57qfxC/o/himqf9ta7BVQPlw0q7bhK8wSu+IdXl AeJ3oU3or18ANwe+QPlws2//otptuzakbfKUTWhMuWbGUHOX6/ki6eW9bIqTlZmXwcP7 fw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k8jt2g7a5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:12 +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 29GCAk2e001153; Sun, 16 Oct 2022 20:00:11 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2048.outbound.protection.outlook.com [104.47.56.48]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hqwmh02-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=be1toX1YaVuaIDK4Gnz7iduiyM+XwHcNr0AzqbnrTPc/vCgOtFRXe4o+C29/ScqKZ05WUypz+rgOPPiwGd0AYuC4r+djCwCkyhJJ00HFQl/GQZUVrQ1ddk6YPFIsNw2ZArxNZbOIcwGrtGMxjtg2PkKpC5ZSVByN6qZo7ZKA84kCdzHrlOpOP1UyNPhsFFQn6m8+FCBzkweTpJVMtKPTypMrj3y6qIFbTCZVWgsqpT76puX7UTPoK3Rv8Qnzvr4PnFrZ3Nk2tRgjs5omEOrLr3XtAK75Tu+2CiCE99wE1Y53+MOCC73W6v05Epwk2F6uSzE7qLZ3xEDIW2lRj3B1BQ== 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=gtZo0+GGshf+ZFMElQIAU3EwUtPdGvATdrZRCRV7NzdDeSgr/dgXKO1VlD7QfkgSTvwP1GR30CCmL5CwDSxEjx68ajkH9le8c9Lep4tV27CMxI9/RxDGqyuNZ/O7YbB9cvGTBUfBX/v6pD3hSIILTDC26VIETd14ZH//400h8r6bokgb1691eaXW7y/doymlfgsm4n+tPlaI2zRGj9HuA5A5jcsqVC2hkv+biQNDbgzW2SN0Pq0fI7roMdt0eW2pZIPSs+LSYQHB0/TbW1W6ililMlvBdyjb4HrkP0jqZdwuP8BAVPjRHcTn8wsoKv0dj7f86YpeJIoQxfqZD3pypg== 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=KrhbYK/UAUsVZhJYC1JX0DIZAjB2W8iU+pmJysPyfwJ9J+eLrkr7e/IzSfp2sG11WTquZBW8CcmMum/l49cSKSlDr0H6m1Xquk2JkOW4OcvUVsNbL6oy5lHcgkNPgLs6cM098ZA7RKoI0nEfYqNTxZy4wTJGk6GaOGsBZHvtbbY= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6727.namprd10.prod.outlook.com (2603:10b6:8:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 20:00: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.5723.033; Sun, 16 Oct 2022 20:00: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 v4 13/36] scsi: ses: Convert to scsi_exec_req Date: Sun, 16 Oct 2022 14:59:23 -0500 Message-Id: <20221016195946.7613-14-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0197.namprd03.prod.outlook.com (2603:10b6:610:e4::22) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: f54990ec-f09b-4125-affa-08daafb1077b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t5fPTdQyvboQrvTo50b8fIbYARS4YSh1EgGN9iFGC0ERYYt/yG9yuR98HQEybG582BWxhdAJd7SCblLIq2Ic/nukjm+PUBomZnYbScKVthBMAExZoQ2J6l73P76R2WHFlJ74DWmtACQ0LmRsXum6aS35Lfe/QvgQZ1pxCbtuQeNqG+ZCigqGF0dcjVC1PMFna3CIRYG4RGq6/5Px+reDGlO+2yK4rUqZJbYT0eSZngukH/SdABbpplFRm6a6pwQo2PDj5UNhwZQXK3kyAjZhct9Uy4P+mEQKCRfj95mAC2QnNQ5x/Z2WWKJ1i/mWvZfm5K9Egqo8hnqPNw1z6qM8HeWkB8MxI077+5sIPEbPYepQTdLVfwTgI5aUj4MHwqBXBh34z4ZlfL92dxw/Jvw04lk8CMDB9Pxb8TecmlH9LnfQY+YqrKXIALnqWZw/LF3i2iHgPZPMq9X5/9bxYK4uA6f6hTsdsTf18xoCpaQPezGUgk50JcEbWHMbLr3iumWJCKUz1NHytAbMMtiqpVci0blkNha5PIg45zvfXWG9mWyLorNW4aPiVp9l1S741ifopVNjNqZSTVUll9fOUfGJX0uTZeHBmIPqO9HAlu/FM2ur9GnsqRqLK7c90GL3/zn3HyuSy2R5C5qn672NkKsGuKyEsJNE3hEIJEhJ8EbvIBRHDEFaqJcnzxExu214jtJ7qW86CLzIRwZEf5DikS5XqA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199015)(38100700002)(478600001)(6486002)(186003)(4326008)(2616005)(36756003)(6506007)(316002)(66476007)(107886003)(66946007)(66556008)(6666004)(1076003)(8676002)(5660300002)(6512007)(2906002)(26005)(8936002)(86362001)(41300700001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6T8aKcFZyGUOO1NsnKipgQPx+ihP6bxv9Yp3fsbSQxzhxXRz1TC3pOgDv17IgQ2bulN8rSqX8reZ66zWYi+OF0PUSvsKJ7NMvC1tG0Mcdop1YPVCoQg9VO59G+mH/28NwCm3WTVn7EV2nnjz6dy61EP4NYA9XGMo4RqzUXUhQcwcvwC7eZjBcbZf+EFiMgCYhBSeBhbw/Lp4JVcRn0oEnrF3+LLabsToLMNEp/RDwXvyWuIft3jXOi32P4Xc4/5eL92YBbIrFiodxRp5LSnhhj1ilU+Q+a6jbIwxaQHH8IB2YNEFjkJ+tnBsZLghuHRfa4aDmNMQmZKbFUZEWsj4O19Wea9NtwEiatM4YdjncdF9BZbMVWYWRdGRB1/2YagDin2B54sEDUsH/FnflZnbPqQQq1t9Wq9cJ964h51HaIEYfaJh4tfGry14crRzxzrLE2fYJa4DefS00BbK4p6KP/MtVXQm5BPOrfmEQ6ggZMAczoO7V8Na7JYyY9KA4+sAizd4THXOXW7yx4/MeVaK9M3UPjqmGAaJJRP9YdovHU3zuVgXot+ZKwPEo8zXuUw9utj8VrmBnMTyE5XNGa1qgOvb9eS3ojlBxqG4h6Bu1NY5mnjWUaHEI41/WtLj/1nEUk1T+NBaEKjhymDpdeR7GF2jHsbEF+SILwSPjGZaV/HwhVO4K3ityw+2Hr0jnmrJH89kdxAUPwkymdVmIl8COb+Zqe5hdYo6C0/8ilUvAJO1vbsPqsMy4ZvDcoqdPbz2FNQFhJ9sof7GHKWlTQLAMQNkLMhlxVanfnzCX8ipwZd2PECvqvNZFA4/u9TydOctVqfvstQrG4F7d6BkkDIJPlBmG/cos6f2k6ioS6XHZtuqgYaNgD3o8OmiF6/+S/lDldSdBxAxOLjACr1ERlrFSEyKQBvit5cJ5i1od+FLXoT4s6o6s/Ezh6KvD4KI4zB07Xv3NCnpuF1KT6uPA4k/S2bnFRHwKI4S1XqqueAZmVuvEqUjSS2my/yZJtV4hdVK38v5fbVs86LDudSMJ2bit5gJbOTHdJEJpLdge2WKnN0w+5RJjZ41aJhzcnQDIwqIrgYyBtRMWLVxYCZzrBRcBEviYoh6R6BWOYCVPcmYkaFzpv7NN0O1WuVlhYunKs4ibh1iXoIK9fX3+E0rP3t8NE7EnqH6iwPQNYiCuT4ghPbgvhHjZTWMkF2c/Varu9YJYsa0wuqYNrsVMz4uOpxOfrBwe+S/e1fMp/9U6wdoLxIG3CW8KNCgNyhhLzs7TpwCgnFZLFAPL91Uu6EafFLWGTUd/W5wbUBcvYGhrsanGxMtARi9xAOdB/22e/8vOG6UI4dBcpZqXq1ffWiUM5Pj1ZSBbigtC+OLczdyNTs/v6rMKihvgFwHg7z+xGedVNHsE3eyyIZCYddZB9L/5uCM8Vwyi/sbsS790FMawDH8sVrdDKYavDHJuZfkN5AHPiguXda6pzPffYvSviOtbhtO3Eak0lz8scpPw6f2NxclLvn9zqLvP3aUYw1VZRVKu/MQx20CPLx0RxW32ew3i9OJ9N74eBCqkRLB+21Wl28zGoEYcj1lJjlz8HQtuWIbIxtUfccdKi+8h6W7jo1muFagrw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f54990ec-f09b-4125-affa-08daafb1077b X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:09.7215 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 33sktvKVmxowY4WRPME1iFI8HxRRCk7tO6PEpNwOUIGzz5CzvTZSkj+TkcbBoi09gTTIpT+ySXxPsKYzGhFf5mmkLtUpo3gQulDCTcdd/0I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6727 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: QCMAD-yaUp29rDPr8MxxNijQ6oqNELoc X-Proofpoint-GUID: QCMAD-yaUp29rDPr8MxxNijQ6oqNELoc 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 16 19:59:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 615661 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 D9CCAC433FE for ; Sun, 16 Oct 2022 20:00:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229871AbiJPUAr (ORCPT ); Sun, 16 Oct 2022 16:00:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229874AbiJPUAX (ORCPT ); Sun, 16 Oct 2022 16:00:23 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6729829827 for ; Sun, 16 Oct 2022 13:00:21 -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 29GJXnrQ015579; Sun, 16 Oct 2022 20:00:14 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=acayU1GAglB2fQHOiQLdYArjnwrDye2FGjGypX1/B9MDr9aytO+NVjRgqT1okXtbhzPA G1kux3WjKYI7ryvm4olpTQ4Qq5LzF4bIyuSkmeFNDWsmDMnD88Rx03n5vntucvPLMfzA 9piimFwyJ90B4+X3FqU8TO0Icx/QkjVIrO5Qnshx7kxRD6+2EQLUp1XM20TsYxm3kpYT jIIxVlAFgXKj7Vv2bHVry/z5EJlnh/IkGdt/1mRo7QEbwmD/tzvd+cANu1wk98UscKnX UzIf+t8HAJPpHsedJyAXy8sT6oE+FxYsVt39a58Ix1SBmzH5VxdZpJNpOb2vVZbxr+JT qw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k8jt2g7a6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:14 +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 29GCAugj001237; Sun, 16 Oct 2022 20:00:13 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2044.outbound.protection.outlook.com [104.47.56.44]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hqwmh1c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AOh10g/AhC93xO6h/FPX1jQVv/i74xCWpmpr/KJ9es7gf8gT+YxfcPhMh9sEqd3wIJkOtEG4RxTzsnGIfK329UzMhd2xnouEWqnd6JbIKOBIHzvwy2MoHtmzTejBew/oLezg9gD+HTP1ojs3YJNTqQY9K7Y5JDDX8TJBnIfv7I7BONST2GJO9lvfGVh05AFMbaQYaK5cYJ7bhqH560a0pp/9pxUP1JFcU2NKgOw/U6UxA0pi0DwB7Agoq7PPj/CC2XzbSpjWY6dRUzKQjFC0HvdvUEYbOaMbm9aDwAM58Tk0GGZwSwKRlaIQL+a7d6RHwo1b9EvuN2s8EY0Iziwkig== 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=BE2hF2ZB3NA/tS40Z63Ey2dMmg293vBsEsmGAWeBTpYjRbvlUbhKuVFurPBiWm0JN3SCV+CwC8bpF6e86+NMylnjeYOCIlT8oQpDmHMCURAX+D+VzE8zHY/4Pxxm0avRLw0okmnPzgqZYAoI7Bn2TXO2plcmKckgC8/4bnWLOKBRFa5PHkg1d8ppRXQT0SLG+uXb6mny+l1nWK/kHDq3LoHBMUaM2UUNF9+pZKnKWOKNFLrlmQIn7dLnj26cdjKy0ZwdhEFL9hLleVym+9VPlV1PuAxuA7NuA+3XF0F7om3FiCklM7lThBELbDHrdK+eqM8hY2lhC4VMckAv7NWsbw== 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=Tv1uEaCO8JEMDmi/Xm4D5QJ90LJKDjJvcDi3jUbwiTZgsnAREBjqSx2NS/tbSbSPSZvfAq5dgNqW1mGmN3krDGa8ZemVeXwu9StpaRcoSPXxsnVG8zhitLJvkBTvHr0XvYVl6f/WGmy9rXsEbQbAOsIG9PuzrjyCTo5VpyBcAE0= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6727.namprd10.prod.outlook.com (2603:10b6:8:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 20:00: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.5723.033; Sun, 16 Oct 2022 20:00: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 v4 14/36] scsi: sr: Convert to scsi_exec_req Date: Sun, 16 Oct 2022 14:59:24 -0500 Message-Id: <20221016195946.7613-15-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0182.namprd03.prod.outlook.com (2603:10b6:610:e4::7) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: 37b59468-c46e-4acd-63e6-08daafb10878 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /choySbClJMK/CqnP3Jo2AifKBWxta/m4N9LymaVfPq+tdyRvNdsXt7DgTUAr5G5DQQH1qg56vEvuU5F4n8msuT3YR5qjK5jGlmzt1MKAMVkI4gi/ni7/Ublg6y9Ce3vKBYZqPHVCfCBrNPo57lq412NbPcnwV3eGoi5AbXRMRrixuYYIk4VbAtJPJrEf61NYxhMH+PiTPs4kqNUD9aTAgcb0OGCm6VHckbHm0LcepOgJOnzrP/9BNlBJMfGlfmDYOd/sywbm5BRjGFptlN33KZ1Nkwb3oxBGEEg+T33rpHSblfndw3LXBDJptVBuLtFATQfodFAnEREW3MGz+K1xjYpAJw9B4y6DsQy9RIcMnTR9uXL22D8q/IJPYkXpfHDpH7F5dFlJ+rMJQBBRQNMx6c1vokdx+omyoGK2Q1F8F26TiJLo3DsryIT7vzeYd/Jli+8dh2JGvVZs/HgSQc577uwZa7tCZapgXBp37doaiBOR24jBK7qhWmFutVLRdEHMbuLDSYImU9eXF1yhqivKdKUK70e9JPk9mjol9BhAC0thfiJTBiH0wWRW4saBMLsKL3JnTjYmo4beh55MYzCOT8OoWgjLc9ZU4bsGQciL7wPGK+cA0wcK0TnYe9/ABYDSppzLkxsdmCB1ovh9tquO3SseoTLB1p54VOpE8eJhFGKsl7c5P1gF2n/JmNLiBXCykb0Zus//n+GchdhNBLYng== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199015)(38100700002)(478600001)(6486002)(186003)(4326008)(2616005)(36756003)(6506007)(316002)(66476007)(107886003)(66946007)(66556008)(6666004)(1076003)(8676002)(5660300002)(6512007)(2906002)(26005)(8936002)(86362001)(41300700001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dnL66Ty+rWEHkTKMwF7NRZdvG3vjiTEk5CFXSChp8XCfmsqsnNSNetQKnqzUxTIGKxzurgPkGdRC27YFAIW0EPnlgVk4fWplWsUWxK1w3pfEARKlOO030MP3Kq1qjbPIKelNi/L0TRbAtGJG7AAM7huUF9jBrlmjE8f7cdsZeGZUzNTKGmNZsQ2nLhzawyZwNTRbPJ4WEDCM4Gnd42Ce0X+QURdzwLQNx+yJdEu7sW6JMGJNm7Ijx04r23BCkrSjaq6iyjU0TTTuu/VWXcTddK/0UzNzrm4nqCiqO3jFBCe6NjTxdruQJycmnoMtdSqHEGO8AVAQcpmhPy3OvBJaR2HynncjlxaO6L2qBiumndh7fFt5CQormapoQFbeBgQd1cddmEI4PRchMMgpf7WfbmNaNSG6/MQYSvRlkmUfJ7aby5j6r2d3/29/dLlHx735PXMDkXKH6t+q7EFP5bHGHHtdgOm+A9ZdBxCADGD76xZBUsh645xvN2ZujXvGwWA9zQJ4h+uE/klrAtVRLssugMZeZUon5A2xqhCm94jDFdn97csN975Xp5wXczFiRuQccHdr8hOT8+X506+FKEYxH9QQjAMC71eaf8JjJ+f4Tj6kb0V4GNzxZaNOeOt2r37o1Gucv2N/tNBdz+/uFzrzRKLbeOobZGYu32qwbViEGTz9JOiIJrEECiieDRu9XLckT35ixKLL9QAoOfN0q2+ZBE0tMFc4MX1+bfUuhEQnXt6tmBLHPP/wtD6cQdPAsMbbVd9nf9tqURrbcV9Uc0HcKbt8EIkgFeeHQUYhO4BBOzxsIqDPcl2aLQeavgY8Gg8fc4C52EGlwaE4AgDVGx5nskK/TgmSmzH6DKznYQ/+gj8pLa7L/+AdjF8S3khrB39g8TE9mibVnU63o3cMg7ZowVU0uGj77roUzNj7+kkGd11+uZpMHvoFBlEiZIWT4u+38W8Oklv3mBne5VrhTHahNKmUi14D7weTqbadjuS4U+eGYC1rrhcZgVbsuBgGjezIKpuq59yT4ynP8b8af8t+Dn/4CDWD+dkpQAftPiW/wXB7ANGTOizq21+yIfnYo68WEsw+HIL2l5TMewd/ou7b+QQY63A6AL4QjzUiBOL4t32MI5K+Rqmt75wyxz60fRSADYhnfYWFd6ai0pUs1MkBrtI0X5IGNckyLuRY+XJ9GlwpQMwYCFdHRdRRe025WEd8ryYYNsDhHxUTJT2Saug5WK1Ye9ECginsrQCcYXj9pcbljfxQT6qU0DWaASPmTpQdoFfJdPDxrIvZzvPzTDLibpsfHVDtkE5ra52DnGcMNJUX2AzEavfaimrxm2kKfPC7n6Cif5+4jOytXHfvlo70Jmf3LWtViQXf3W+YHb1+EO1wLcVvQAK+ygeRmPzkKnRNZ+zaiEsWKu01zjfYKgVsX+dYLGngw1qtvMTi8CYJZd5FefajUcp3s6hvzoCOE2jqRSWAKS1IWQbDQ8yPqDEWorNfXjL95ULwJSrmqEj6ToB1Iab7hj4RIrWSRegW86zbjhOGpamr2KlbSLVjRydGioPLinKxvCvY+5r8mwKfMHwChv0yDarFi/7fXRkrPnReF//0QNcGj7PFXHkwV9nd1A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37b59468-c46e-4acd-63e6-08daafb10878 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:11.4557 (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: eaf/fg8gZVt/WmtZxbFw+VC9e4Cfx96QpqWWUNc1FZhLEsUNdOXpGh4lgGRZYcck0Ftqz69FvY9xq7qLIicsT2AVuxk6qgM72kckrhVjAbw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6727 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: SWzN7yM61f2_zxcq0X6PTJXYmc4LWEN7 X-Proofpoint-GUID: SWzN7yM61f2_zxcq0X6PTJXYmc4LWEN7 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 16 19:59:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 616397 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 17D0AC4332F for ; Sun, 16 Oct 2022 20:07:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229811AbiJPUHY (ORCPT ); Sun, 16 Oct 2022 16:07:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229729AbiJPUHV (ORCPT ); Sun, 16 Oct 2022 16:07:21 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A97F32AA7 for ; Sun, 16 Oct 2022 13:07:18 -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 29GJluNm004999; Sun, 16 Oct 2022 20:07:08 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=1Uhvj8rQMs8pDT32ERQNAsXPEYVrsSTe7MwGrDKLFBn+pHkOK37LEVF54Ek7h7nc1oZQ TtqJ99XGygrK3dbyTC6A1RcV+n/dcLOt59oVhmcqHaKZ9l8giXrqiQcstPgLMwP3NGwd YbtzDOvpOv7dIjXTOwiy7nyZLV11hutkkDH6wLbLB3wAuyDTNrHHz/sEI31m9v0Ztsck EXfWP1hUyURJWULpuBhLm3RGWKrfTJ661ZunF/RbzaNr7fvqztZOTH2t8fakgmqnYBXA deo2ZB3E5ZOKFrmZG5VruBzpqd9T+R0vuB/DT4Cj08VmJoSCZHSDzAVj/6vmErLXb/K9 SQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k8jt2g7fb-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:07:08 +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 29GCBW7H029464; Sun, 16 Oct 2022 20:00:14 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2049.outbound.protection.outlook.com [104.47.56.49]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hr84jbp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ji8uMJpw1axilRB9lHdYYDHQ7TBzaObbWJoPp3AlZG5lpbkcWt84yfPGNGzjrJ4L+o3ZgJVirVnepPveSbwvMTIuF9vb2T7IEsQuzFGaoontz7MfBwv84QLYZ4R3uWsLS08TGEEqMR6kTcbbp15d5iGjCWqGnY8EsdKKnFkzwHZ7ZfKnVxl+xw6dPGToTIHlTdfS2uNEiEt75OGjIu9RiITwAAtI9MGOPRmJ5pOY8xSLWpYStfUG4YwesrCKh0GSV5nA3EluJswuQBsYHPIm37XtlIFAvNW0dibyEG17waFHy7psq8NXBFB3FLkRpsZgJBV1h0TrIilUQpA4+8aG0Q== 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=k9IO789LCoaaHgI1oZ2WHGOCEB/XFbjAC5fR3iLqzFSlLP2MZdPz/Gi1WHwMwmc5DD/GtoyrE7AItMW/CgR9XSH/uV+8MKM+8zZKp8StEIBQN500RfKpHn6qeV4pnzz7Q0pmkHF4RLeOJ5H1HxM1/5fiz7fyrrrV/A/MQGRZUtGLqTGO2YtorrkID8pctEoQOVzQ/RHgy8IsCkHpqpygwoBbELb+kvie7yfcTv2C78wqEvODDvEP8hr8VrZmJq1YoMPsgfeoRhPBqe4JcdzDzByVm3BxYu0Bet9lTO0DfOkFTtPobXYM+JsaOcEHrnm5URsGSkWBMYZAmbize3CqLA== 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=Whl+sP6OfiiiQZILFr+cWmLw96mygbuLFuJhNmL38HDER5ABHgJermDue6tUVcgovQj5O6seWTv7LTnXpnwg9N397Zfkn/rBSenpW8MS4sgliFwc7oZcFcYumdvSxgiav3HGj05G+BW/1n8yQyJnCYA+nVfOTf+I3ent/Io4uro= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6727.namprd10.prod.outlook.com (2603:10b6:8:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 20:00:13 +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.5723.033; Sun, 16 Oct 2022 20:00:13 +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 v4 15/36] scsi: virtio_scsi: Convert to scsi_exec_req Date: Sun, 16 Oct 2022 14:59:25 -0500 Message-Id: <20221016195946.7613-16-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR16CA0005.namprd16.prod.outlook.com (2603:10b6:610:50::15) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: 7f6303c9-224e-4110-dc66-08daafb10979 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3u7uxR3gK6AecAnML4bA7rwtWufC7zrqbmgZwf+LAsv0MYpFsUB+UoH4WAed354uo4AGL1KU3UdXMZAua0+v/XFj7GeXNkqlirk24UL7mfzJQH+GWjqEMYhXVlvUKB4p8l/Y4E1NiJrRx5KLyS5sGG4u3bK1BAhy8CbECwfrO/hmtNDy9TKGJ8oPfN/GrcnKZSlIKSCWAmLO3FeD9YhkJn32nU+3+wD+Ey/4McxsBTZTt4L9M+xF7e/xlaCi/Nc1P8yhEqTWDh+795hXkDfk8YmMqILO+FQNhAPH4NyK87vgfukpXuVbn6zmC3EBnYhNzEMppIDIG78C97PnkkkjscxeWscyJgiOI3HFV561bySq4yhcCnUtRg6g/po25f0ZNpRg9tn4VZ/p50bnF3z3RGBoHhuIT57TuV0JxGgbjjUbQKdksdrKTXabBjv5GDIl7zjU1qZfdpcqYpkFAzUZYekyPOnqcNd6DsNfpL8jpHXqyMtmR1609U+q+H0lP7OuudwNISg08lzigODe341fQxx6n3MFoyJmSIp+S0V8FhklQlX5cJY45JjDgFQegiGgNbmaKX/wZ+dNFmgbnCC9iQ+mYmwPqh9KdpqydoazcOvUxi//LaBJNHs4g6IvSlNJTAzq618gwrJeGM8kNbFZcq883IjeaBJrUsnP9Tr8RpJIlo8ERqeL151jGVbifjwb7RN7lRRqJb2oVAUXK9XOYA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199015)(38100700002)(478600001)(6486002)(186003)(4326008)(2616005)(36756003)(6506007)(316002)(66476007)(107886003)(66946007)(66556008)(6666004)(1076003)(8676002)(5660300002)(6512007)(2906002)(26005)(8936002)(86362001)(41300700001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nAZrOBJO5kwi2HJdfprpuqv4iVpfnvJKH//WxsQTObCA19yWT/zJ+Fo1yjmi6vmR+AUM06Em4yDz0fI4b1zdzC3xA/3Ty3jjsWBZRfJHVDrc1Kyzy/XS9ExnYFwbXV7yGpT4fNzJcrnj1By3Oe+GEJlGoBQ4z+KALgVxVjezI7zVBWb98cfmGm0B4uDq5FSHG4Tj9dt6fCXyqoqK08WApIwZHyaHAXU6hvH+YQqPbA4EK50v7r8R1pF2umy2hduvy3nlzXn1ozVZzFobI137bgTS9K4S60zjynMp707ktKSM4cG81uzs4+930yR1+Iqgx5IxCBf4ixflteeCskI8QUs9j/NJ66fQPfCEVn2J8G2VSApYCvplLOiR6teAdPbRfTMIQYKyUfmaPH+nsccjdgyCNI588WqzFcKO2Ji672pF2CnlfKhNLB8UhewKC2My7EXjewoQoiP+wYz8lepPDX8wg6PxK36NX9Dv2tFuMbUoHo+z5PjtAWj7UtkNFyNEKLgotrM6pl5j3QF2jIhO946Dbpx9BdXcQIbcSt8yICkirtzYD4vXrVYN91vynRk7l08vTYG9/GDcvciAKBAlsDmnT/w46GqA0zSHIMr6oVvKn6jTAXbRDMqETQOUjbueQpidckRrLs5gCuw+tohJuRIbgyDUZClibcwgIKSh5Ze55/hfGJ6dNKMdCQTg/BdQyneIojGVjNTQb2ADtbMPxxYl2Z9VglJw6QRZxDE8POcEwM95cgIhcu/PhOwhMmSS8sc+F+RMAKIfegu/7zJtnFfsHAI5pZM5p413ppAss+8Rgmj6EuSsaCMUinWKptQKkMhv7p1zU1gcHrDRm4ch753jr7T/ORm0SZXbMeG+DZSFWqRA8vjjl73/7/F+NaFEBDTbyNJQOI+LbKO9W1JIkj1YMH9rzdYd9lXP5Am8vaQPefGae4bPz1z+wunNGzbDHIwurKiuaARBaKs/q5Ed5AOwlhXznJttNJjBlHGGJlmWOKsKuyKCqmEgOqLjSPPIrlGVB8WVFytuJNZ4njELc53s391KcInAbPrLWGAwFL7j1LZfwBf39KJcIHG8mWZVhubIhDBwtzxo693OvuONnG2dBI2V8pl76YSbJodP7FiCcI/fnyQ8jqm0VFupZ59qQqPdSCmOp+TrvzYRVBEvmrDQktjRZridwdiDvi8zNmpFP4di+gx6wnn3fqLrCNquUpXzjWlVAtWwATrXudwFX74+rgsQ16QTBos89WhxgsHQGUiIFLcooUoZ6g/fkeJQsz+QijpFOarK9wE6cgXaX6eGCnQbojNYqpyHS+tp8x/ORcFap6BUmvjHn7fWEudl6miivt3C9dXNubMc4cbDjO2kKNPzZMWoPEFe9TUOcnhGnbP59VwmT04Qlfd9ox+lgSbe1+J+otkk+yW+7wB/Z+XPP2R+Oja6X1pG5FUMRvpios2UJjEFgIupem0btPvVaVRKQ6jXoW5OHXB0GtckNYJNQDQJFQVNHev1LBZHwIAWDpc5qhutF6ONzljrtyaEoYfZ+qxBB/5rtBioRZJNjhx/o6kmz4Akpap2ukCKaoPhC1tA2xpXxlyZiF6m2nBuDcj3sHNDE+5euZ+KhXK32Q== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7f6303c9-224e-4110-dc66-08daafb10979 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:13.0493 (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: EV+4Epgx6XXw9zuXHLY7q0Pi+Oa2gebpwyYdeOpaFsQNHPXe7th2t5jEpNaitZBmMQSF2751JpVoSh0FDNt2vPlOt3oLua9vxsyJ1QDyDX0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6727 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: H_DUIvUrf5VhyoIvc90dFcGx9_KtxyV2 X-Proofpoint-GUID: H_DUIvUrf5VhyoIvc90dFcGx9_KtxyV2 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 16 19:59:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 615650 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 4BA10C433FE for ; Sun, 16 Oct 2022 20:07:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229833AbiJPUHX (ORCPT ); Sun, 16 Oct 2022 16:07:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229811AbiJPUHQ (ORCPT ); Sun, 16 Oct 2022 16: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 B6E7532A87 for ; Sun, 16 Oct 2022 13:07:15 -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 29GILn1l004100; Sun, 16 Oct 2022 20:07:09 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=RnUSxlfrGNp0lyeCND4UoerUmbY2JmgLXL2pZhEzIR+dKdmE8eJ3oc/TEeUNBWgJpG4d DJK69PdYwnD+jYxlxmvD4SRjSfbk++PpnohtK1tidlJxI7f9xujY1hgIjM8SEyU863kR ncZFCKKZQ2XaJajfp7MJcMolv06KhEdHdW6GPVjicTKT3ZouwtXmdb2YJAcStIMgYmp3 iV8gPFNDYEIsVLJK+4BvPtQwIDbDqFl1x0wwgPGnN4yAJHeCgt+ki/q3xvMXsEGfTyd6 lvIaX0f3rGMWyGV3ms74OXa0C2iHuoZSf38p88WbDhwmWLXXLx98QD+WvgBgV1GfRoOi Vw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k85mfs61r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:07:08 +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 29GCBVvL029453; Sun, 16 Oct 2022 20:00:16 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2048.outbound.protection.outlook.com [104.47.56.48]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hr84jdw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nRJyfDdfjigO2c2YSmVmQJ9ltRWMHuutSwfXNzYLvYXURcgKAkAfscXMRo+hlPVjoQGid3jj8yLys5YNukD6Cyr0Ekryk1Yo+GDKgXbEmdXoCK3FzcYio7alGyGQWfM3+D1AKv+PpEQV/BEcYNiRl2rOqCcNtzYM+W4CLpADlCI5tGXWLlXw6F36hNVWZKCHVTC5uDmMksQ2kVbFK2Rv8rO2xkJh/F6RTNqhSxyQ0P+/HDEVfHyz2lhO3dt6JmmPSs9N1UdKjzXEj2WEFBPMG+mX/xtd6elxjhWav3PXfdkIZbdu6TnlxHHxAbCeu2V6exmnNoqLem1hjOppVqc2lw== 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=Kj6Gd+OSSG5qeNDH8r0x9ZbbKAQzdLfI7awfrYjcZZqqxdyXkTyqK7BhquMgBlknFSwXbi1faMCCVrLdA1LNk7uob2iU5ZBZinDOWwuFe2jlM19+oDTA8YpWvHFXaZt5oysX/Y/ltB9ulZ6mmutuvxl3zp5fUQcLP3h3JHJSrriJTas46zCTOhvKB55fCDs6UGpWOmtEFMg9Kr13GCQuBClRe9roaC3JjOZPBjYlgwxOehKEHHs6cLnzzupE6f7WWdQ+ZduauW3gMrQ6HgJYRFpZTN9OYH+yufOKT0/oy6m62tTIZyOzx+hXRFkcTiNiXg0mKZY28CIChE0CFxINQg== 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=SrxhaJJ6yZkDXmZGmsKUp9UN1DZdnExyo2aE7+2QiqCXdKy4vM8xICdjgAXMrRH+rm8I9fdPnJbO2JuRCZ1fi8xtPBfjff29pF2XKHb0whGeGIEq3rErMx5AWEJCsKqLC+ogPXpP9D60F+8PE2N8hPLwhYXC0TmGtpwYjURTcxg= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6727.namprd10.prod.outlook.com (2603:10b6:8:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 20:00: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.5723.033; Sun, 16 Oct 2022 20:00: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 v4 16/36] scsi: target_core_pscsi: Convert to scsi_exec_req Date: Sun, 16 Oct 2022 14:59:26 -0500 Message-Id: <20221016195946.7613-17-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR07CA0047.namprd07.prod.outlook.com (2603:10b6:610:5b::21) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: feb32b83-8425-4d90-5701-08daafb10a5c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A0GkUiejuNKspuS2JICY8wDnb6jHS+9fpKCtxHqGTv5FHtQr8Mm/oqSUSuEDF6Q9dEBfvKVGzGRj3EGV5Q5030ETIuqTjFWDPzwyk9zG8tFXJNl8oCLMScnDCl3SnSFL/uqTrma4jNHm7SRyPJU/ZFwSyBG7xH5jdyBxUs1WTwsAiGZFTo87qtXG2dhVHkfkVKtGHTXM+w1WvgDsl3zsfPKw82AIc8XgL+OjtLQg7EMORxkH1iuGB6/5ViDMQbxSfdt0kN1MuubEzY+eLHl/co+MJBC2pQh62JYTmDauNMELIB5Ao/DiT+ukGO4Eo0mvfmLLzTv1dMPCdYlJ9BL0NjiyYvkvPj8NUPsMSRRJvV5i/YF4zp/XzROtUi5Pn9vNlJ4P5OdRCNceN117nOvs407RO9I4mPohpzhzTXd1/kW0uce5TpExLmethsxMDj9m4jP0U8Bn8LjBmRq5kA5WdhwXvs4aVlJGhkJ/jR3eVqQF1Z+6SzbUkObjPEMc5nAKX0Z1Uup90cWj+oLCD0YUiF+Yj+cqLVjY3X/+WKAZ3eEAIcjNSwfmMBIO77VRNHf8GLsLN+GO0qv1FJqOGyaz326YmfE8rszQRmwlDHWATxL/FMyjKIvhEoBzLgh8DYjg2Sx+68ICpkvIxP60jJg4wBs9veyJWGOoEiZ+d76D0YbR1XYbSTcPA/XuuDhwfLtlmEi4OP4OmvSdnRubZpaVcA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199015)(38100700002)(478600001)(6486002)(186003)(4326008)(2616005)(36756003)(6506007)(316002)(66476007)(107886003)(66946007)(66556008)(6666004)(1076003)(8676002)(5660300002)(6512007)(2906002)(26005)(8936002)(86362001)(41300700001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: n61H/gTsZR+TOg3aJ4pR1/NQqDeFVxnoeWP/PFI6FgakzyqcITlF+zefitHEhVMviuzgNPuN3FwiP49j2XZS+Ia3ZbzzRV1r1b11qkFmkUAgAlNXMhIRQ4Y0Np99ptYxBQkQb2z1Kn9gaJTA72fWivHanBcxJfIZtZNdZQlyvq66R+UC4Urnj6e7bX1wXUHZgdQnehPOcuOw7jn3ul1MxGYS6FaRDBdEUxP8QD9fEujbp7XOGcy/VyY8hyJD/xmuEvoU7H1HG+j4doKgida13AU7IMZ7JfruQZKoRIZeBQzo58iV07RnVCwKRgQPyCcOQid8AKBbYOUHRYN7VqcI0mwfDJ+kOr0CXY1oxN0h8InQ5BXoeh77V4Ya7e6vWqRijgqGZjNMXpkEtA27MBxjIGjiUBGj9eA+P8JD0xzv9jyDAryKdz4qaTUGkHqtJRGrK57+PfVJIYkM5QzKCnTsX8iuW1nsL7KF3YCjd1LXTyOpvsOgUfKU6rXxxXxCXZmSH8dmifeqN7zDZooG8nrMNNLetb3khZBjCfor25lm0/jfNPKsQ+vCGQPjUuFxRA4xSPG6Pkk2wlN2rOJioHIj94NyLf9Actudspnkr0ZP7jc4fj5wwj3GZr3UZsV/xowaReuB0ZaX0wSQ6cPqPYxC7lltSP/xjOzhysBW2l7IN+EOfQ4k/JyVkGsmNLdZqZAgJBN2h3z7bvfAuqtxKe2MHWSN8U1tIWP9Bx1e5btFYTa0oZOLh9pvZWH/yFygiyEZC70kYN14sdxxQJmNblm6UuM7fxvafNOgZyApIgkDET6HiYlLxbjslKsXskKBRY6SHGssTsOFaJai45+Vb2IQp6JTewrDuY1dDKkszp7LLjYFyVQRfCe9a5k8TiHiHrJoDU4lTBZsBgw1Qfzzcuukq8zqo8KiVSGdkw3CtpuaFs1BNtRGsb/0u2OjzxGZns4baW7imoA9cImF50BzSkSJeDRhoZYL/R/MHfp/elb6HzLlmY7lM1l5J8pcNl2RmPWMKTH5Lf1T7zjMqW5YMBQ4rhBn/Oeqxg0Nt0tK4TxqXNFZv+pcDXj18ZKGX5ey9F1mz42QVSJ7HqdRHMg2dQswwnjKF3k1RkRLC9regdcWxInHaoIi5Sp3Q5n3BZMMkhCNuET6mQypTbBHleqga+agRZn4OjGCf+0te+R4Ta2MHjwlxo/LDPTKRQ7HG59IhmQJQNTOTBNUkzUCuKAehNc3T+i3hlORBOH1Gc4DQ5i4JH9rcyJrQKcd8neiBi2TOlD90p3a6M2BaE96umXtN7b/XbCAnmjYigJH4PDJI6SlLnUu7MI4H7HZFZU5zTyz+3kXCQF8Q3lcK6t+o6x1Utkz5c0kKZPSKfnJAjpTpIG6PvfbpjVllkxL01lte/U1RB2mFn2FNDAoBvkQfw0dwKZbbjdppgnly6Sg4xF7tRR3HoRxHXYdEn0U3VaxPsSpJmNb04DUt1kxQwHFpzYtzdlTQb3K09/zqenO1NOffx/yAVJ+NCOOMjfzOLKoAbX5YDrEMAx135c6ekdBHqTfinH8K3bsVFmZFdUhttxePi0SU2ubwRGEvN1N89wsw+c/jXPumzW5UBdsawlYogc0SSEM6A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: feb32b83-8425-4d90-5701-08daafb10a5c X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:14.5648 (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: fuwmQv1A9avW+TjC6BOJHcuU65a0j+MzMpZI0516TBZrDgCZSoOoXsSn74nlQWgLTKc4ni1CeUPve3xdw7q5PU2WGPYmJSkQ2CUBUvzR6a0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6727 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: IZOgqXYNOsyyW8kkqAFdvL4Ojt5-hQUY X-Proofpoint-GUID: IZOgqXYNOsyyW8kkqAFdvL4Ojt5-hQUY 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 16 19:59:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 616396 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 92C6FC4332F for ; Sun, 16 Oct 2022 20:09:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229643AbiJPUJ1 (ORCPT ); Sun, 16 Oct 2022 16:09:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229866AbiJPUJZ (ORCPT ); Sun, 16 Oct 2022 16:09:25 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BBB4E28 for ; Sun, 16 Oct 2022 13:09:23 -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 29GJlr2L004935; Sun, 16 Oct 2022 20:09:14 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=vQSjiKBK4f49xV5oDt75kw9RWHXCWRETzdyeIl8HNwDtVz7GScARKELbUwKOGGYf9q4f 9kneKMwupNQaQusQEMNQTjjALqLfCMJ73LrJ91B7f8u1Uj7MXKjE0xJ3Q2nCq3mTmqtt 5zY3nskskiltmNpg2/31A/nI/3WH3iw6tHIiBH4+prapEpY+9kJO6/q/UXbSpZxFk3Q1 UnTbaH7oC2fV83pJoxJ+avFiapmgu2vXJOESZ0uwL+OHSkVUe7bsBRQ0zLn7aVRnI6UQ 3sULIHQC87eQSIQdv8lO8MPbNU06tCIOavWwIDFbWtoraLXfFYlVJDLvTHgHFVu+lDde kA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k8jt2g7h5-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:09:14 +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 29GCBkcq029571; Sun, 16 Oct 2022 20:00:17 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2043.outbound.protection.outlook.com [104.47.56.43]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hr84jf9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NtKF/8rLQ8rDfhwzfKtO4kdNpU7m4jIx6fpa1RhzOclzbX3pNmtm5H4+kt5fd9Elrx0SVK8/0LacFtGfVQ2uMmrkqAHJWdIN9hvMiN4qQ5q3S7OpmAOxzK0HEGN2LciKsjau9MLIPuTiwYeiY9oKsnnlJeKyqMNL8IhHgdYWmKGDd8Ax5agaMlupxGnbvZeggLbr+Z6rpYpWFkiOxrhyf6kCm3Hoh5pgyIkIQfiWoCpuiRKshzAHyzxg5KuKyuN1XcnyMffXt4qHqCFfoYutP4EdSXEGKVZPTxK8Cob8E6wv6GDGyMAvPCH0ax7vjRY4mkihlUg447h8oHZ+htOh4A== 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=bNxNUKHvLuQJ/I/Rssto3vElOIVuHYL44EZ831MsSGBSbzrC0xvC5mygU0TQf5wEtEJ0cQX/5nwyzZUkYURGOnEHMinv3pulCYKZS+W2pvel+69LSj0dbMSIuJ3sB5/QUB9pMLg+CPMBF/L+udfgi0nbM76nSWaSltummWEAuTHVxglfkaYSUqmz/yFN2FjhioFKALVAXMlQgrs5QJbzY2LvPOHGs+pMnI+moXVd1HplteIxEM77vqIFIVE2+s11npnIfHQ468pfyU/869vV7Y3TLTntVc13ApnMc2JFNHP5J4n/w8xClnxgl5NZuVx/yMHbdabXUuiTCw4lF76c1A== 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=L/pNLh+wklqNjlEiqJRs+E4vpRfA6Ff0IBBTTgdGujkO01WeNl+CHNHuVrqjKKiROaznD1/0bXatYMaZWnOnAtGrXVA8esnLs/0ZtwhKXBZT0ntzjAjqL21nB8op6CsEBGY1A7l5viGttaUrd8/Gd+JIHekWbiTxbTVKyPoGjXU= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6727.namprd10.prod.outlook.com (2603:10b6:8:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 20:00: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.5723.033; Sun, 16 Oct 2022 20:00:16 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 17/36] scsi: ufshcd: Convert to scsi_exec_req Date: Sun, 16 Oct 2022 14:59:27 -0500 Message-Id: <20221016195946.7613-18-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR07CA0051.namprd07.prod.outlook.com (2603:10b6:610:5b::25) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: 12b4345b-bf81-48b1-81bb-08daafb10b4f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HoW7aGnc0z582NialLnPqP/Q59VY2kLEHWIivX5TA56rnUPdMQltORJOXjsUmJ53NJGChj/vWqryu5vi7FCv0YXMWAQQqFDSFslYCkJf7w8U55ci42Pa0+Q2oa31O32U1FknZ8ct4GzfpCjp8pFFOcn1tfjxX1qftqrSBI0lbcoLIVVrE/5HXKGnX3XoUpBApOAkHG4bCl+LIUiZ3jCcbyAvQWeKjA9cEmITINOhtmbmLZWWa38p71Fe80+eMwJutfu/oXOvzqoSBDzQiZ8mKoKzdHFV8L0sxgcboKlYgxzo9eYtnRtY/jr00uoMRc4X3VsjqRKz0Bwj1lMizu+RBHdfwUsbLEAk4C/FjrgkrsJZADlKQxoFJKxHbs12hqLXijT6+HrDfCXOPgyoxyB+nw6Q7kjeYp0p+lPOqOmoFQ6Cf1Z5zrHVUdAQHoDogAQy8byC+QscoUhgGHKpxuIMgxYq4UG4N5ggOekWzbCBLjD1v8PrVCxYCok63gUHRvcqKPtyorAy1XnDcjgbUybURZjk+puriehvGfR74jUZ3nx4XoW+b9h+ubfAC8K+lmoFxv0hTeSRbbYnzj2Xiyza248vc8Y0OkrlirRed2u2teu3jpS2M5Fs+hF4jwrRzQiAFF1ndtfWHqP19gTF0SuQ0ibLaYz/+VnqL/pBqw6jkIGIAsbSHtHgBY9Y1HiJ4Bfs6yo+BT0NweFfZLILntObug== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199015)(38100700002)(478600001)(6486002)(186003)(4326008)(2616005)(36756003)(6506007)(316002)(66476007)(107886003)(66946007)(66556008)(6666004)(1076003)(8676002)(5660300002)(6512007)(2906002)(26005)(8936002)(86362001)(41300700001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZyvUit9zG9dP5L3gNFw01l4oaKWpiS/r7KyXB6aSG3EShAkG+bgPfSHjvj6KsVgKw7L6vv7Bjc7si/rKlo7Q0ofncAhaxIXrs5SQKkO0YUfFYnbKC0HKbJ7HbGRARADbLBF8eDx6y+7XNQp4I8+PfRuoCYFCGJSTR0gP24hDeBQ5ZlEpuvQioOCKJ3eAXDIXUizzTrBNfe3opfpr1l+8paQo1yMgdSU/X+VIpW/wbGhNJdH3jCG0u0GWAq0GIvnqrPSSnVUx6GYVkVlBN+XrNyLxiY62IAmriC2IzykDQ+39hvUJ3JF02DXnT0/sZRQMdrpkeT1FtHr5VvCNT1ca5pUKIMhbeSRg2gTwUWZtPI3gsG+GaDZ+pv9mJ7nM+V9mtUcefzKhRVFjMvanKkZ1b9yIpfu3Hm1zJgK56qARkcKp7oUsx8DSAj8M6g4iZ4Qerbg4oWhVadUR9HNd4ilmKf0D44CC6yAO8N8Mrwhd0gbiHlhsiRNqPkLPA3kmGmLmu7TXz/T9Lr1o2R9DJ024zvmn9wWdKjAGf/u+r7rAcFIx6SWPOEVht0lWXHfTd9pBNiJrsTzahlTLpKdE8AsJ0IHJ5niXCaSmRcrc/rLH0CWlTbV2jfLWGNYKmH0G2gI5lfVySng0yHA6rXPLDIeS5g8g/IHVs1N6ijT5HdK+rGLXu/dDNBE8w1UrvF4XF0HESjJc+1/HuKIyFaWJOiAu2c3Si29q3KuRTGXdjTQgoLei+ZMzXBSzi4/0OMSEBg2T5bq00P9Qi7oavHAWOsDyX0nfphRQDV2H4n/H4QhEJAzvv/k+VPX8hv/ws1ajYuaRSFFEevO5iLnMR3zLYQcejdORikx5PQAUXO1391u+t1GChzoKE3mHG8TeEbIjEb3IdACqcGSa3zNGtk///R8Fo5kBy2HlIvp++c9e+NRQpc3OX9xumtYddG4bZ9Fxzk6cN2NdtjFceQR24nfB5JTVcsfOl8c9pXvOazlk+yxLdqMiTq5Fhp21e1XbBoWCqZ8PDY5Tu10vvqyR0+AT6FIUcKBVJsp+AhzdKkJnaAiYeKJuYd2q+PFo3G6H8KDKNRTarCEA3vQy9/jTg5oFcXQfOfBZSnxJpgNcek7lJUdYGzWkYUVPWzlTeKswY6UV/n4/CV697FTVf06r1Ly8H0IT+iRqNs5SMMhc2FU+9LvQuPJjmSJ+adJOq3AY+fLD8Ojmf+cy7T47qq8LZaimzOxT51NxsQk1gZSx4Sn3XcqHe1IEojsR/je4sFT7Owkjct/9hqQ7Aru1FVy4BC394ePO2jmFpl5NwT9bu7j9m6LVkkGqbY2Tq40oHr/XqMVMsaenYHoWeaxqz6dh9KGkZIEbCL/NCdDbmfBuKuquOH7FE9aL90215Pvsl0DY9QhXg1EAauu5ZqAs120voN/pp6u4k33V2tSwo7L5Yz1HldSevYjbonhr5mSQZ28PHGpDcIUkbx/Smjj7/FAe9tdEJ4aZywz7PgDN/jRBt3w1D0icv+0r+zQGTPu8Mz1uba74tzx85L4QQDOa/eeWrOSYIN2jp+rHVgzewT8HVvg+EKVpLPY3QyHjJ1n6UTp+qEvLYFGxxuRXTUd0roYbnXGdiR4gUQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 12b4345b-bf81-48b1-81bb-08daafb10b4f X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:16.1272 (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: v23Q4JVnztipD1qy1fKTFzb1wcJiksATUmLIQYnFYa7kPxFAg6PPOR7dZxdmwaVwrjS6AqO0eSaLju20X+xpkf9EiGEC6N9HewLy/6ksKsg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6727 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: VRAWK90wqAPw5baa_AaN7DaxvdcDtXvR X-Proofpoint-GUID: VRAWK90wqAPw5baa_AaN7DaxvdcDtXvR 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 16 19:59:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 615648 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 5A2C9C433FE for ; Sun, 16 Oct 2022 20:10:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229793AbiJPUKU (ORCPT ); Sun, 16 Oct 2022 16:10:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229729AbiJPUKT (ORCPT ); Sun, 16 Oct 2022 16:10:19 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ADF611C15 for ; Sun, 16 Oct 2022 13:10:18 -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 29GJXgWk015507; Sun, 16 Oct 2022 20:10:11 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=R5w3RK0WapIsc00+vc6uEXICZiS5yPT22GrP9KH2dTpdUUX9zakypHMI9iGc+j8qR0g3 Xj4AdKWb0ZqPIPRSSC6u4S22dvB+3rt6FKYUtOIpn/JSO8kzBHCKBzyhv1BLJcIlFYR6 cNXNsIoV8n/Y03dRVuWtTt6BeaEVAZIrwjqXjI66YNdyaGCP6QnUznXkabBrwP1thdSr CQMs5smtnvJtGuQivA608iA3ncrYlIPA4aRJXvxCs9u5f3XnBa/Wh2wdwxYOIkCSzXFV U39sL1B9Sn5ZtFHdbFLKEchkTZ2OvVswbbpPL6NDr0Og1Xydj1QEzZv05H//Fj+XKib2 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 3k8jt2g7ke-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:10:11 +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 29GCBdiv029532; Sun, 16 Oct 2022 20:00:19 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2040.outbound.protection.outlook.com [104.47.56.40]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hr84jhd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kyCpcEtYKBJ0jT29dUx0L9lrcgAPitGqMBm+1ZSimmjAKwKoYZbp/HLRu6ObpAwPXq5eGz5uL1QCzYCgqVGIbuWPAplaLbsXuRnl95jN71+ARo4/WEYaOc+Rdhn04t21luX4JRVzJ7flfpatGyBVF5Rh62jtbZDYjskCDyuVBFayB6/gtkcLmhlg6AU8n683vJ56kDACLw28oMQQcVhhclTpLX1279VGK3c+Yin6zOW86KE07tBZbwTXKhTyv40GzuumKXiqh15LClljs+nhBLs82XYgocABPEmdeZ+pMYUV7BQQyLMjvtbpUakFdEwQUM7YMP+NjoJZLlA+KHgPig== 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=cciLO69lBb+ioDz+eM/BOmz7PcbuU+vlFmJZVqJCfchCMNP+IutTMEzXmT0QB8NOGKcM7d6/yl8089dwbYNLi+HzkIP29HeeI8vYAPEoc0NkFUnZ6btgfKAHchpUon4qJKRmJaymsoLcb6JXeEOv2ZaSQBwmd3vs5Ky32krFfPPb1OXT7S4TufU3QwgFvC5ZR++KZSl4PEEo5BmWVnVlK4N+3xG9EPAAblTwRTeWfY37UDuv8KK6HPHrMmEl9STUlQpzSd57rJXY5eh1IaivkBMRCMR4yo4f/JJ3qqr5nTafFaLFgjT0wE16oH2ZMkz70e2Y64oQlkb6YDAsUAlDjA== 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=WccFZzC4dOOugCMfLnuw2Z5Cii0dCRwEaM115HpYLi17csbkbUG55f0X/lNSUS2lD6HdRiuATl3FZXvPqLl/a5nmPf4YB1AsmJZuzFiBa4mf7GbknuEKkjRp9nKQfDre1ycJf2yXLGElurHZX/p1cByjGTyo05hsXoKdheRBLQs= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6727.namprd10.prod.outlook.com (2603:10b6:8:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 20:00: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.5723.033; Sun, 16 Oct 2022 20:00: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 v4 18/36] scsi: cxlflash: Convert to scsi_exec_req Date: Sun, 16 Oct 2022 14:59:28 -0500 Message-Id: <20221016195946.7613-19-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR07CA0053.namprd07.prod.outlook.com (2603:10b6:610:5b::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_|DS0PR10MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: bf9ba157-8977-4c0f-2333-08daafb10c39 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0UnshJgJHnCy2//jio52SxXMD5sjp6fbpePBIssRV58Ydxd/4+cpaI+oeHzb7nu10hDGbvYz8C/wQISpeYsj0TOjPjG5vME33WR7hYll+aUZwMCmQ7CZr/nfvLqXEHoNV5F1ODkIItFVxylWoZnzvtkZpV7rk8SB+kmjGXEYQw2stcrRUcA4Du7gb9BO4dOP9Jc72/hRrCK4xEmumYAe1DEGITysEvpKGRkxjvG5YvZad7AnTQzufhywaBjvbkEiVeuE3xzoYYpiQGSEVqNxg8ufoQ03QKCaXIzEyDa3javAhsk+0tXB9XScjg6JsJdzsnQTfpGlsWybSdQc/VmTwCDCeyqyTU1ECquBSDgNU0nMEBcsnOA25n8tRs8tfpemL4RAnGEBbBpaZW6J46xIWmPhU89gKJ2YTpEIP7yYJLFoSwboXd6ZmpwA50zNURdLHaHLDXsqo7GBKNg2pro0OoWCphLGnaedHD02zEsJ8UhgrZYcTr5bj5q/UfV6ibHErJdwiWmzwzf7wsgW8p4DDiP6H3o1Sy++dr9S+e39tYZ4HA4KTNrs+PASVi1CVNakb7k8Q36AKyeOrepVMccbdLL4+acns3AtcQ+86d1bQK3ti2UTwyHptZmRTUBAZN8WtpMqwY8EEyD6+ax1+Ade5vMl2au2pk6gZA4vbOPajNHodKvwQHpjAFzGGf7R+RNYRxni57Nb3jdY6u3eWW1dfA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199015)(38100700002)(478600001)(6486002)(186003)(4326008)(2616005)(36756003)(6506007)(316002)(66476007)(107886003)(66946007)(66556008)(6666004)(1076003)(8676002)(5660300002)(6512007)(2906002)(26005)(8936002)(86362001)(41300700001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +kX0mxl6Vs8mPvAFl+fzsf2hZWa3P6moriGxaJRh5OIuiSfaK3bAK1abBFY/EudruywMLpp+VoAZCTAhFBmIdCxsJ7z8uriTwNevmdfY/OlIbGjf1q0aAqBTfPIGU7d5+mptXkpnW1Ywp0P1YatJuZ8MRQCTZAQoEyyCUgB1QYQLkYMgaNqEKIY4IyI1ng0RulURplfMKshT/0PZi4WasllFBhZwWl+NIUxQXWFuXrgfjUTlUxg/4vg21oLjo43DEoR3zUT94hZyMZ3Y5Je6tNlEOPhg1ARTkEfQsrAm9WU2gVUNWfmLd73YJybh7Rs7WyHPUXrRiHcaBkkEFGIjYwDpS6Gbxg85DUvT1LzG8qMMgfY1MX0FAtidQm0DZesgL7dA9IcMV8rOkCTsS8WF4IW3j+OAzW2lCDFEvNIljiTWo1rbgQXgyVl1/ugQlR5UJb9BFtSOiq7qyYcQLJz+t9q8+3CjCWmkcQ47v94vvzoVd9sIr6W30x39VxbwHsKjYNq+G3ruhV45Vk1UWFsjHwrzsQTMvdcsmgLJXdleEXAXdYkOixOW6B+XdeGtoilIlHounwlYqUvzXOyKT5WhrEvFo9MOv90YtpruIYESWCme+J1eidPliKPR96KWQntg9hpV6xRw8Dj4wiVqRN2YQ5bigp4K+veVIVoViG8oEfPtIxwS/FBc8Z48leEfpjpsNgZjz0rswvy7a8izv6bG+0QKxNwrdNdrByDbU1WDVsvb3a3ZMRjjSjVMfRL/EuZo5qrF+MRa05HwqJBS0/YW+iM4D92UGHCetDosZ7TxL9GzdRLahBb9yr7gTQZ575VImQRzCbE/7A/u/cpqFx1amVnmt6/gsmNP3O4PgoSZp7OmgX7Wrlb2jvEvu7Gbpvr1hWH62lmWyr+kcdALkNPxd+Az03l+/lH4MMznvpxDqrZn5R3k7R8nwpVUFsttP0jBBUK4yNO6YbA+7ZRQsxwp9IaxQcyoZRWeyJeIa/MdUat6yanfxYDH7J0VB4Ulle+6ntFSkyRPKPWTiCSCjhEV5/52Hg6RAT38FLrZ9cxnz+yDXehliACehhKgFDsQSqCbwb3m1OignFdHrcPHTxYs2ZtzkJO92B1FN7EH0X2iD6lMchHCsTTrVOIXg8gG4DMNVTJlk5BsaIaEnk9TjTZYERthJQxOKyWOS0VqvQS2bgH6Y63NlZT0Lc4tswduG0cMVdfOs4zcmabGt11g2n2qfsXZtFhswx6A3osPVuVMW5gSrtfz5NCIX8cmQUtxtiufO0vdUmSC2e7GvwHf5qOVmByPZeAFBxySqU9vljEuEAUm66it5KnwJPvirVfH/ARsKAA7GKfxpHjVz3UOfGn9lJqwDJNXH+2B6unaHVwYYCIMQw5rzm5otX8F3dYIgdW3vAptz6vz88FOQKTVxmw6fFMVBrrNqTIW2HbBnbreVzs9IvYKidtJXkLBMX8QooWfM7fOtwe1pkQag0PrD9hYjB9ClsOwTSI2Jxj+W6QuLpQGUJQjuG5+wgicce35Mc2fiDbnUJKbHCBCQIGn/efJVrjG4xkP1UYyIv5LomkhJ4cKA4VYHLNCtfjWBFx6mc7qvCXiGneEMR0OwxIy8yZL6g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: bf9ba157-8977-4c0f-2333-08daafb10c39 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:17.6739 (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: qNdM+cZg6TTPs/RuNwVEG/aTqoGEU0oXlAGNaNVuHdOgkWY/U4TDWVkyGwG5TzAPWnZDCWgktVCM87NUpMIdLZ0DVCnTgedouOKfDixGsTY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6727 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: svVIycpQQ4NlZAHumVCbsSnSD9MZSDg4 X-Proofpoint-GUID: svVIycpQQ4NlZAHumVCbsSnSD9MZSDg4 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 16 19:59: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: 615649 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 0A99CC4332F for ; Sun, 16 Oct 2022 20:08:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229562AbiJPUIV (ORCPT ); Sun, 16 Oct 2022 16:08:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229774AbiJPUIT (ORCPT ); Sun, 16 Oct 2022 16:08:19 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5CBC32DBD for ; Sun, 16 Oct 2022 13:08:18 -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 29GJlr2E004935; Sun, 16 Oct 2022 20:08:08 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=JND29eGf9IxAGDTvlf4hBDaRukBBX22Pf6V0wvwADc4UxL6geCIS1/F2FZG5LSlC2WQi Dwn0+zri3ru5+M4uY+NYzCMhorAxg7MAikOXPWSlsKzva1JyWmo6PPoaKl/cYCaFaZNp JuPV3d8icd2GEUDp79SkF1FAP0xPs5OVqP5rhBvGRqIjU1vQAtsRjlubJG8WRf7MGb4b I9Tr1ZjhwMgk41UJd9mbOg0cHs8yttndWQbG1wjjhMuab6m5IJXYGR/wG3Ma1Q/7UFcg P2K1avaukGjZYCLCe2xn9jr408hV2HoPuRiKVO7sWQYkaEFR2d+xeh6j6zJEPcyRP7xd PA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k8jt2g7h5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:08:07 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 29GCBuf6029646; Sun, 16 Oct 2022 20:00:20 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2047.outbound.protection.outlook.com [104.47.56.47]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hr84jjk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I7z7I/iOiA1lDmdsiwngKP3XAOnF2P7JNfIiRDbebo3+t3qxUc3/eRDorguHtR1/GTOp6YxhjofrSeyID1Q/IXGi+6o20kyJh0CyH1lKGGTg8fklvHlstjATCbduPkUqVZAcS6NqrnxohMtA843OJ1QFsGLMsngg2tZM9NRQe+n7B5DGfiFczHnBjYay9euDSk7qgYgI52eWtJ2Tg+dI6tIEBLW8/MlpzlIjEBsbv0H43GQZlNqnw+DpTEaWW8hvMGjzVIVG/5FrtDTGav0w3xcJ7SPC5xVmENPJ3eovNbOkLQ0sqVTm4iyKvl9ZDKu3FKORFyheZVtryIS6fG2RAQ== 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=UxwsyA9Ss6HWe/qrasQ4pfdSnhEn6/AlCb3esTebAytJ9Fe9YX66iM7byWL5CNcGqe54fBUwQORP/EL043uaLJzdhk63bvhOR6cG1y5HxdDPbkaxkpjSVw++/lu5Hm7Mwgvovn5wemBuLNxZtaeerFRXG4nMcDaMj8RZCIC/syuwI/LEBP3gHbpNh3AzWZkq28+AGUoIohcCOvey/ev164O0j2qVuiieQgyWNgGcU8Qfs/5CdJpi+VYTnOUFSYy850ZD69881dbE56le86twraeXGA4tfKzOtikV3TLdkgGTwSAvfOG6GkANwx1ugICdh0/W6BK/Q+rnV0c9p73uTQ== 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=v6F5Y3bp/D0VeB7oABjX1JfWRElitBpZnVdV5KrTOZikQXacBsFkFEcVzfj2yqDeYHYFNwX3r93g3PE7QBGsCGTkoM+ZGHvL8yuzgv+mcE/YyrIQ/E0n0qpniAzn1cJfLmbP84YkbWLxwyH3X1PC1KvQyvC/W1mK6sZy/JC7vWA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6727.namprd10.prod.outlook.com (2603:10b6:8:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 20:00: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.5723.033; Sun, 16 Oct 2022 20:00: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 v4 19/36] scsi: Remove scsi_execute functions Date: Sun, 16 Oct 2022 14:59:29 -0500 Message-Id: <20221016195946.7613-20-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR07CA0050.namprd07.prod.outlook.com (2603:10b6:610:5b::24) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: 2b0c0402-8b74-44a5-edbc-08daafb10d0a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SBfmrGQnEpgBAwqQ3i84y7d8Vb+KM54ts/sKtOgaNnPG9KD+0wRFQojyOb1oBqRtjAvxb9faucfaD3o29/m2BN75Kwd+38CwLj60QX0e95Brk5nVnfcYGJKTlQ1ZgyqlWiVF2FTIsPPkAEa7o82IJEv9i3lxGqnTp4vSDWWsNxsuwdm2MvFFPP+Lsnc/mozHZCVq50+KT4kTNqsSQS4I1XJo4Rc7YQbkAW2uXeiYZ/dJdgP6ARCODjqID98dIJmUBLEsbaYSO0tPZi+qm8r6nsbhHbkpHNVH/q+2VbJ+3mUrZa8spB/n0DP1hpyjZVWWMX8gQCbQCP3HWZZOq2d4eDtmw1SYXxuR8KLv0sjppu3Z9aWsQb7M+1GU5Kh2Rqa/lw9k6f+ShBkdy55Gnalq3VE/9ARXueAa/OH7BSVtK8Ud0GLTMGuYNt/QFUlKWqtiSGuJYUYbcjEvcEaQPdsYFZ1kkI94t1K6hdp9Zv5PhI2awdS499AVpBWsOAZxV0J6PUsq111lkfG79OVnCoguinagr2IA9JU15/Q/ZQW+AKhbKcmysowOzwCXqWRbGE9IdC8iBZLaRCcJe/iwEPAEC8vMF2YNu8LmkgmzqgTYD0jwKnFoAfoO9u16/ygcTZfe0pzD/+QHzxJz8Qw4WRycNfrhlf/Qwkbcdn6QJlKtu5abJO0qthYCktRsCfureqgdp9S/j8+V2sOEUYe5tThbbA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199015)(38100700002)(478600001)(6486002)(186003)(4326008)(2616005)(36756003)(6506007)(316002)(66476007)(107886003)(66946007)(66556008)(6666004)(1076003)(8676002)(5660300002)(6512007)(2906002)(26005)(8936002)(86362001)(41300700001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Eg7wnwoS7UaFLVLNUP7tdPTutHzW0pFRlXbpMcc3fIvyv2z9BD8DunSfmaWuTxLU4dYmJzReT65LfZHdsw05gt6RMMnfzj7Cqi5bCNkiuIhRhMdaC7gNPxeJ2cdsnXcLAU78NmLqFHIhRUzdKJsFs52UaKmt/Hi1a8lj5ss+cxOEsaqC2EsKOXzPy3DK6UafdGYHfJWCbL6iulcWQ2YqaHFphBdkaDIo4JJ4ENryTJRrG5R/vU0fhygmZDxLfDGuNpTwwcjtNQxMmwXenf+R20VRQa7zlf1nY+jaQn0l45ccFyjZXtAgz5U8360NxstfgTq/YpOCDrIg/tAZUS/eXe9i9pWtlUS6VpjKVUBxumvZw8Fz/dJS2EFOfyCncPdH6UBSjX4fIUXH6yQCFBzq83uU8UYQy2aAckikCy3nbay137CsKhKkLHASwSTQPpQah98hDlWNW//TZrpyBOU+DDMsnzpg/HAvUVYyOFiiL18gPW39RIDUUbppWB8/VpAsfzPeFnqjbC7yv0QZXTARaRsjbBdh9VASpw3y8fxINv41kbiXb+9tPXjvq7P5M8xikOjAYf+tr3SOq+jJuy0DdQYs6+jf9QbQb+bKQNtFBzxGSu9FCK1Xx0CxdXwLzZ32idM491XqfaYg23Y6Cnl9njoe6/kxwLHz7zLxKkfny5Vc7SmybtDzmBcMEvRJ9X/RIgLjdgEm8nCj5fnb0sFlMh3hhUOlHQehJBTdL5HsiZIBw5sMVholQnz1JKjcMUnQG97upQ7Z03qy4Ae8haXNoKzneAH6FRYgTe+BihmWTjVNFXZ+0MMiPxRWoVar0T11vgpVGk+5rqzeZdU3SLXIZRBNUXEnMpZzQUCRfMphQ4Bh4o8Q6M8of7PawwLs0GhejuRU8oE0UlvpIUV/FflCVbGj336k/jI0+EuFO3MOBDVZn3N1G4j89mZMkY4MCtNGQIydO0L/RLCpxiUjwiU3VkQv5NTpivcm2gZkoimsbl/rUp57Va3grUiZkuI0QuAX3+YqQlw+caTlDqpkseOibnluLsPBM97/pAG4yo2S6reFAvPACZLSvSXyHETEAtTi4Weam0DxUiSK1fj2HWPn1IoZEZWufyvB1CGnXYNx0gID5BOegCachp9m1IIAhoUnoRx4agE/bZgXvN9tklp34I2bovexrjtoETASolidREaOnVKqlsWfRcnKfIA0hPR1nS3osipak0gq9GC0epjZxdJ3XA3I+9EjYQMaSNn24+ef99Q4IKqKukqkju4nbUwxFntIXyaMiHRL7aWCDKP0XWgQzdnSGe5x72HUJZ2wtMe3RZTjtCaT1hDWW8AdV66s9lvkiDuzmRdDRTRbaNukpsLYz+DUI2QwVLHcfL90Zp9GvVHB3WHkouseDTCfQRWdbSKLbNK4rOj0DGj6yy7bPybSfCCu+UsjicIoQkMCb7Y4+HiNrHQ4K+KTffbmDEwjMB8uKDlFhK7gWME+QV82t5bEC9FID8dYm/LY0rad2NPgxBgcNK+ocrVtLwPfD7oBcTyx9FBpq64Nxlu9Sugsq9p6OoXofkLi3TSLQKHTAARS2AZ6JVhdgzOpQxvIbVXUTtWRaNEpk37sbh4WBjImSQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b0c0402-8b74-44a5-edbc-08daafb10d0a X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:19.0176 (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: gUNq26sGskI440bv/DXhDSKWJ9MmhX7e/7U6eTR6+Hx6bNXi2ZbkBT+69GDZa0VNrNsyZw4mIHs4LozO7ctvpGJO/LqiVhrL/xXcquRI6Bo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6727 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: 2luf8YEq-9IyaWTDTU7eVBy0sivwNcq9 X-Proofpoint-GUID: 2luf8YEq-9IyaWTDTU7eVBy0sivwNcq9 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 16 19:59: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: 615651 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 7C979C433FE for ; Sun, 16 Oct 2022 20:05:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229774AbiJPUFe (ORCPT ); Sun, 16 Oct 2022 16:05:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbiJPUFc (ORCPT ); Sun, 16 Oct 2022 16:05:32 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4346A31EF2 for ; Sun, 16 Oct 2022 13:05:31 -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 29GIrcaX019532; Sun, 16 Oct 2022 20:05: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=/DboAJlV7RjsQFvZaceA93eSufe7uId8X5+i5BkU5dM=; b=IJktc66ekJ1MdpkXz04UYP4uFhhEasgTAqlRAJ1AxwxwqfSlGxXYw7W0+yXwAOGzaCm0 uzchUYryYfxeZo5TAVHO3E7Zq/8EZivcctxhB24vl17TZ++w5FJVPynpWB1VMiULWgdU sOIfKOrJtAjPT5iFAj8MlxqlQWrinlgqbZAGJyWBj3ZoXO4seH97G8am3pfKeVie+xnv NIC7Ix/CnFjBuoxq8R2oFUsTguWr+f3ID9ZM3geTnme+UXOtGOdpWWCWXzSXEZgETDNp KNz57TWmH4VKLqEaYRB0JaTybyDtKdEA+V0EQKJz/Dc9hYKtT0zBgPu4gbr/ol4ce2xw CQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k7ndta6ax-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:05: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 29GCTWXW040718; Sun, 16 Oct 2022 20:00:22 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2045.outbound.protection.outlook.com [104.47.56.45]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3k8j0nc1jx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XY9n14TcHRceqrCA4FquScsqLkCJIhIqAZ3bdHJa5+/cdtWmm0vF4WSkPzwiHfjfdWtkZ/4rJhMeCmnHjPUPGNJ33LuZTlGMRMQDpaK0IOEPaZiRONVgjBQQ+Mq+vPD7D91m7s7eGZdNGKHrNWHthUGoPsCPmSSYKm5qglPRCG+ZQ6mNJivwV1xyvpdnRO0/YOPdx1bsMTHnksVGfEyOFZb6HCYKDYMZqw77MbNXIwRcH4o6cMXQ8P26QHhZImPBY16E9Mxl1ttgsd+ZCHamoAciAo7a+lh0R7kKuyR9x0Lop9AJ0J8ps3sF45u15UzJi70sVjviifDwu2rLc4wk1w== 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=/DboAJlV7RjsQFvZaceA93eSufe7uId8X5+i5BkU5dM=; b=ANzXbQHv4jPh4xtxe18qVSO3E1rCy80OnHr0kRWxyJ+Qur+dVZvi1akjBiNqxydcVDOlpp35jwcJLkz+pssCjcsTnvDvo/uxljGGu7k8970QnCxFXkJTqXiGn4QjflKnCi7Wts5R+QtR4ur26Q6uWNltl7q2gSkKw6A+LMoaXZWkp/ofVef593XQgAap/I5T8yYMbewWWg58JFJO5SzNqbp4oJZt2ASPj4IQKpS+VgGXFV6goWhQjENGovbHgtwctatEnyaJQCw8OsGMi3NJrIuEeNxYQfRYTt0NyqGDDuI8jSJXdyG/Mg6FapuK8EcW1yd2VAVGl549UDx0MemIbw== 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=/DboAJlV7RjsQFvZaceA93eSufe7uId8X5+i5BkU5dM=; b=Uw9mORLlRJns1/31Epv3RjksgSmmuNn45kBwMZy6oVPsoy/vuCt7nngwr6/LncCirhh/v6/+qdwHeghmBhSwnTQp2Dljnbv6zQX6D9cT16QQraUWGQZ1S7wtt17ccD69MhlS3uJiJ3VxipUc8Rvv2ShA1ZG6hFjp4FKSc43q/X0= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6727.namprd10.prod.outlook.com (2603:10b6:8:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 20:00: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.5723.033; Sun, 16 Oct 2022 20:00: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 v4 20/36] scsi: Have scsi-ml retry scsi_probe_lun errors Date: Sun, 16 Oct 2022 14:59:30 -0500 Message-Id: <20221016195946.7613-21-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR04CA0111.namprd04.prod.outlook.com (2603:10b6:610:75::26) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: 4151189b-afac-467f-cab3-08daafb10def X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hGszl2iTBni5CDQspSnzfWs6nEJ2UNagVO6cYQo/ZJKifFFU3WbkbcsiKmK2TSUY26+bF6sD1woZ18/hIa8H4sDYHOmHI9kJAdRsoBBsnDGJyMUYQmFyyOhJbvnv4TLml6aJ2fUkN6Dm77QidyPdfUpfdEfytIBxluFJJCdyvMRis5F8YnI+HYCzggPNpwejmcgJWctjDdJfKUyZK7/utl8Yj0iPOq9gSMX70+ou3YpKfDIMRqIjkJN2Ld6M1nUy9GS3Eqyb0NKs7Kmi8ms15cFDlLCNQS+yHaZOaPxHgoxN9vn4xY1RmeagQ11SEWJL7jra2+oFwR+40UaaME4+Gp0l5qtEZCeBaGFIsiEVFwcQ5jei3JzqV7t/MKzjH8Vl3mUUSNmP1TFWGCBewXmlEFcoPTUvzC3oGhHZ82UyTzosDI7oizSTqAdvn644YwfIXUfO3SQ/I1Mm27QXEZ7x7jtlLvT6L4HAFYw4cxJZj5b8ysjYqYOhOf2oNRJvDzn5PQUYJjkWVz+kLUQ6what5R9wgq7VaodJIucex5yrwIlE9OkKIT2vgAmsyFN/rv/SE6a6PsY+kQv1lrkJcMKSrk47ygT4E1jswakQGxrceCMtCmrfTAxHXnZJqrnHm6wR/0rR8XweddJ+sLYg5wTiw9B+bub4OD5ABlEOOA4NXqJPi2vDfK8OsCdiGyERrtBB5IvlM8Eo1HoAFOsCC/Hgbw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199015)(38100700002)(478600001)(6486002)(186003)(4326008)(2616005)(36756003)(6506007)(316002)(66476007)(107886003)(66946007)(66556008)(6666004)(1076003)(8676002)(5660300002)(6512007)(2906002)(26005)(8936002)(86362001)(41300700001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7AUlhwphasHxX0kT3I8ybTrADTSdKs6veElbv8N/rJVRbW63RD9a7Qq9/nJACguKjkDlbw9QcQOyPHooJe7Do+lCTonLjHZ3/qkK73m6KaK/MMIghjiSugg9+ab2Syjxu43fYLLSKKc1Q5w8wsghKhSKAcN3dXOrIRLminsgDjqIWckBw6NlhKJXF+tYHwrpir57rrpqDwTAeMlQ69qUcJVDn5AK08C9rx+YUgMWGldKXEFzTEM4YIwszUsy7B6ol8zSMpitpFfU8GMg5Ei8CO1O+S9JrXmMLMYT3NiHj5Cg2BPczLg4zKQHaBuqm3Wwn1SBWzJePl5iE/UcK0eMZR1a9QGWx+N9/LkA2fLT3lZ2BzqAconeiE8syKn9HVM03x0UqthKmLadVdoVIY89kywtIk6s/n7WxRiXgv47DiIeKFg29fCDO58mxwub6S6cidFQGg61kzxeN4zwn+y1/rmiiB878OTOykvYxwtdGq3v6z7MbLY+57Us+0Ciajg9r40iIaHvtjUC1AFSTtpAtdeBGWn+IJMX4n95dF6uif9xvts+yMu48TTtkTvZuqyAnysCjhk/29ResbfPdAD+reciEm+TaU7YW9VXxKs3sVYqkOHRw8hmVkvz5X5EHe+0Cu8DsSo5fwoS2d8GVp5rB4hBdc2jolji3KXq1olPden3kyFVJ1NK4P2LFwIJU6OrfNUO6pZ/H6qRD39UgP2wc8TyIJ2inPU2dcVakX9Lr/CDiGVjViok+FOWgaRi4K2BYkjFMnlncU4l/0srthmBCW1Gac9elr/toKy5XDjbYA8pgZu/u4KLWrnUbkybZwSeAyltD/n668koncQJuwRbTUSsishTXNimJgEpevFOTKfZX6QL+Vi1UHnd2Z/H/sS+eEDFkmLrESQdm708zhSXL+neGamb4UPsGC+ZI13QLQ70wFuUgPV1nj+v9HWM92w9fSfBgDwTHQSt029X3bkltArdnNvbg1gMbJ570PfyTfTHTw6I1ptS1ERhEw1l9v5hfs5H2I9t5RZJqsIwdP4pswvm+o+FPWVCRLIHOIqChAo7S1MLo3f20ydxuLeQRvn75Qmk0INtxgGyacDQ5DUpB5uCHCC4Q2pn5C3KxOYZfV6VUL05hsFPb35+qtfi97R0xJDmJM5NkbdmOBqPz8RycTelwArXonEEoeJRkNvrFp8Gnj7EQaymhIJ70kB1k8N36VdwYpoLt/ergXZkHYf/zzxn+up+0Av/XoS1kE2pscS1EjrthgdWbo+oaNTyia/FbEu+9mtFX2T/BaqMShCqIZbjsfPNtnTLlndDE/2x8B3ivx8CKyxqSEw9N4aI0qARVG0yb20Fxjj1TBhmnMFenHfOcRCEsA+Cmo0HULrxYGxV4qWa0VDcVsg08Gp78TSVN9N/tbIjwHsJ15mAOVYZYpN/U8u3Wc01nd5RETIdroFxugxlkKA1DS57igkr/bx8m7AzVVP7V61o8OINySQNWO+u6MMuoHamOO7+IeZSjFyPUwJXCRyFMZoACbBhmGSxsU7zLHATYRk7cySiGCFiGf5xWfcQTDOmtFc0ar1/s/AG1wnSkaMRLc/jfKch/M3mY13CxYP+xdKvpN+7s+gSRw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4151189b-afac-467f-cab3-08daafb10def X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:20.5331 (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: htqlSsJEfcX0uevRgMC/iLJ+BOWAxEcp0gjMrp8LWt6Q1F8e38+wWB8axstdiFnI4qovpGTCSKnLAik537LVWLy1JP6LeRUgVfa9zA41jxE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6727 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: i37BIzUBmuy-oTCRaOMqoPDnbqLIYeoB X-Proofpoint-GUID: i37BIzUBmuy-oTCRaOMqoPDnbqLIYeoB 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 16 19:59: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: 615660 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 4EB26C433FE for ; Sun, 16 Oct 2022 20:01:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229837AbiJPUBO (ORCPT ); Sun, 16 Oct 2022 16:01:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229876AbiJPUA5 (ORCPT ); Sun, 16 Oct 2022 16:00:57 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8418F2ED73 for ; Sun, 16 Oct 2022 13:00:32 -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 29GE3cfH014633; Sun, 16 Oct 2022 20:00:25 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=UNMW1SJ3Ec3SU0hOfFLkwVfVN/zGucukZOy9AGrYD9tbVwU+FVNwwCNQ6bZ42D9e9pyk 8mQ1Am79siXi38IYKedkOygHIMgauS3U3Fnu9WThRBGpiimwDvcaCpi3fxuAmRC+qvnM Y5ZyNC5HZBEIFIa1TNZ3bUHQoSIXZHPXFGywY4HoWFHnBdJpuAios8g8ndakZIe2FFD2 WAhidFdy94+xGKihojfN3Yq/kHdc7w6HrWeuBaKmumV3aPw/ZkG1rhY87kDgHm/BKEeP nRvEgU89L9Vza7b2JA5VWZYX45DrVJ0/4xoBLWSCMGERkvqj3ZL3GpYi7GrHke9PX6vw nA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k85mfs5r5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:24 +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 29GCHWmY034259; Sun, 16 Oct 2022 20:00:23 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2042.outbound.protection.outlook.com [104.47.56.42]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hu54cxu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bPKc9YW/ibmNYuz1CpAUhlM557cyxUzDMaNk/+I0lPjvcG6oGXmgNL0OPMOuoU+ynGgwsJyynaIL3JHkRARiyM5L9CZPMmE06Yo/NY4f1rqFS5RvSnUn3h6i3KXPIoP/s4nr9yhxD1fhIaiPuznYiPXFJR8n0T0B23H5ApKBEe30Iqc/0cT2Y2DuwPfA1SBuW05u9wy0X9lDSGoZuq1c7yB7JkWcSLFLhY8qITpPN9i9XHJH9cI11aQYmfZUFUkYAZTx4xkkksXBq9FQsNdyH7VoQa7QNwGYvSegDyVqXhiUuKo5z3npRkELN/MbxZBbZg1Hlb0qwT0oQDKdTWpaTQ== 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=j7yzH3S+0UnXSeGk9HKuZJmKp921QfZdWtgmCJ0Dnk4XiyAqt3wtG0Ov6Pjy1zj7lKUEhvlKkupLqQQGOOGstv4o0OP+W9fcxeTGv/W/qOOwsv+fcW453P0pyiCgR9R2nnGTkz6pdyNoLk7ELCbtJDkWKjC9N2viX3xuE1B1MGe4/O/schmQoALH0QiY8k9wLC3YrZDIqwtkHtDEtrg5uwVKWx7/3qsXQEIP2AqFtE/FEeiKJPa9qchFVR9hQUhrDjkMTds9orCezai/+KtMYXbTCEqZsciN/WQKZLOzYQn9mYHbi/NfF0+eU53x3NEAtI7QjVpeAA0kCn+BCDnzWw== 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=pennOdjLVOrEKnBVWkAMkUKgnAJ5uqfzf24lH/SgRmyOL/lsutAFmK0J6uOdywmVV07Lry/v6ZNJH/M65QhB3q4SaFa5EtDWz4XZzfeKyVV5XhXzoA/d+7pxNemPGjYxz4UKffpnla5OgoZWgpLW1/MHQYvLYCE1x/10C/kU+Eo= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6727.namprd10.prod.outlook.com (2603:10b6:8:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 20:00:21 +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.5723.033; Sun, 16 Oct 2022 20:00:21 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 21/36] scsi: retry INQUIRY after timeout Date: Sun, 16 Oct 2022 14:59:31 -0500 Message-Id: <20221016195946.7613-22-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0005.namprd20.prod.outlook.com (2603:10b6:610:58::15) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: a44cf09c-e7b7-47f3-82b6-08daafb10eae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jHhmVV8uwfDRY48K7xhpPnBChmfzjuXUaXuB7mvFd3uD9b8UHXOJttd6QWo20rkAAXPecGgceFufiVccbwnQwXcZ55os+/SRy+Vs3mrcGBSadLLr15UrnoPPvHPC0GhMgR1F685jsrwJOpZdOzieXHrF9MAOuQq/mSMPpaA02+NfYi1F7LAXCHrpg62qv0hQ+sMsj2slv6Y0dzjUR8p8yepOk9IlMWuZdW7fSUwNBxxk6iZSA4CpdKQ9oshbuC3UmxrCXJOt1/QbbkelQygkpz3jHuNeBgasgSSazdyhcuNgMGQIhNtcA0a+5gD6y+yVfWsEY/XM2lT8kMF4sApy2hj8ie6gNN4mfxoy8yBvFpT7zqAXWEOos0OoCFV9MwwRXw7HB3psNlOGrXrg7IyGPd7SUaqvo4+jgs1TRfO/HzHdd68FvmZTIUh8bpt8/fU08+wzlWQgDtds7WM6okQX0YijFSAaBk07pKZM7lsCa66Nlmw8YaWEhZ7hEEwAoOW5Fkyl0KzbuS1MZ/x+J4yIkbCGeq18/g9ag5DmMp/aegIoK3ABUhMk9RDw7C98IJ9ruQNkFhCYwmi7AKhCSogSVNCi/gJve9xQQkKkwiDgnYg9JrXneu0FRqtv7ej0hEugCq4oJ0N9wNrbbIwFIMwMyLaCet7DDuSZnMnHze79fi1idiFrJgxSvENRWctRsgzxLHJpmXGTIRHRZVA3Oq/hzg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199015)(38100700002)(478600001)(6486002)(186003)(4326008)(2616005)(36756003)(6506007)(316002)(66476007)(107886003)(66946007)(66556008)(6666004)(1076003)(8676002)(4744005)(5660300002)(6512007)(2906002)(26005)(8936002)(86362001)(41300700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zgHUp0FtrRjqi9LENWaifV52IZ+V+QkNMAtdGkqRAnIYIhCFRTtY5uOSUPhSFnniRW6m0zaIugbJNCj5klbVausS871CZNp0zNPW0mcy3htKYyaQ0I3rDalVuWWudYTZmfCTFmlhJZYBgKRtAaCx6fx1kl+GVRAQyYAi2nJc/LtMU54qM8Nk5AZcCSHqaRnfXKIgoeTO1SXr7baa3g3hDCEalWCvgtU3xFJbVKDgEBvhU4g0srFgQ9249KEkGu8LmrnkG3qHa1mPyjsuy5L3ray3Frz4wrJuo+sA6KJiwrRg0OAvZrqwxoznHySBqLFiu1kIBNowvPFYQOaeeMZPa8fFtDqYTvduXinkNfu40nUHoDD5U4rBem8uO6y6VGu8oGOAvOOVg/25yspA4sKYQRnGGVHvNCyEs5sXgWGAxIi2vIZ43Z/LJ4+dHkeS++2jbF0N6108N1w0Oty4fo7JQEC4k54AA6Jnp19hthce+JKh/sZY/cl9ugxWI3nV+z4KpWw7qX+lUZFaQpXbIrrHR/IbI26+eRLSwkweEqoASDW4n4vEP9l7bkuWsxy/6LvkKNomCvZEXnQPoQOius5RnIepfOFeRtAgORbqFhg3fx2M6aGawLU2p/dBvxX2Gwn169hGfmNnoFRSuuF5j0hfaNvtI5/nJwLQkri+xo2UvSkDWKGhYCM4Cf5Lqq9Ogf18Kwq0fdN5ZRuRo/gydOi12ABWJobLmmq+wfIncpOlPhbewlz8Xb8XcIUm2XaRVm3X+iTcm59Kx+o1rhbZJj9rAwG15eylc+z1f2IDu06gH1bY4sV3dzViruP3x4cVl3Oi7KfKhCbUVZMxm0MgjjpQveMMy0fYX+fE6tr+Ok8K9Rp3Nngyj3D6+M6Y7xdhzVuCC/nPctqWT7LZHK/SpJYxtJZbg1rA7bffQk747bfihEDVcosI9EX11DxvvTnQZV1olIDm/Sz72oTzjj1IryftGHISPCpO8+BpYYdd0rhPHabLSIrqQdzU0JHm7dEYD8OY7psXcEoRFjqzzgxPU2SvUbRYHlCXQErnOT5CfD1f0Vx6dIX1X1lJ0EUhxa25BzTUz8ec4sU9C9doe2y7VRNV2GRb+ZfLvoa1ovCC362f1Dc2FYJ3t02EaNT0G5lFff+A+CTenDJw8wgoGt5vM2uJXX+p1H96pg0NSlEnFIEw6ZgIQQ1e0HDkpnLnglklYfGxSEzAaEDCjBOjqTGxoR1fFvTf27YlSreLmBpIg94MOoWYdtw5MX0UO/kdFUa2T6HVeyanoYHAudrEb/E5f3VfLGTBrkfkmZJVPQz8e+TJx3RYi5hOvGS1ccSZWTCBjYiyOrb6fT+FWCvMTjIY6m3XqMINiMRbP3ls/3t0XKVmyTKOEavgUCqOvXqrLvp5eogSDOnGRwr+mC+kx50e/e5uwXFdAHn0WVSlS7eXDZUKT8KUJGnMNVi3MRIrCgLspJ+aux7LI5J8Fr1a5eiuxtEcJdIfgY9zqqkS10EJ8t7xlhX86DxVu6cd3LXfqaKLX989uSJs72oM4dDHz0VvPiNeIS39MMLiMWvw/HvwVlMwaThQmgd/T1GSRmmZ0LbJuZoesYr66YXA3g2CKBAcJQSudg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a44cf09c-e7b7-47f3-82b6-08daafb10eae X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:21.7986 (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: fqgx1lUWLIhIpA9eubkqKRfh+XcZYC9gwxeoO8d1TRmCLf6Yc9DTFpzShPaOzvuZw9GzenKGBkAMDSPh97i8gGZVOXPP0UWzp6yCXAy88uc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6727 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 adultscore=0 mlxscore=0 spamscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: 2U2NLL0rNKgaGjxWbaywDKyBc8KuOzqA X-Proofpoint-GUID: 2U2NLL0rNKgaGjxWbaywDKyBc8KuOzqA 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 16 19:59: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: 615659 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 660CAC4332F for ; Sun, 16 Oct 2022 20:01:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229904AbiJPUB3 (ORCPT ); Sun, 16 Oct 2022 16:01:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229951AbiJPUBM (ORCPT ); Sun, 16 Oct 2022 16:01:12 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A39F9286FF for ; Sun, 16 Oct 2022 13:00:47 -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 29GJXnrS015579; Sun, 16 Oct 2022 20:00:35 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=9bWR6hXJgiUr4ymLqPipIoXShO7vFEUJPX4u9jgKu3o=; b=FYoJiS6cNLgkFk5nSpiB/J4h+cTalCcdcNBYAzhkTPkSlftCKjxaGR8ozPGWrHtI7Gur lM1kuwX62B1DEDcjXCa9APKtxw6pCKdCEoIMkNOLThFTckPMJWPjD6GfOlBr8karpLGj zHH3RKiM8i19gScEqOZR9aPpR5wFih4lYOckQ2IwFtYc5RpmbA2sLvhM2akk0+I+u3/A Bwtn/EJoXBoLiNJ68yQDpeIt3LJiZd8f2GeD/Sl8DYbox5RmS+u6c8Row8sCXMtLQmla VUBvHgdQYbXy0Ay5XVUHF80SrYDJWqHpq4o3iZ9U8xOa7Nb5CPFvoOQW7PK1BUQ71eH3 rA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k8jt2g7ae-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:35 +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 29GCTJNH040018; Sun, 16 Oct 2022 20:00:34 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2040.outbound.protection.outlook.com [104.47.56.40]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3k8j0nc1tu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dXdwvKGFwrLpSqql8EwbpN0VYPBYxCXFomIIg4Y+QLMTnCO6gFmyX7vfEhv6+pYOqGUXOAl2MMz5PogQcn1lua8d3m7iF6iJRecLgAiM2Z2StB3aY4VXa4qlFvwYnvRqtg6MJQyt1fYWXfw9uKK/AU7mwM9hc5DD85yT0jaeJpmSsa5WILaMSTWaujcihMf36IUOILfI1VADVxxOrUQ+S/nCNazky16bnNbJu/4PiUblUvckJl3iM0pWlIa2xShhjMRNMmMxCGNmubr6Q/kGwqDJmCJzJ2HXnjGU0AFA5mV0WXkEc7oqpK8phJ3UsfgqmUeBr2UipyyNMUXbvb0XPg== 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=9bWR6hXJgiUr4ymLqPipIoXShO7vFEUJPX4u9jgKu3o=; b=Zjcn54T67sxNTKP6rScb/gq5hJFlHJuGsMS31O1wyLHZ8PtOZi9Pnz93J9+1kdaqrYAhouojnGtQ4fLdg0LzTZss9WYKzlpBqYTvIppJEEIxjQBm3zKDQSNpELV74/BnU7+2IWIHgfmZSiLXTmcd7JWD8d4STuqsiqywJz18Qw56ITks7WE//S9qlvr3LZRVfo1VqxthKdgZrUEhhpv1xQPI3BKFXFroQK+KsSWkzatBYRtx9NTlmzqFUevyh6FIRwX6d14uLwwt5uWUVMOPjZyvb/qsUrxU7i/VdZxXYM4+aWong0EoIAcAxUxgJGLH7/VwneHVmKfmwqBBM2c4iA== 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=9bWR6hXJgiUr4ymLqPipIoXShO7vFEUJPX4u9jgKu3o=; b=LSRlMMHiELx4zLkWADRVRgTfeDVVZn+iNhJNi1zj+1bVjJ7BL1X4fPzJJ2w02SDQBdHk44k/qHdLNFx2qofF4Wjj+RxIqOpkkj6vubjVLCEimReEc3n87qV/8iXBBHozrj9gB9baVA2GzqkUksoDzlOr6CFSIzkHmlCxqOJ5rU4= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6727.namprd10.prod.outlook.com (2603:10b6:8:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 20:00: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.5723.033; Sun, 16 Oct 2022 20:00: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 v4 22/36] scsi: Have scsi-ml retry read_capacity_16 errors Date: Sun, 16 Oct 2022 14:59:32 -0500 Message-Id: <20221016195946.7613-23-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0022.namprd20.prod.outlook.com (2603:10b6:610:58::32) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: d2674b96-c351-4aa4-4d93-08daafb11533 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EuWzkyBya/3JbHVRiF426aHARl7cYlLJfMU0hy3xJtmz/22ufIe14KV7rhqySV8EwbVrMUKujY6SgKpYRt2OBiKV9K03+jdOlp6hoxsg+GDtrYiOWE5KH2mDQX/ulEepQF5mhWvyXFvXreyY3SEpWdGajIcdvNKxstxuBe7aNW2QCjh4NRGNSJGLf1IZbB8n5aDF7VjLOvwlC4Ga0OSaJs8FnIMVlfpncrw3xZ8zcErm23CMcJblxbtb64um/bsbVHULCv+F0XT3Y45VP199KUWr2fsIcoIjebNiQEtZGUQAP99fL1+SExySjUHx8TPhMvkvkGRTqlJIL7px6oaqNqFwncIHYt5UqDJSu9WOPh64ivKakh7aGqSSEXR1+BCFQA2Lwh0z79Ne9jxrwXQb0T2TPQA6eo6mEcPtejk8ZT9aMeoLAy9Y4Z5ojkifo4Da8CyWk5FK11rc9VzFdvoQGXD68RYdYP85y6v7bmMYyGFrnAyBBD5ehT1T+VdtI/m0VhpfuuuCqmovZivCTdR26OjczPgZ8mBv2XU+aiQeiY0STPpW4R4t4g4bf1NdcwmZ2B1t344YdNr+QRALQGVodB4Tobxr1Y+wXE70zJsnze/w7Q3sNaJ0jlIWrWt4vLqx8jnd5/nqF14/RwAfCA29bxXHeZpihXMF+XTVuUxWgp+PVDSHzE+b1c++MQ5FIInJSqxK00WWMoZoshAJ4mA+9g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199015)(38100700002)(478600001)(6486002)(186003)(4326008)(2616005)(36756003)(6506007)(316002)(66476007)(107886003)(66946007)(66556008)(1076003)(8676002)(5660300002)(6512007)(2906002)(26005)(8936002)(86362001)(41300700001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DidCNu5OlYPttKpGIjaaGkBQMwU6F6oyErae5cnmduNj3SJdgIO8+Sv30khey14Z3j2QQLdEb0Xmtz//LE69KDBnLY9DKjL0zbAlQ5nbAprpR6WOp/AgA/tGu0r7jte/PeUXPSvYXojCEol1MmoNSl7VY4hfOW8Q6N6inRTaJxsdYBSO040VmnQRlfrAV/kgE/OkBH1NfKwiWM85DD8/mXLgc/1kt7+xm7QUMHa2ikkq6LW1dFVvwBhsNdbbRjjKWF8bG6uVCV+lpIDbU6F2fcK8p2z+6WvOhxoi7lPd7aKFfQE5CZHuSwu2lvz7Bahy0DSzt3SJHSeH0UlwRVCd+Yw3Jhzv0CFFOFfY+PFsysVGPOQU+4H2cO7wUMkbe92S7/kydHFcp8AYKa+RfBuVGaEnOpt9ezvtT6Ju/0TPACK4idULlDB/KrTivQkwDX0JZ6gQqKEpF0M+drxo1H4MPMVfanSCcZSV7eXDXQ4Ybciqq3SGuAHMNnRQm4VDqEFNfVKrhlCVdQpBR0q8s7Uweb46jcuyEpxk6kvrUY92F1fZfyLFjbdUn/VsOITDaKNvaMPaBHbfpJNEoUcupeV/Sw7CRMzft06UcrgEkToyV5DuFc63NlvK8hrAr3wN3PrfY2/HPkv686eUyMdy2rVvZ46DBWL2ZM2D2stSJphJWPDYZS39PgOr+m+KMr1A8ljs1mQ0Fu7cOZ5z0tCA7IAVCOL+nZAayh+B4t1lPdMaPSupYYN3y3oyZgVqtMeju1E+sD8OUzVqKhrshXjNI3TLhY2QqIkAEV0Kyq3JQTgRTxm+NqNc6KJGy0RtuKsAB4cmguNzMMoZrSHJMDe+BchcMsCWYCJzoeA1PPZzk3Kfxkb6+tQq0XmCe2Ciid40ypY1VEJv/78ShHreQF+FOkqJ4txoa3m41YLxpdcJPny+BF3WmPgD5DSrx/n/o7xCBhtUvSdErjMKNvAxhErKHDzNi9NYEcBCxuSvi3Ma2VO4Z52jB5p8AuizSOjgDGI4VkXSq3Po+lSiXbt5Ar3aThPcWuiD3BRTqtSaRlQ4p5WzyWfhjSQVhcUh27RFqO4Lv3sMejI9Kv9o0LOUyEyAHsQIDxFen1D3sZTRw7/vZRUunNC5BPFlBFPYcb8LIv/dJmoWsB9xQKcBl3HivY8LzBBHKMEc0paNKLz8EPxEPDduU3UJN3nhRYikNgOO0BTgh1mhaVf8LF2giNSOvssIeIdYrkgT1hwWD7unG/b026+VwvXQxHY95+MbH1WeOkmFfrMghkUf46wgu/xaor07VKJ/7AeuDN7KhpOZLkiywfKF9NFac3aou65WUqfH5sRJJJ8d9qGZY+pjoXjP9o/wW2BMZ4MZklrXbMm9/qbmEM1jUkwg9vzF2dG487cl2Bf88CUOdr8SNv4Dteh4YUm17EcmDgThp9/qyST7Vgx4afI7UaNysivFiLLFtDnqp8QhLwbIrLiQZlJmPf+Hr7+5v3OwYVKlngfQvbSktReYThrhb8SGSdEEcIJU3PRpSgKr27VV4C/2hKjZeA49XtWAAdN+joBTPLenVXqC+36bXoeNGepS7tLVYIbjuHxkxDVBG++GZHgN4gSx9YYNugReyR2VcA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2674b96-c351-4aa4-4d93-08daafb11533 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:32.7508 (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: i3JUZqtwwV0SCvUGvfku2JHp7CLUSNFAUOWkMuAng2WGkHAF6LJtS8dQJzNkDcT/++qrAtcQ/l+zki+VM/MtBZ7KlngoIve884eOdlQkD6o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6727 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: t5hfyLGrBcTTd_gXcHlAlItsFV4IB9zi X-Proofpoint-GUID: t5hfyLGrBcTTd_gXcHlAlItsFV4IB9zi 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 | 81 +++++++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 41 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 37eafa968116..aedc37613c81 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2279,59 +2279,58 @@ 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[] = { + { + .sense = UNIT_ATTENTION, + .asc = 0x29, + .ascq = 0, + /* Device reset might occur several times */ + .allowed = READ_CAPACITY_RETRIES_ON_RESET, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .result = SCMD_FAILURE_ANY, + .allowed = 3, + }, + {}, + }; if (sdp->no_read_capacity_16) return -EINVAL; - do { - memset(cmd, 0, 16); - cmd[0] = SERVICE_ACTION_IN_16; - cmd[1] = SAI_READ_CAPACITY_16; - cmd[13] = RC16_LEN; - memset(buffer, 0, RC16_LEN); - - 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 16 19:59: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: 616407 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 E3C5DC4332F for ; Sun, 16 Oct 2022 20:01:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229845AbiJPUB1 (ORCPT ); Sun, 16 Oct 2022 16:01:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229944AbiJPUBL (ORCPT ); Sun, 16 Oct 2022 16:01:11 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 573C842E6D for ; Sun, 16 Oct 2022 13:00:45 -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 29GE3cfJ014633; Sun, 16 Oct 2022 20:00:37 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=3L0BSh9DZlPGYkS24sOL6LQL/LxLyRQwmlrvzHZtn9s=; b=GfVCqa5t8asZ57/UrC0nfB3ycwAAHjVqXWvQXKYKu7GEEyDVXjBWibpBY0cAoq2eurtN XEKmkDfpSv3tbxMs/agQ/xZchpPCo1+pyyfZ1CVwGWIPHcI9MODKrkckkIOjXFVTgHeG ICutEyBi4tal7IAOfYvlrqEKNbjXXiTMvvzCggb1EBH/IyS2IaVXQ8RLP9hAOIFOXolL Y/lrEqOvz0lUsUWPzd/lYjq9NkLm5lovSwS3mGohF8PBVmk1FHI52MSERENRVhAZevPD HaUFV7DavG2LHanrzY1Z4gEvROFkZ+4Kcv6ONg6mU1NzOHqnEisp0weLvl/7NgSRaJjM cw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k85mfs5r9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:37 +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 29GCG8ve007018; Sun, 16 Oct 2022 20:00:35 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2048.outbound.protection.outlook.com [104.47.56.48]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8htdvdnr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EOVE5lf/wWQLXUHrpUFUKQMftFBs+QNq/REOiyVsv6tlvQVgaMrGC/CvkUckcSyNa8lnOdAkjeDAF/RUe8LBw6/pnvuKPnXhvbdblgX5spoGckbcFoYx+cYglRAHMwW799yluDt2crTnPBBq+CkfyrNa/V6on1Z2jf57HdWNbnxmNPXKTot03f6Pm+7sanhBlLH+91Oj8bnA87e74J0RUpfjyDU0uarjj8tmLZhq7qPaJ3tUMjpGgWmS2rbW2Q1ZRpyNUFqwh4hJWqSOALWQjan7Y60FwviFiwTofUks3yjoavZkoTzMXiMAxduZDep7h0KsnH9c3VXFIHplCvzkyQ== 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=3L0BSh9DZlPGYkS24sOL6LQL/LxLyRQwmlrvzHZtn9s=; b=mkPfTPQVeiGPhpCqRWNa+dw4TXJ4O7mhusMD+NypQMxOjVnpKWCok8hB+dALOnMs55S/yQ/xwe4AGsTzhXPLUyOCVbah3I3SpFrV8mNd88glootWM2T6eDLo8PIr7MVaZXdK3IAK6j+i7JwYnY6pdfJiYERFCKr5dU1byzs6Aqr1dmc+wP9DxFN8VcXh9s9yn3qZcf7xWYWWOoUSErzeEZJ11KX5my+WUAIzlwE98KCQJ/Cbn+F8qlhhmVccISJeAbQSZcT5EwPJuc6XVQB9hK/dsCrbcvR2z8ZNTH9+xyxu8Qn/FMKVSLUqhs2UtSOqBwYKc6iXiM9mzwkmRXhWYg== 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=3L0BSh9DZlPGYkS24sOL6LQL/LxLyRQwmlrvzHZtn9s=; b=m5U1OV9UyydhAKUQk/1m6P69ZnqsJssmkb9S8yo0JNpeo/A0AzBNe2KCI1lkwAzYNq6Y9G6WZyjm9+1mvpZzx3+iWn/dVdhttkXxV0VI0TCOxIx6TgrNygmkPB6i0kpH8LjITugR6DE+A+1GgfNrvEgLqYhNBfZW5L1nnyPghlI= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6727.namprd10.prod.outlook.com (2603:10b6:8:13a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Sun, 16 Oct 2022 20:00: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.5723.033; Sun, 16 Oct 2022 20:00: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 v4 23/36] scsi: Have scsi-ml retry sd_spinup_disk errors Date: Sun, 16 Oct 2022 14:59:33 -0500 Message-Id: <20221016195946.7613-24-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR18CA0057.namprd18.prod.outlook.com (2603:10b6:610:55::37) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6727:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b0fee54-2b36-409c-9f23-08daafb1162d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u9cSIgReQ/cp0vnsHrPn6ADGv3IISyfk1iqAzzI4/IK6tdogSflFdaNhnInnCAoNqByToSTrnnOuez/63ZKw+sduWo9v3F70kxjdGEAsMxK8T50MmTvBipEiA5mCG3PnJAcwpjEJoozSrnvVO4s28dkwX/TRaA4+Hikdg0mG+aHtAwZdEpxdU3hmPRN/o5huvvLmOeNO+nnpDIbSFCaB39v/TIX7/ywRVx/79I6qW8EL/UWhvPOpFIpmCldcdM6ZiMb/cubfRtWNy+fCtgtmjFySitGbVjJBizOxUGOTKGR8B0sOTAXXzgC3oQk1nsog1FL9/c1lBgw76jKqd33vOSW9fTpyye+7VfZQyOEjihmtrXfmWdv5Q0PQpYfZOly0Uas1CTSEPTjvoT2zpswMKkn5paWycGRMhQ9RUf+qqLtGoT67iZr3Xzkj8kWXgnCknf9NMpbucM9Te2ti3ZAgVRQ3LX3F2gUpzEkkPc5xuFU9u2ofSYAJB23pQH7YOCvMUujzE3K/kWUMC0fNM2NkE28VIobqUeiNysUGPjTcS6otDgsPCNgQPKlKeg6khZ4We21Y3ig+N5ClXZ+yAj/b1/gCD3+k4jP6/Bs6GCWpgsH2H2Oc8gzn32QhTk7XdQu47Sl34GHaAy5sRkzuAXKrf1hSm5PHvzK1TkA0suvlwzUBMS/yTSAr0n4sLFojvPInVrQreU+qQuAUZTVL/uSAYQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(366004)(39860400002)(376002)(346002)(396003)(451199015)(38100700002)(478600001)(6486002)(186003)(4326008)(2616005)(36756003)(6506007)(316002)(66476007)(107886003)(66946007)(66556008)(1076003)(8676002)(5660300002)(6512007)(2906002)(26005)(8936002)(86362001)(41300700001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wlFqjoa7neySu+2bIDo0uv7ZrCw/tMFRA+YpDjOBQS52wV8ZfCx939xGJ6z73gEq/1VjhQek1rNL8P/4kYZmvzdjxneuXEyI25VWXTlTnX0v+W4u058xrv9Ho2yV3jBzDy9dQpFMn8bdn48mKiss1xusbTv58UauIOPztgz+G28USRePkfdDHGyE6T2bGPCKKILke1Aj714InBnCd+pBaA2HupBBdwvTyDqMbAC/UAof1puFv15gHR8pWry2OqciZrSpW9YLZ5FZuXVthnIbgfCNoUTDY7dBMBrDpElX1L0lK8HYC4fZjy3DcufypHywMyjTiBn9XbiOEBI9H6aMBBl1gx+oMGvDUMLyViD02kqP3WYXaYLt9DSut4l9vtmEgTf6NNQsuXhPnSTfm+d4PsfPhtNv9IQoHxzH67DHGp5uHSnyIqiKLw2hGNUutSuvcOgpdTN1DEytrjDwwg40JltCC+7R582uG8yG8dTz6zq5t82XTvT5oQHk2JnsmGffSdtea/+OABI/8BxNItFF1t6GvAl4QFkqnuZ/W1Oh3eLGO6aVxs5c//83ImJwgHRQd7cBVecmPLlEuKHgBnXPaM6sr6Gz9B2g+H5lTqlCf285AV7xwwRgpoP6tg86G8xrFely4sk9WbvAmVtJYh5qmAUtrEaod0Lq+VFnYs/eUZPWQnjHHeNdJ+QITzb3uZ99OwTbQLU+2eKL3Svle+9YTSoQTsLq1ddO/dlvVNTJhAWTk/mVYKU+X9F134vUeCvY13cgC16o7O0CGA3/hdhAiETptRO9Hohk4xxDQw6n9teCeUXx7VVVZONy9eU0hFHpkwyi9OrSgMUbtLdvNgzLnsKOhNII+mSky5yL9OKm/7dlL9oipgCDuDXbUvpyqjtrc9DXV5fKfIGRuFICkPo1m+Da3eUs8Xgl6wblI6E/yFGDzG4AcxP6D54WNtaz1afP7UNn0zwf/OZqfKzTZ2pKwt1P3qE9VjfYqR07RIy4h8DEkyxoNFY4+jeBc8I1fHs56yzt73Q2JWMhphdcxuxYnxQi3EcR0HZh5NJ6vqt9lJppelx+we+0MZ8gpZmugzb9ioChjUm+2o4ZPVIGDrJ/CZt8DDqgrbYeL+dFsSbBfIWR2+Fjb8lI4535YDUDHWI2vQoIdO9yTbFA5ai8/y2x+3aEjwHuzmo98iF+6Aq7SABMGm/9wx0FIpwxlyjN8TzJ6bTN/0z+SeiSQRm6ea+JEYtjXBqi9XZrzM70+LjU6BO1EqaLhZYeMlK1w4Ii9knuJrP+ZWuNWG/xXmKHDmDSxF9zRsbr2zW3//XiCVcZSSd5EvJ+saU+3wNXn/taCd2W1YspiGcATKTND7mygKQIlEGApW8QLI/kDWSY6gQI1yxQRIoDRlWuGcL9YzkxGpNYgJ6aUjYCxPcxEtqWbdzLss2CZzVeVpLtkEVonku8OPwHmO+mGQ8aYU7M0VxYTb6CsBhpX0u6g7Q0IB+oyLLNKCJoW+YiJDKtBjrKETo8vlu4LIWXEwj4ZKIUziW6EG8nVfezMqJ2bnbFwRgG10irZ4GTgymD1CtYXMC+2fFlU5AD1jsKBaRCeKdnye7evEey55IMRZnqp8ba3hBfDxu6Fw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b0fee54-2b36-409c-9f23-08daafb1162d X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:34.3600 (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: FwZqblkyC8ecbB54Je7Smso4Jn89p5PKfL7TZ+wHjM6TzdyJSipo/9/eWLIoZqecOnWv+51GAi+P+mLimhjh9xYxELV0LavtefJu8UV9dxY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6727 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 suspectscore=0 spamscore=0 adultscore=0 mlxscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: V3Bkb2RngT2pUh3A5RymQ6xRCvTR-kuw X-Proofpoint-GUID: V3Bkb2RngT2pUh3A5RymQ6xRCvTR-kuw Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This simplifies sd_spinup_disk so scsi-ml retries errors for it. Note that we retried specifically on a UA and also if scsi_status_is_good returned failed which could happen for all check conditions, so in this patch we don't check for only UAs. We do not handle the outside loop's retries because we want to sleep between tried and we don't support that yet. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche --- drivers/scsi/sd.c | 85 +++++++++++++++++++++++++---------------------- 1 file changed, 45 insertions(+), 40 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index aedc37613c81..690884efce8f 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2062,52 +2062,58 @@ 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[] = { + { + .sense = SCMD_FAILURE_SENSE_ANY, + .asc = SCMD_FAILURE_ASC_ANY, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = 3, + .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; + bool media_was_present = sdkp->media_present; - do { - bool media_was_present = sdkp->media_present; + for (i = 0; i < ARRAY_SIZE(failures); i++) + failures[i].retries = 0; - cmd[0] = TEST_UNIT_READY; - memset((void *) &cmd[1], 0, 9); - - the_result = scsi_exec_req(((struct scsi_exec_args) { - .sdev = sdkp->device, - .cmd = cmd, - .data_dir = DMA_NONE, - .sshdr = &sshdr, - .timeout = SD_TIMEOUT, - .retries = sdkp->max_retries })); + the_result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdkp->device, + .cmd = cmd, + .data_dir = DMA_NONE, + .sshdr = &sshdr, + .timeout = SD_TIMEOUT, + .retries = sdkp->max_retries, + .failures = failures })); - /* - * If the drive has indicated to us that it - * doesn't have any media in it, don't bother - * with any more polling. - */ - if (media_not_present(sdkp, &sshdr)) { - if (media_was_present) - sd_printk(KERN_NOTICE, sdkp, "Media removed, stopped polling\n"); - return; - } + /* + * If the drive has indicated to us that it doesn't have any + * media in it, don't bother with any more polling. + */ + if (media_not_present(sdkp, &sshdr)) { + if (media_was_present) + sd_printk(KERN_NOTICE, sdkp, "Media removed, stopped polling\n"); + return; + } - if (the_result) - sense_valid = scsi_sense_valid(&sshdr); - retries++; - } while (retries < 3 && - (!scsi_status_is_good(the_result) || - (scsi_status_is_check_condition(the_result) && - sense_valid && sshdr.sense_key == UNIT_ATTENTION))); + if (the_result) + sense_valid = scsi_sense_valid(&sshdr); if (!scsi_status_is_check_condition(the_result)) { /* no sense, TUR either succeeded or failed @@ -2138,16 +2144,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 16 19:59: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: 615658 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 D17F0C43217 for ; Sun, 16 Oct 2022 20:01:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229942AbiJPUBp (ORCPT ); Sun, 16 Oct 2022 16:01:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229961AbiJPUBN (ORCPT ); Sun, 16 Oct 2022 16:01:13 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D1E2437FF for ; Sun, 16 Oct 2022 13:00:51 -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 29GJ28C2011941; Sun, 16 Oct 2022 20:00: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=r2ky/VnpqfsVUO1jYDC5N49eG5u0Eb38mr0Ylx4JHu0=; b=gL+vR5r8laWeCV8Zfu2dpFeMol01U8Qx6bvpowrtyoPim+FjXn1AxDp4QYjIf2YQefDJ 7WlYG7Tvdu/njYvcplXlRs9JptvrZllGz9iG1f2YqlOWXIpZQnskqREMx6h5Lvkhw0Z7 rKGX02mQtGt6OAeOqqDBvi1+bjSuVo6CnQGejnCc7/xhSo6KokIsoXQMSnGWDiSQBcnK yxjcTuVnGiOOIU9IfH9eBWtk6j4VxntEPUE54j9EAHAPoKDS1FJrivu/mQIpS8lPLcgF 1uuuISB3SGnOCJKDplQMlg3bxSoksgCxIVATVsMEfEtIawRj1PWBKaI5M/G3WnkFbE81 gg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k7mw39yds-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:39 +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 29GCG8vf007018; Sun, 16 Oct 2022 20:00:38 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2175.outbound.protection.outlook.com [104.47.56.175]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8htdvdq7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nc0ZlcQoirXOkwiI4fX8N4yAK/Bh5eR3OGrCur4za7XstDD7CzltQ8CVO1ME6RuqklSL7Ow1SZN5UVBUvlarIrb+58TfO6oFsQNuWVQ7Um5H+E4w9xxukKm9z6uxFO8CwtfE8PhRs3yDuYYQL613SSG9WBZQSYzHBSnXDhzXJI2mvr7VWE6Nnmz+4S0VBjkIaOtGnKbBIDQKCw3PfU8KGj/FwbX+8ORSOFhbZ8LDTex/0A7hzRVZKz0GFV7oMmnxTorHh4stvQkGZE3mFyemy4YwF0CinD/X11TXnUSWnivqF4rFPwdvrQ4CApI9XCEMVdI/8h1WvbdyIljYiQWLYA== 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=QmspNJmvuxl3lefD9nECCJwY3zS6IN+gZ+Q2kuDau3HtYINzUHD2Gucw3+82ldrBUxSgtQU+/JFlo+9V2uqIb7eQUx+OfxnWuLPY12ls11Scf5haXRTSJNS5umeCIyZVHTY+PkHiHFkHFB87CHdxdQadJ3OriP+H+SeNfgT071cXNdOCuv8Z4y2Mgb0aFt4zgWC/PIx6EGyufUF/PJ41dVHWj52sldARF5YC+4/re+o8XxYsKiZISoqKhRB8pYQWxNnS1bRbjaZr530kWbfwxlwwr682MrIfo2yVmMwmtz99pyWX1bgSGqceQHlgrfOPQvf4rx6I0519K23Nagntrg== 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=YoYGPYlAvUsWEsWuQ0TfJ+yEzRsAw67Yovvq1kvp/x9FKxGpBNhw/7nnEIWrX93JqqDmw/Wo745OtLfbW2YEpqglHxtsAPtOdQl7x3RTc3UbXOOATP73yP2tp1DV0twg3cySKrn0icUsBJ2ISHyq+UpY5Bv5GTNWI3IB/o6+/A4= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SA2PR10MB4603.namprd10.prod.outlook.com (2603:10b6:806:119::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Sun, 16 Oct 2022 20:00: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.5723.033; Sun, 16 Oct 2022 20:00: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 v4 24/36] scsi: hp_sw: Have scsi-ml retry scsi_exec_req errors Date: Sun, 16 Oct 2022 14:59:34 -0500 Message-Id: <20221016195946.7613-25-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR18CA0018.namprd18.prod.outlook.com (2603:10b6:610:4f::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_|SA2PR10MB4603:EE_ X-MS-Office365-Filtering-Correlation-Id: a78a805c-5e68-4d1d-e070-08daafb116f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FsP45BqyXk8nBtIAQneaO0VODu8m58gDY0TpgNltfCPyimQvFOk0PAzEuDZSw6ZrylC6rDjaWEGqzt0yjAHSgYfa6MEAwSmbX7pSqKWWKT4nKvuV2wNMhOgx6ad/8Ebkj2bIPIFKpJZm9gm3+LCS6BD/r5P2AzzmRV8yQNY6X9Bmh8gep2/tanB1Dd97mKaZiMMyQD25mXG/VJjWGB+B9IrgrS7uGTRNV6MVe1KxYWA7A7m/Uvm6THNk/R6D9NTZlpyv8bIgYgBNkLendMWVL6eumnc/jh9guzzSRg5kBiv2oBH+kAnb/9nbZoknXhA5xqowcx/X7wY7VYR+/N+4HGtCx6MbzYLEU7shBcp89DjOdSX3Ntqsf4Xk2SrmjxtXD7eMvimbUszr6ozJeAxoTBZ9lKXPc9f8vzjWaWGVHCf5eYoyELPwt/SmQJibkc2FDi7GxoWVpqkccKIAF30yiC1fuoR8oZ8obh7ntsuEIXBvJFijTau6iYCldb8Rg74KMPysOzfyfpUTJ+8X0ZMIy+Bvm8b5yTxADw9Tur7ZWLHrCxD29ZoivdpyerAOvi17XhSKgI2Naznz1lOPZiX4ZbnAkeRT5vNikg1dmOzGJ11q8VqV6qzzZjDRyebw/0hIVl8WbG841GA1tgfUdhHOrpufSxKX9OGarRU3OiFGmMboy/jg8c+YwyKC5PyCV7Z+zLJ0k8SesGHUYv0LJfwZhA== 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)(376002)(39860400002)(136003)(396003)(366004)(346002)(451199015)(6486002)(4326008)(316002)(478600001)(107886003)(66946007)(2616005)(66476007)(8676002)(66556008)(1076003)(5660300002)(2906002)(6506007)(186003)(41300700001)(8936002)(6512007)(36756003)(26005)(83380400001)(38100700002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3RuSreObhL/7n5q3LmDgvvyO8+1up+CKyYXimw7ENshWh7usM0erJD4CjzYvX/dHjHZFzxhNtc/v7bPFLqC65aLxI5HR+XZWi5f90jlUg9OTUdd4g7QMW4dLBZvgiOTvcYWCYo81KHHERVtV+PSOAhGxikGcCmcdmGtA0FGJs0idI39I3wWRlovB/z0EuP8ip7PNrzkicNhtaTXxIVN1zMbO4UnnwukymFNKySv36EGfm6YKImzkbnBDgO5OxgV2EhoC+15R7WKos2iqlud4v6pWLWmCSuem/p+RjO+O/qmlWs1ltPlEgAK20Pz9zJaYj68ys11FEuIICmZBbKDcxBzGpviHH3zfN88ZdWqcGkE/Uin9J11nu9SLA8gjs65LOjqmU9fY9RHot8MQ10xTno+6/Bsu4nukGa25rYkSkPGBCbXn6kk7ItSlwJc5QT28AGVnkBoWawJ2LpBVNIlmQoT8qTCL4schgBzBzL0ws7hTO4DuwIxdW5kXTufwE8lEt2lC0c7MtA4Ytjdv9uPpVbWqYO8vo8PwjyoAlELOgYe17RLR7uuaLF8SqwS3EoqKU1lfM4MuxZ5Bw+QrQWk+zYDRAcGIwjJ3+pYNVBkK2ssg5HO+n5RS98spUeNDCb21SjefLOAlQFK4ZXIu1uCgVPt//s6PYDGyD/H1BTxCxxt7KTJyGdtVT0De4AeBGWjpR/kgzDRimHYYYLLg0JGVIxMTfyiB2o0iNjNaJy/UqsQ5l0i8bAEwe9hR+aE20MA/bAIa5XBXuhmUNRIrH5/oQR/JMFYCanDkbUphCQjrfzdWv/MS6Np983rn1gEJb3+zF9RmIn7a99fhdkBpkimE57x7mFyEk0pnlPyPfaCRl2MMuigWEshT//pTc7GWBOGmkK8VkxSs6Y03qf+5GEZeVolygegwo1w47Qdnbi+nLqOhBlkEML0mQsPBXgq+b3SQ3XVv8Bp9WTNnokbY/XS6qKAYLmXqRDagD+y9ePeaBszA56GatZG/jRDM42qhbl1qL93KZ/XU9qj+FHTM8GaPnC7zXMUL+eZOFSmLiR7Y+ptna/pyI12lN5M2pFXAgBWxuoYaKfd+bZ7bXKSW+kpMWW3inAIA9xgUtm9NtuVpHcF9hSKNlctpmKMY0TV0z0TJiYB4b0//fujkKW2RuL0lEykT3SfI4CTqfzdktwMr3IiuMLseVukpjhUDihEZDXfbq2f+0eC2hrUxdiQ2rVzHiVFUt2AwSKxqHvO39wylZBx0FBlxjgFLBLuzfQqhEnUkMBnt2X/2yuB7RQYR6D/c6xZJnzUkEQhWvwrlLxJMvdOYqOpgXvhOL0sKu/dRi3Cm69AN2uO716Wb8mp9mu3DiI3SrhgPgCneKDPqP1QJYp6ABh3AqlG/4z4xCeIjeNdVKVb6Xc2s90GQQz7D+PLMbPRDhzYlaqoa2f4T6xbYL/U2fYmdUGyoOgcMNW6KaBPZWp5S1LnH3gwIDqCN0/y2/y64+gYjlExfXpiLT8nx0pQdm7dhs2L5gKre4F5Vp4sYApk4pHowZFifuDqzGaTj+1Z8QRS8AvgDaP6m/yBq9F6c7o57bVOwl1rIhuOL/dUqm0KX2y3J03TxPMCwDrphLQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a78a805c-5e68-4d1d-e070-08daafb116f5 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:35.7037 (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: TnzAPuTIcl1a3+8+d+xsb+vveLlOOFdIwew+2Wopo6M2Z5l6bpUcidTcGpQu6w1qrHZVjpG/zGrpvUVPbTJrQKR9oNqGeeuUfqig1+qvmNM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4603 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 suspectscore=0 spamscore=0 adultscore=0 mlxscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: qPtkiZH_e5JtTrV55Wvn2WFmebbM5nn0 X-Proofpoint-GUID: qPtkiZH_e5JtTrV55Wvn2WFmebbM5nn0 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 16 19:59: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: 615657 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 D9199C4332F for ; Sun, 16 Oct 2022 20:01:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229876AbiJPUB5 (ORCPT ); Sun, 16 Oct 2022 16:01:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229819AbiJPUBQ (ORCPT ); Sun, 16 Oct 2022 16:01:16 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D06D43E49 for ; Sun, 16 Oct 2022 13:00:54 -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 29GJXnrT015579; Sun, 16 Oct 2022 20:00: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=3w0UX2ZqiBlW2PS8bR9mI5uNY046r91V5K3LINURgPA=; b=bVD2XDy0tAfwx5z8zaPF/YZ/JnUAJgCj6qb0M82/7keqwIzaPOdYbzbe7DixscRt73+s Y/s681lk7BSp65DpkLXR/LRMY/BYL8XoSFsYA5JkqpIC9de3TYLReuoaW4+n0VLbb3hL oE52uSfIfXeAgGr+QKGOOBppQ12hqD2WCuT1tiPiKGz6RIY5QidmIkFZocKvATMn6C+D imnjOhJxKzYX1MhXuPId7w/eh21KNPlu6HSTLqDp0YfrKOtwHnjIL8+mU+0H511M2nzK d4xx/yBx9pJA+kcfRSX+5tDAxCZNUrusgPpcqXiFwgGPP6L/biCUAxdRWTH6EgIH8zeI hg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k8jt2g7af-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:39 +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 29GCG8vg007018; Sun, 16 Oct 2022 20:00:39 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2175.outbound.protection.outlook.com [104.47.56.175]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8htdvdq7-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d4m4TX4SuI4y1VAgs+f5H9zXdiqgvwhr79Og77/L+zFTM0HU9teDpYpWcwNi03UJq9Bpp4pwwcrCdiSm+kliYdGGJm5SnavJIJkY9fsoq1oNxH5DitZI84NjZVR7fEm8KKOSzbu6F3T8kTNj4+dbP7L1n2txgxhYQQ4SI0KZXld95ml9shgFFpKl3Xkuxh3K6mlOAZARN0GJjwTwgnfivPCKB4DgIgq7hp0Zz4cBsYii3Nz74gq+fnSKGBOLF9OqS7JHAzOUFCU4h0mfl8E9nWp1UrJ/21Fuu0w6Z+9CWwasFtIHUubTpbC2Amg8kmx6+m328VRpX4qbYx3mPiTDJg== 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=3w0UX2ZqiBlW2PS8bR9mI5uNY046r91V5K3LINURgPA=; b=fm2YGlEHs2j0gO7jEzCusok5ZfzZJfJj7YEhlpqx6ResWPVtoTt9R6nCc/Rc4w5DOu5Zq0ZU1V5GtQlq5+xRZyoax6ocdOFId3cN28lKT5ocmXE16fMfZJixTfM2QaibZ6ukfuPeRej6IYuT3kCuy3qiux2wIamC0YfQ3EzhiLtMBLa+wEFwnQHy09l7jPt8YYmAxyo6nE32LeEv7Nyd797DqbCQ0b8Ub4VI0+Q4Yn0c+ZEHLBkz+y+KhkdmLwAVwVfqSbZqdKZDbThvH0U7S9l1Um+vAxjBmBfL49UakfvIiwUG+Cs1IA3a8k1K1YMkZ/vCaJJWF1qBM63Xax0N3g== 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=3w0UX2ZqiBlW2PS8bR9mI5uNY046r91V5K3LINURgPA=; b=vVhE+OVOHm6+ypofbIK9PytwQYvgRb3Emm2gwc5KUSDU9lTkRwlfGT5X4gaAbaSsp813k1oe3T0Z5HVTJOPIJDBifUCVYszzKYa2y3kBqCWLo9S05N6SzNB0+x7tXNfW+NP1r05l1ylNNBk/LUnnbtzGqF/JJq8jDzvzSLwtddY= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SA2PR10MB4603.namprd10.prod.outlook.com (2603:10b6:806:119::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Sun, 16 Oct 2022 20:00: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.5723.033; Sun, 16 Oct 2022 20:00: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 v4 25/36] scsi: rdac: Have scsi-ml retry send_mode_select errors Date: Sun, 16 Oct 2022 14:59:35 -0500 Message-Id: <20221016195946.7613-26-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR18CA0023.namprd18.prod.outlook.com (2603:10b6:610:4f::33) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SA2PR10MB4603:EE_ X-MS-Office365-Filtering-Correlation-Id: eda550a8-a9d4-4e7b-342a-08daafb117d1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kOlNULJu1eKxFuj2Qc7+Gy+P5w1+cfY39blHnM6pMsv46GNofPyTJEOJdcC6TVEHHHRD5GsrrL/ZlcmvyTGOIkDvB2PQhX0Ry1GqmAFvBfcr5HkD4otLSLUb542tbba6M3O/ubsW79VpG6e6JYT/o8jdpfPe6bI/YXlc9GQpCERCdl9dQtC16bWEVWz+KQf8VtwvV/0+ci7zwT4H5Mwj7u1nRZ58/nF/+wi733075RHCXLxZvqTS1YDLwIimYpa0P1D4Y9E2JABfs0VwdFLxtSZHK5hz7BuR6rdOIBQfj3ijdkCB0GFs0t/o0eb9lESAPv7hPw/gNoOMgbrbQGibHLDqE3HYt5v5Xc/B9K9qYPQr6DDQ8xdMwLlzqhUfMGaiineDxLoICm+9q5IKPpT3kvCZluQiTpfjWiPk10k8Wolx+kLkVLRIxmf2UmrhaKK1t+tNs8IYD/A5OCe14M+CnZCyISYavwXeHy4nUnBsd64fAD/4Y+qziBKLJqrVm1lux495Sdd3zg/NMiMmYUnbe9sWVcj/HHRmSqE25SbKB5u9H8MHv7Op+koyrSS8YQEC4r4Yn31mRg/0oXn5z7yHLpk+2DeDyXzU5+h9a1zv1GoxV5ZvbiBzWnGs2OW1tgOEX6nrj0slaUdfwMTZ0543QP+f5A2SUPjvDqAW9McJukU2Hiv6cKXjB5AgsfREBfWrfmXCyihThulQkcpQf323Sw== 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)(376002)(39860400002)(136003)(396003)(366004)(346002)(451199015)(6486002)(4326008)(316002)(478600001)(107886003)(66946007)(2616005)(66476007)(8676002)(66556008)(1076003)(5660300002)(2906002)(6506007)(186003)(41300700001)(8936002)(6512007)(36756003)(26005)(83380400001)(38100700002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ofit5w/2CXugmJUXF/aff33XaWvxJTA6i3bxTQEWDNV+PjqZvSfWLiJ7O8f0AheajM2GJb60FFvASuk/DIHsZvOUW6vrvhxBwDmchN6Wj6kQk8C7D+Kd3Rls/+zcMyLuOqghknypeVyetgmuq3UIfEIwv7B7RuFEuI7c2kWPKBnss1t/b5SbcQ58r0MWHGb1U+sdBPyYHuxcMVE/I31c5yhnBMjT1dl0VxjP6M8ggJHYWgGDfNv3NxTj0o75US+zev3ztf4A8VlaOc5ma8QKiUyTthdEXEHObI8L9xfQpyW6y+W/Eb5bSEU7ljIt+CvalYmOdJarqM1ljUNik6jOREah9rEmwEP/1vVJSyjOWRDfjdQX9CYg/qaklMahJ1DAniBwH2xHZiTKuVClUxgtetS5b+rDz8bWpAp+wAQ1jbAe/J2maKoBEizTuhvkzvVLTNCTyHZfhj9+sj5eTQdXdfsrUBu9jZJyC+DXUk33KTvoRsSuWUz0mQD0S21SU6fm4gKW6KcVWGXz9T2/dJfUihCQjSJd0AulFESkaSWAdavyd9660RmCGpTAhVxsOqfDYM5+uusZh3uoMWG0FJ53BFpUUf24OKhxkf8qZLrPTh6oIv2IzYhs+eDUJoMQ8R0stDmtDWLt1/8e8wHI2UtABcomkVl44dvP49Wzomz4F4zqYWU9NnBjcUEx5LIL94b5D96e1Y1Y8Yfh5EV2qLPo9Qsh5WRLegQ9KzORncf5serzGrGmVuz+BOen43rCGTSmSWhOD/TRmbG8B6E9lmh53rvKRyU69yMY05M5ymkNbSEjxNqykt4Q/VzdYmAIZZsJTyW9VcxJvA8trvdb96d62uK8dp3BiKPh47i8d6y1WI2h2IbsXYWGRYxo/OzF/YlWLiJSE2sB9HSrQPWMSJ7RSuvur9LAeTy+e4tWe6SFhPiKQqhZXwtacRlUncH1mQnexle1DIdD3FXP5068jaKLs4o2I/3U2su2sWSfcd89dOu6nSwlzr8jLbXRIjZvN/dtzk2US8XLdf1fiRrWCYch9fk1Jk2FDe2/hh4b1g0mG7LFAkdh2n2TGnaIHvsn4jefwBwgEkyRxnnAUGuvVSj9iFVSICYdUFT15S/FboRjV74tpvchE+qfdJ4S1DcuqcnHRyri+pnRn7QaDvA3O0o4QVr/0un4vl0l/uktTOn26WSHxJsu9uhrHHkR3VEzhWerfSM4KD2nYPwbGdk92rTWgPNeuZDweAwcsWbJrLiH91QVVvvKEFSgX0YMWzM5x/c/DiKZ2Ytejw1GDjT/L0zbEI8LKvHrSQKt6LH98FGH8dY1PwwY36GaKgSn0tgAK24fZOOSIDZr2jzT1BEsGGZOGBJp4IlczZE6C6qjzeiXDHb/B23aXJa9Wk7wRHMuwWJAXY+ex00yvQ9ykJAjUdRKzAur4fmBFkzIhAmQ8zrWypXTX+vWB5UPc33LcuPqMqiKoIHWK6pilw+FWtHzZgWIrH6gPcRW2iTGmUIpnhZ3foyt4Ds1LKdkvdtE07bY20SDEWtvlHbhs/+3ofVZI/eCLNINPOyMD5iDduzDrblxF1O3xGSn3mGOk96HgNmtp4wT1EayJ1lUvgnsqkxr3JfwVA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: eda550a8-a9d4-4e7b-342a-08daafb117d1 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:37.1098 (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: h+3eabboEoY6QKU3R4haYV8BVIj8rNA0/4nEeExBjb5XWXr8/e0ZiySzI1l/9UkHKmmfWzX9aksOs/In/EgAyOeo5JMSPFOQ5XHJ333XyIU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4603 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 suspectscore=0 spamscore=0 adultscore=0 mlxscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: zWm2VL8YxSUNaAphdLaqXMPMR8NxauW6 X-Proofpoint-GUID: zWm2VL8YxSUNaAphdLaqXMPMR8NxauW6 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..480185d57071 100644 --- a/drivers/scsi/device_handler/scsi_dh_rdac.c +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c @@ -485,43 +485,17 @@ static int set_mode_select(struct scsi_device *sdev, struct rdac_dh_data *h) static int mode_select_handle_sense(struct scsi_device *sdev, struct scsi_sense_hdr *sense_hdr) { - int err = SCSI_DH_IO; struct rdac_dh_data *h = sdev->handler_data; if (!scsi_sense_valid(sense_hdr)) - goto done; - - switch (sense_hdr->sense_key) { - case NO_SENSE: - case ABORTED_COMMAND: - case UNIT_ATTENTION: - err = SCSI_DH_RETRY; - break; - case NOT_READY: - if (sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x01) - /* LUN Not Ready and is in the Process of Becoming - * Ready - */ - err = SCSI_DH_RETRY; - break; - case ILLEGAL_REQUEST: - if (sense_hdr->asc == 0x91 && sense_hdr->ascq == 0x36) - /* - * Command Lock contention - */ - err = SCSI_DH_IMM_RETRY; - break; - default: - break; - } + return SCSI_DH_IO; RDAC_LOG(RDAC_LOG_FAILOVER, sdev, "array %s, ctlr %d, " "MODE_SELECT returned with sense %02x/%02x/%02x", (char *) h->ctlr->array_name, h->ctlr->index, sense_hdr->sense_key, sense_hdr->asc, sense_hdr->ascq); -done: - return err; + return SCSI_DH_IO; } static void send_mode_select(struct work_struct *work) @@ -530,7 +504,7 @@ static void send_mode_select(struct work_struct *work) container_of(work, struct rdac_controller, ms_work); struct scsi_device *sdev = ctlr->ms_sdev; struct rdac_dh_data *h = sdev->handler_data; - int err = SCSI_DH_OK, retry_cnt = RDAC_RETRY_COUNT; + int err = SCSI_DH_OK, result; struct rdac_queue_data *tmp, *qdata; LIST_HEAD(list); unsigned char cdb[MAX_COMMAND_SIZE]; @@ -538,7 +512,49 @@ static void send_mode_select(struct work_struct *work) unsigned int data_size; blk_opf_t req_flags = REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER; - int result; + struct scsi_failure failures[] = { + { + /* Command Lock contention */ + .sense = ILLEGAL_REQUEST, + .asc = 0x91, + .ascq = 0x36, + .allowed = SCMD_FAILURE_NO_LIMIT, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = NO_SENSE, + .asc = SCMD_FAILURE_ASC_ANY, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = RDAC_RETRY_COUNT, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = ABORTED_COMMAND, + .asc = SCMD_FAILURE_ASC_ANY, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = RDAC_RETRY_COUNT, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = UNIT_ATTENTION, + .asc = SCMD_FAILURE_ASC_ANY, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = RDAC_RETRY_COUNT, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + /* + * LUN Not Ready and is in the Process of Becoming + * Ready + */ + .sense = NOT_READY, + .asc = 0x04, + .ascq = 0x01, + .allowed = RDAC_RETRY_COUNT, + .result = SAM_STAT_CHECK_CONDITION, + }, + {}, + }; spin_lock(&ctlr->ms_lock); list_splice_init(&ctlr->ms_head, &list); @@ -546,33 +562,28 @@ static void send_mode_select(struct work_struct *work) ctlr->ms_sdev = NULL; spin_unlock(&ctlr->ms_lock); - retry: memset(cdb, 0, sizeof(cdb)); data_size = rdac_failover_get(ctlr, &list, cdb); RDAC_LOG(RDAC_LOG_FAILOVER, sdev, "array %s, ctlr %d, " - "%s MODE_SELECT command", - (char *) h->ctlr->array_name, h->ctlr->index, - (retry_cnt == RDAC_RETRY_COUNT) ? "queueing" : "retrying"); + "MODE_SELECT command", + (char *) h->ctlr->array_name, h->ctlr->index); result = scsi_exec_req(((struct scsi_exec_args) { - .sdev = sdev, - .cmd = cdb, - .data_dir = DMA_TO_DEVICE, - .buf = &h->ctlr->mode_select, - .buf_len = data_size, - .sshdr = &sshdr, - .timeout = RDAC_TIMEOUT * HZ, - .retries = RDAC_RETRIES, - .op_flags = req_flags })); - if (result) { + .sdev = sdev, + .cmd = cdb, + .data_dir = DMA_TO_DEVICE, + .buf = &h->ctlr->mode_select, + .buf_len = data_size, + .sshdr = &sshdr, + .timeout = RDAC_TIMEOUT * HZ, + .retries = RDAC_RETRIES, + .op_flags = req_flags, + .failures = failures })); + if (result) err = mode_select_handle_sense(sdev, &sshdr); - if (err == SCSI_DH_RETRY && retry_cnt--) - goto retry; - if (err == SCSI_DH_IMM_RETRY) - goto retry; - } + if (err == SCSI_DH_OK) { h->state = RDAC_STATE_ACTIVE; RDAC_LOG(RDAC_LOG_FAILOVER, sdev, "array %s, ctlr %d, " From patchwork Sun Oct 16 19:59: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: 615654 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 BFDACC4332F for ; Sun, 16 Oct 2022 20:02:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229764AbiJPUCz (ORCPT ); Sun, 16 Oct 2022 16:02:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229726AbiJPUCy (ORCPT ); Sun, 16 Oct 2022 16:02:54 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C12F23EB3 for ; Sun, 16 Oct 2022 13:02:54 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29GGLn6i007234; Sun, 16 Oct 2022 20:00:42 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=WHQ67LQ+Z4eBY8kGq4AoBEnF+EczvEZz9X4U8gcfQ5vyqudexmOwKvgG7agl6E3SKWzq 118OuVOpgiMiac+NgPTEFTxjF+T7FoCSN5laBtC8/nG3EMOjVR1ri7Udh2XBs5D/fmB1 mrWdR8mxo2wJpA9kVAVzAsTf2/afHerAzXSfQNgWzD1m5MfaI1jTsQqOh+aCFr+MtRZ2 KH+I51KsjKMDSy0cYi1BcgFJtbMZQrGAH5k30K1b91meUBt5vokwtX+EU0uTVledIhGg Os7ZHdCViRZD2ICjH646PKGQwHnAkw/kIePStDejL0+wBswCCRD0hYfHqvUiHj8DMjwP Yg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k85mfs5rb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:41 +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 29GCHaIW007291; Sun, 16 Oct 2022 20:00:41 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2176.outbound.protection.outlook.com [104.47.56.176]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hu44d7n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bdwQKbDra8WM5B/FMtHu/0FkvlLk+wHCVeYuzBI/wwLGXxBqahbw5sW60rC7tEAusJpxf8CfYE7cSZWVkSEAKU+W0pN7AIK6mblXlTt2J3fE0gwVD8EwvYsnrqyxpnNQrLUITdp0oF8hkKAlqnQKEFPqxUx5D1SnwQmIPcr+jo3Y17vzuBlO1kLLzIsd64mVAXYQ9zskF0iod3kiXz11nFHZY9vqNpPRZGlJWi54UckWuI6A+BHFKd8JRNidOhDL8pStJr8lgkkWh8go3YSgOfk1bP2hC0OT4m9OijJNzFS/fHeMahQCYs0SrqGBbJVSjS0El/16k41JlyzumdEx1A== 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=fWZxWlVf2/utQ2FPK5j+Ow50ACS5uKJlqMMdKHw+dVtYNdJZvPylCYydOHxl8qXIfDnY+p7jrceAoyp6OGmPfNUr1joAUGyMVSTR3yza822s3Hxjtz6rMtCru/gBYOIvSvCJSgRDvzyU7Xqz15+lhzIpfm71upPSVWrB4tYl3A1f7IFqCNjkW1lmhUhhGej3yqVMCbIgpVARNoOjnsPNhyAU71JoYM4Vg3K2hb77jzBpklzKoVfT5MpSLQ0ufskBvvKg8t8Dy94gsXSunBCVliRHJqHQjPBz3PI/astGM+m54ICfOXavqpf1mV6zn0+dxBqQxhdbKWyEKK6VJbLeHw== 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=sLTku5CwFyYUWcqhrdVeT6Vs8dPNqrytg427VjyWMV+GrCJEyP0xbKtLkS4Pt+5ClHk//V2trrjyeWKzhk+jJ3+nJ3+Q3lcHl7wEpALebrhiDN+xxgEi27HnIiVcRz4ybCUQ7IAXG+UFa4lhFlftCfS1opR2Ct7qMd403tKRFYU= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SA2PR10MB4603.namprd10.prod.outlook.com (2603:10b6:806:119::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Sun, 16 Oct 2022 20:00: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.5723.033; Sun, 16 Oct 2022 20:00:39 +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 v4 26/36] scsi: spi: Have scsi-ml retry spi_execute errors Date: Sun, 16 Oct 2022 14:59:36 -0500 Message-Id: <20221016195946.7613-27-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR19CA0008.namprd19.prod.outlook.com (2603:10b6:610:4d::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_|SA2PR10MB4603:EE_ X-MS-Office365-Filtering-Correlation-Id: add87bc3-db6c-4d3c-484e-08daafb118ef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mQLAUh6b+xytSyNs2kizYKWJxcRl0Ea0q96sj04mT3Jn1d3ctu4R7r0KeI9T50iG62gtp2Jjn877v4c9TcBj++pmasUC0ITVd9oGu/EiRW+wL6k9PKWU0BpXlewOIHsWi7c/+EVENiG1QsZMtwcL3TbehljmTW1s9LVSi01qQdkp3RIuXzjLO2zHPhWmD+VCbzHQBYe36KhDyh5mRP0m9TMO4NfznO6awZ50KnV/z3nyVAdCZDGRc1T3ejhfNhLxZ6+iaERHSqE2IcmzyIPLctP9WzJm7JrXw10CmLHC0CTDE3srq0ufrRAd5sUD4rJRdEzgQW5ofzO68tGDKTsaDqvCipViAs4BArBIvmremj0QE0wRMAXkS4oGa9VDVeiXgJqVEim2OSpldlqYtj72lCFQaTIkqU8KhWqBuXV/q09qtvpPT8QfHg3yXGaL2eZKyz4kYhN7sMozIDYQF58rmDyOzEvwm7c8KwGTVn+MssycaI0F9hn0I+0po65xg20Py660SpWzd5GXKRQAaU3btF6yvIMV3it4IE3KsF5kX074Km5EPWc2Y6YgdrDXuXmWj8BZ+2O3Qfc1f3Y4+7PXBoVlRpFXC4IrkqB/c/8h35FfgkWinQaBbXlPZny+7CQoinL7YYnxH5mEeR8RAbdsvvKQiX7xEMHLEVmKYIQJPmrXBcTQGKFKb5OXeAAUaZYj05BngHni18IffdqAxTmLgg== 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)(376002)(39860400002)(136003)(396003)(366004)(346002)(451199015)(6486002)(4326008)(6666004)(316002)(478600001)(107886003)(66946007)(2616005)(66476007)(8676002)(66556008)(1076003)(5660300002)(2906002)(6506007)(186003)(41300700001)(8936002)(6512007)(36756003)(26005)(83380400001)(38100700002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: um5OBIw84eb6+R7nBvcerKzntwL/cW5yA28OKjkiyroD7tgJe2UmTc1WsFMomSC7SFRWhN0TkQI4KcJwodD0+y7kTrsEaf77Zag/izqPxuB11arBmk+U9Q1t89D7YFQKBoIeywrljc34m740XrwcoCq0lGjIRo/HX535TJKY51RyYMXQfIS8il1GVGWax2oftaYJbMe8n/SiFxpATm0ktdRZ7wMetJkUx7n6HaMswSgMcfDPTjE5X35YLMrtuQUtBqLk3Kj6F6jCSCsKDCO4jIOp1NWNGfalVJL322pwViEYg7K1kfv5JwzUCf23l4Dz+PR07z/VQhV4Ke3nOdgFUCTybG8XNNralSa8zXpcBwGKqVYYKOp360zrf/+ijVnasT8z/xUYGVY8AtO5a87DJxBySSYjhHQIXxnqNTWbByRmF4DLfKR/DmluoGIGGMecdMHQ/J5AtYsPH//Y6wKfaqlDvqJtGFL/Pkk6/rex9Fd/gxjeqi2q0Z2Dr3svCAyun7vLWe4+/4vUcBdtSMZU0hFozWiH2CSxi5eBbfG8k4xXHKO3R1hzoThTVnR48gz8r0MIKtc7a3IuCU/bhPFPvq9s637i3A/7KfXevxRFR7S3nFnDDKKWGgnLqSuueo6HRyOz+IxK5pFzrPh4Esp+RQ0apjsylnZ8a2pWVVJgT0ds2fDbYe34KGLzQgZa0n5QGFM3KZe3d0ImzuKhObPhnAM1QluMK76oRvmQWQ9JioMfIDhZOEtUfuMT0RF+ugYyzdkTVlaGIF1D46GWKgWmdAEYvn3JxWXoRQD2aFlGA2vyGZsO9sOFW8N7cQP+auMLNehEazpebSOGg34nrWNt9MR7Yi4d+mlNHnUl8MjfGFPRak1WR3rXyM/UWYb9agXTJmPOnKPAhnfezmPfZ5qT7bD6QoaC5skGLbtrjX6ULxt+ue9sRXEZEy4siBk3FLuLgkviE0C9CX95E/rS/r5dXYjdbQSC+mNI5FCVYkBk4TMjv/HKNIRu4nHr0her21nb7D3xxuh+tHPjjedv8luUJLmJfpxmcxX2itjagkbgl5iJiT8BAlnvtW6kfTRJF8Lz2AfFlzDQ38OZRLX+27mtl5Q7/wZIkZk6Zv7hcRr6rFLNcSsajWN9w2rRcm7hCbpogta5XLOVtIFkZ/rz9mDMkEdkVEOItpXZmWMECEbvwNvL+iB09evQH8nXSHm/5GLiTL0JE1+7KloCMZOgP1anF1prCmM4h/HgInmJR1WKkkp7Ia51ROLY6OXHWIxFw1ZYcoYjcjjtpsWNofkMmotODXZOKw923W4VmVp+66VGi9jMwQGTUsdBbuPNa5E01HhnFN/6QkAnKCOTpKq/5h73avJDN0ujyO5YjThrslurVry6tB8Us2K4UiEJ5WHe3YKWYwIaqLVIfEdTU1bmA1QL1pi0XAcSa3YYXRbplIm62eWPj0HcVfDwIoKBj8ZjFM2KliWD7Bd6VWRL6895Ac6vzB7q4mkxFnOnjhRrO6cEgbfcbWm5Lh3MMpEuuP+4Lu70OEiSCCc9pl2Ac9g7fcotKF/M0ZI+2nsajbZ7zlXm8fQf3iZGS47+Rm7vx+wiUHs9vMqAzuwJHEsTofUIwA8n6g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: add87bc3-db6c-4d3c-484e-08daafb118ef X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:39.0003 (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: Mt+P2hD6sAIajd+U9h53UN1+W5so6OFhQkMkRj3vAUdFfF8wX/p4H3h9ZHoaY7segFW6yeGmnVxWe3qm9HrLpAtrS6SKnXFY2PQjbUVebYw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4603 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: fzOWSErQ7fWDocTg5hd7skmZRhXJkkGS X-Proofpoint-GUID: fzOWSErQ7fWDocTg5hd7skmZRhXJkkGS 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 16 19:59: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: 616401 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 36A30C4332F for ; Sun, 16 Oct 2022 20:02:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229726AbiJPUC6 (ORCPT ); Sun, 16 Oct 2022 16:02:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229780AbiJPUC4 (ORCPT ); Sun, 16 Oct 2022 16:02:56 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94238286EA for ; Sun, 16 Oct 2022 13:02:54 -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 29GIrcZn019532; Sun, 16 Oct 2022 20:00:42 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=GYBSYyrfzYDZPenkGwyfMrFInG9Lh38VD1BLh7ED/IA=; b=F1Kv/1dP7/vTnLUj86t7SJiWJY73++Vv0jwo0P/2bFMuMFgi3pH5STcCIQsGFS64HoRn /0WAChCQhH6tQoBdmx/Nc/HB1cmB+n+WRm8A3efhw1vtJyYHoptc3Qi0ugu9pUXtY3px p5DHJuoE/kB4vvbRjXMuC62Xs28/6GWksGcMvJRadBWLZQWN3T2YhO5RL4f+SOWxn+nz k0RFzc+GKWa4dcAwd/lnXSro9m88IDFye28CXrDwtOIOCyCDm2JpzHcJhDIwCsyhTbgy mpZhxBvldgmrDg71sCaFPln0XYH2AnC1KtPCdehJ7azxi9JrCPrjKAPj5ULMXld7f8GW 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 3k7ndta64d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:42 +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 29GCHaIX007291; Sun, 16 Oct 2022 20:00:41 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2176.outbound.protection.outlook.com [104.47.56.176]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hu44d7n-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ax8/YlYxGWuczL0Ixan1BBoIxn1rb5T9D7q7TSqx+3l4AEOJCr9aw6c9+YQCRkTb99PmCPUcJA8SDBivyGcNs3ii/3UPr21KBP9A94nv0V07zgIbrXxBl33w8Uz+k8ttJAUfVHU1B8qSvjdVFpK4BbNaYJxhDAMhMbq4/eP+4kbyu6VEUDBLeg3PSNAYUVHy52vm5ORlwjwHMXXYkIIy8UV7ixpnm1WyeKyJoMzl8OWBc17VRdagpbkOadJMJg7OgpRW2s5WDzOxrzpjD9FZ+02ZyFXX4flsKmSMOcmR5v024BzA2v5HG9RpIIYBbWRw/I94pbsz4zj21Ylbw+88tQ== 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=GYBSYyrfzYDZPenkGwyfMrFInG9Lh38VD1BLh7ED/IA=; b=Sb0accucttqVSaB8UpXaS7OFNqg6ON+ycuvVpk+vTarVW0YejIHRcH0AsRHphPT1dWzbyMA/VJqqosYUsK/jmAQs0oRIDU5O0khr/BTUUNhpfw3IS/ZTXyOZeRyWXHF1vtN+fAckxxHUrDuBlssqnz4fRsPHenWWkp/HlNyZp/gklQku9gm9fi95DwolIcceunqOs/KCl7v58R1nK/VZOydJwZuFKqY52KxmH5B+bS6q5+5VUBct6PanNPbUXFa39PFWKiL27yJ6eM+cMHi47kwgaxOJPt4pkym80ahmOOwQ6QXwoj6fD2ET0nPq9/K56JKXCDwsnf164XKF3al9vQ== 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=GYBSYyrfzYDZPenkGwyfMrFInG9Lh38VD1BLh7ED/IA=; b=Uw9BEaq/FnkhvqXPJjMseE+psxc1n09+q9huIQufk/7ji1PtuNWS29MBOxE6DL0R9DOa0bskC2y8hRYDXfXK2K1UxkZnaDsnm85af439Y/9KMBZKQ9sLEbb8WNcSRJMtHawyDaKb/P5b8EHs3rV3OmZ1ro95G57w+Sycpe0JAJo= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SA2PR10MB4603.namprd10.prod.outlook.com (2603:10b6:806:119::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Sun, 16 Oct 2022 20:00: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.5723.033; Sun, 16 Oct 2022 20:00: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 v4 27/36] scsi: sd: Have scsi-ml retry sd_sync_cache errors Date: Sun, 16 Oct 2022 14:59:37 -0500 Message-Id: <20221016195946.7613-28-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0059.namprd05.prod.outlook.com (2603:10b6:610:38::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_|SA2PR10MB4603:EE_ X-MS-Office365-Filtering-Correlation-Id: 9a5af23a-fa51-45e0-12c9-08daafb119c1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S7h6UmnTuJB96l5cNkeX4GRvy1xJP1YRTWR2GuOcpKUoKWdY4L1cE/yRx4i0/lQdi3Xq5DiEeuNcwlAvLr9uPNHAT6XoXVQjQ13xjsJB0XaWk6Kh56oO8T0mqAVZTBAK8nwELpiiYJmftw0dxqG9RD8Sb8jgjlxsJ3M4+EUkTPuf9gknWLLG0QAK6u+cWby8pwFV1G0cI8Eje3dfXgQuMoyR/WlXG+Odmn6RCLE1h4Qo1rOmzOXkbR2YaJ3B6TSCI1yqu/WHlNaAkrTlBQ9AELQxgfw8jeKOqUzqKB6nFgRba+v0ehG5J3SNzr3z5TFc6p43LA85RRsZQ2BQBaNGZ7eHSc763meCTv6/l3FTd9edbOuy/mRHIB+4KPR4hfru1349K1muTq1rl4YpFBM9RCuVUcWuULmUr25gidamnB8W9ElA7mMQW0jtMHP1K7EPkmAjNJ8uXZoytVdTBmj5fXwySw+XPtmaDD/bgraSelV2TH3IWMTMMmv9fjU7kSjqfL+SjRHVkoZId/CDisLSd/PQfAgtorPPKcbseFdkhkqJiqUJgTLlEZWAPN4jfp9vRsOT77Dp82neQFptnUTDKpyaVTjZFqAXuPQIUy9fCRyaQk986WQ6eS/XnOPhTq1zRtk1MYI8M6DqHCTJlyG0CjbuX6vtiB0G5Wk7iGkKH+Jp5AJ590+4nIe+QuyaMgl7ZNzEn36U+QQIplYIjOBx3g== 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)(376002)(39860400002)(136003)(396003)(366004)(346002)(451199015)(6486002)(4326008)(6666004)(316002)(478600001)(107886003)(66946007)(2616005)(66476007)(8676002)(66556008)(1076003)(5660300002)(2906002)(6506007)(186003)(41300700001)(8936002)(6512007)(36756003)(26005)(83380400001)(38100700002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qUlp8ewhpgF1BjW0jLrXIpGeMa0FnGmsCdSalfU0Y1TUaY1hFJLYdE307QsXnXsxMdKdI5sTyyITnf230QBnASgfaWrJ2o3dEd9+SU6Z3qLypoEb45oQxKzUEDPpcl0qf3znK0HnD1MtMexYKiEVP7Nh7nqwjcYXdO3KxpFgrjmYryDJEYu/ZyAnAMaVleTxOPpY98hHyBZNtNW7k/6nw4e+1twBNQAjwNz0G7b2RZowrA26UBnBefy0R4VNgprXntXTeK9s41YEmnId2ioqLWB8FCzIPlzzJdA8z+DdcS5i1c3vicM8VODcbemCaG9XcQC0hwTJ8tbrThLk9oZOy5jPH104msllemQss9CES3trkJWc5TD6As4KZN6pcLcn6AePsf422CnLMBA60JfGdaOjhp67eBZND93yT3mDaWfYftUYjzTVIlAqRuSceF6xc2wT/X1/YMSgWSIKE3B7bkR4HnrRfxXaCK5jldUN9DFwp04mln6GU97ZKarP8KosCVBfTNiKgw5K54Gr/1PQVu7uH7xLIcQGZr4g5HLzpDXIhCxviwwnShxVMHtAH3hdCdZBlSGBwy83MQOfaQsNmaXxMMKKWWlbxWK398Vjd2VzZoZzeGcgMvckM+9rIDkP9GdhlUZ3rR+ec+PV1LNOIgXAjv84v3HdYe+cS8upA9EDq2qfEXScQPrfohXzO2vYZcCojvYZ+b5JsZNYTaDFq3fCqY8WgaQvhd4hd+g7tVrQmdC7zfccKx8Lf6IY6Mg6bJ0Jv7DdckdrHopw6OI1KEff7PDnEOk9Mfj3RKSRFNRIATrTsZ+NwYIGlXYgpXq+dfHLYe7/coyHOdC7nsE3DrDzpiV4A6LJdk6D09KlMpKXFlCs8uti7zz/7xfVsIEHdSex2yu/dTejEoqgCGZq6RztzjfWckdEhrx5CnoAxjrTrl/HuJ6c9F2NozbqIw/+wPHnZjMrRZ0SYvAS/96bF8GF7eYv7/nIkoc18YpjeefHfCALR8dZwjoJaHtNnBaOCfN9NA8ZbrdeICDX8WAwev64eRUtoIPxufhH+NMgb+Bl55mAzeWv+PlpRg73s/Ok43Vt3h3uKF+CuRxHzEJm5z/1l5R5Sok50uvH49WzeSeLvaRyD9+4/iHvG7GMpqO8A6GbQJgNdu1iW+/ru6RDeHhfkhyGUc22swdxyGSb6X6I4uTnQGK6Usmc7T4liSt40ZH30oL2N8/EY4YfkQVTsDiEmyYqe2KLkoddOSWK2ycztT1RPWEtEfKlmU+Zet5EA/QKp0JK7SpgMANpTV/ttl5xneGZJvVl+4LxaPlolv2aHZXESUdnahfCspeE41ZJWSE8IGITNb44DDz2YAZzqs8Pd6c0oycV1hXGg5TJMcBwltp13cAd4tLyGPywD9qUFDw/RYi5SRgAjorciqS/D7YDOu0dtmlB2CsZxFf/ky/OYYjQ3kOyNmAADAXkMDetRmswTiAX7OrHxX8lxxNmH0gcM6xaZePLNnSsL09vEdvt3FjwpVuTZLlGjTHLTXQjeI47QDqfgF3pF6AGnMyU6fZCa1oyTEcFbQTbbWwZHS6A3J+RaQwg3gBZyc5bITajBpDc1F+OfdNOYep/P9dtyA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a5af23a-fa51-45e0-12c9-08daafb119c1 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:40.3596 (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: roBzlpO7kUTS2QCmxBStfulSTUlhdUwHhWIOfKDFrtXBVDttJpyPZz433QnlDF+ZAOXBPkb+1KqsnvIbYv2iXp1BEGGcPIHzw5ZoMr/it7E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4603 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: LyTGSApaXzTLnBoKuDy4JNV2Ojj7NpJB X-Proofpoint-GUID: LyTGSApaXzTLnBoKuDy4JNV2Ojj7NpJB 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 690884efce8f..c0c29b948476 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -1580,11 +1580,19 @@ static unsigned int sd_check_events(struct gendisk *disk, unsigned int clearing) static int sd_sync_cache(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr) { - int retries, res; struct scsi_device *sdp = sdkp->device; const int timeout = sdp->request_queue->rq_timeout * SD_FLUSH_TIMEOUT_MULTIPLIER; struct scsi_sense_hdr my_sshdr; + struct scsi_failure failures[] = { + { + .allowed = 3, + .result = SCMD_FAILURE_ANY, + }, + {}, + }; + 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 16 19:59: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: 616404 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 C1C46C43217 for ; Sun, 16 Oct 2022 20:01:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229908AbiJPUB6 (ORCPT ); Sun, 16 Oct 2022 16:01:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229843AbiJPUBQ (ORCPT ); Sun, 16 Oct 2022 16:01:16 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB36543E62 for ; Sun, 16 Oct 2022 13:00:55 -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 29GJXgVt015507; Sun, 16 Oct 2022 20:00:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=5VBOIbxCmCDCbH7p7/9/NxCP7ayVegHA6gbJGxtXhXA=; b=tfkqokNMD/PywJFMQsstY+FBN0iGLuU1JFLlDTdSqfcwyGQLAEQUEZEnUPSJ7A/0dZcE zRFxFeeH9MZwobomz4S20v8LdewZsyCgZo6mokH+YCI+tn8acudkwRycyPh4+sHmVeDX nAk/K/AnCntwypv9NjE0jkRB79PnaiJ1OFCweb/aiF6YinowdFNI0Fj2nkSrAe8y0mdV CWv55Gmhzc6xl0iHExBqpiFkhSRo9rfr+pVzQp0wKJBB42/k4pDrpWgmd5ZcR9WvF1z4 tSi5hfiCpvZJvaERcoEKG3M6ce+mmRJvhke7wakri6YTNd+MLi1l2Cc2TIiNySqBs/84 Cg== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k8jt2g7ag-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:45 +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 29GCBRO6029410; Sun, 16 Oct 2022 20:00:45 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2177.outbound.protection.outlook.com [104.47.56.177]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hr84k1x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VShLqFiZTJjmxL8sFW7ZlGdefY6Ufymo9vVFrePyGQWeXAos49HbgaSKlbHQsIHDtm49l4zIzKgeMoFzBh9SO3P3U7+ZGpPviP2icENjPi9u558vKoIBqfQA4ViH5OT2elhxJ2lPz2C4HldxaQeP1ZtqPzZJzK8/uNosEEcHKBaC94E7ndh4EoNMKgxg9AFDRwwRLGIyKQXDb1iI6vyuAbHE91H9VpeosTXbV/DtNKdli0bQpWf/nQXFDN7NyeM4+nijUsuIp8mLBXE3sh6UWnhFw6P0ibsLZ5bJykJFnbOY/hCDIpnKtA/KXeYFOQklzFAs7rRvVdjeh8RHP0tTjg== 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=SchNTIiPpaNrQmyOpDg/0GA3uq65CbbiRyW/fsVcjyDWKCDLAq1nTurhvDrNtIlOC0B+IjzoQLzBUI0lPmnnIYSET+EH6VmW5GzSEd92dIALWdKjcpJlv+phzyv+ibX6tjKgCkyp24fbNHxy8ilJXczezBjBsKWSxKHaykZkhz5cUeRq/u5Sg/jwsvlxPUxx0Kj5F4KJVlG9fdnIjlTHzXke28LACBdUP1M7HfKnAvDZ/D+nb/OVb49WXg6TOFJWBh9AcTSF/pY852YKSsSYayim/On0kj3IddPeqAenQ4vTf4O3ymQHuNtTsMJ8s4RQvU7Glr4Gg9xCPwfYsfk+DA== 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=PbXULFGcaVxIfmHMg29TpM3253kAgPH3LQ8gfib0p/1CI+Nueh9Lq7Zh3k2wYrr18WS+TuYfvN5HJo9sQXjg1DRtriMhA+xzVWvoai6siiwxmQqmHV4fEcNtg2OxJf5v4D8P0jUzFfOilL5bv3PQ6/FGpNT4CWBvXcQXKI7fJQU= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SA2PR10MB4603.namprd10.prod.outlook.com (2603:10b6:806:119::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Sun, 16 Oct 2022 20:00: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.5723.033; Sun, 16 Oct 2022 20:00: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 v4 28/36] scsi: ch: Have scsi-ml retry ch_do_scsi errors Date: Sun, 16 Oct 2022 14:59:38 -0500 Message-Id: <20221016195946.7613-29-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0064.namprd05.prod.outlook.com (2603:10b6:610:38::41) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SA2PR10MB4603:EE_ X-MS-Office365-Filtering-Correlation-Id: c0f48d43-ef52-4c89-5207-08daafb11aa8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4PFmj0IloNt3G15HrKHErVRAr35L71pksHjIUUE7GzkULFovNltNOlN2o5RGyOF11Bgm4fF/YNslJmiqd26XBAYvVjtG2V4gHv/3OL+YBA1OY1o1XCfOhVtTw/QyGf6daFmjWdZe9vpsD0ECqF28P9HVzQe2jKILDMQALDnUfgidSWh4BqGJAZeMz/aDS91/zd1IXNgXMSMmUDSVB/Vczc/kXP2Q7lO6qFGZDp5oI0x14QN8eQ2+zCrJ5vIc8RDHobc7h4sacPrWBaJek5Wqv8GBd/uuVYi+pzF+TEBhgQq2BahrWK/jnnBo7jeGoGilYiWraRtg9Q54RzEFM3SDMHApO0jajSOQBHZ6WB15hOHj9ujj0GxxPjmyv88rw2mS59WKFajWd7C9Tnc1fkAvMapFTOF0PUxaFhUl0kxGLpHEaXtoV/CeZsrytzjEqKKXYsrkvtzeR8Ulk90mVn/EC4DoE4Up7rDI06TPozcdRYskhsaqANkT8kC20HQEiAuTx+XDFXaCt1IWPSzAcuT7WZLOiT8U5GL1nd1bd5Whs+a0DPqPnhvkF1rgc2ekfhdU0W0YLxFWTEG6tJvTQhRX+Nek6P9L0tLqW01cNb76dpmTtRQnIB8Jl/l3spRt1Bz42FYygT/lUN1AW9Ra5owr3dEFaOC4vPKiONaJUjJZ+89PPVPqznjfo0ypNjBlhh347QMbiaN+5pofFKGnHg0PBg== 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)(376002)(39860400002)(136003)(396003)(366004)(346002)(451199015)(6486002)(4326008)(6666004)(316002)(478600001)(107886003)(66946007)(2616005)(66476007)(8676002)(66556008)(1076003)(5660300002)(2906002)(6506007)(186003)(41300700001)(8936002)(6512007)(36756003)(26005)(83380400001)(38100700002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HERQRxKL9DByof+03pKdYj2w8A9nq8j3oFKCKkdaXCJeOuGYa3JiwrH5MkwRU0mrn9ZZzOi7MmI9dBWOL/zBIALH/EL7GzmeGbC3aYlcsb3GifzRCXGDpU4uu7l3uS4VoNlKwBF+9bvySPsFpgoqXzWNQjlHoBPcliafTb5ZRPgGQG32Ax2hmrcx3TtX+qenkuujP3p1PyuW2lpFl5+AW/oyPpOatmQb+H/p0trQAvuSNEz3YpT8gxj6QtMapf9Y0Wkj/yWmyh+R1YeAxXlFiPccpix76LMJ+16siusbZHqxezpwZmJH5LrQ9e/xIn7DHzOUYYCHtxUaYmCRx+KuLlCiwKRJswQ/Ln1sPM1GOujvckqjYhPeQXcVrsr/62azKcbK7u0GIjONlj1D5enITk5uYDC7/ZKFMap1bjmDlq3T51Ux0Boisj+9g4xrlmyhNGBgHU0Ta8YfyZ8r9fqt6WVO4uAcTVpJPeiRDeQwdvqKB18pFVUvbeleFl3L4Efhk0PbhHRAoQodlp+4wJMmknAtoe4FkqpIRtXLYwUl0D01WW8TJwpTqdbEdgUrfJYAT27kZHv3molCPn3mINZxNHaImYXsX1rRoYQbTvu/39hwYChanX2JGOcUj2Fpqmo3fZqZ3Ts0JzM5rZfQ4pZM4QI3UGA0I0ggMoWTjNjwbU0ZY5FWT6n2gGyzZOhGKcXi2BlInFx8YY/5XqY4KGmeJ59ktqRdTPRf7z6rjWnJDXM0ARa4NbtR6Brv0rVB98+y9LR3WAOr0u2/+QxGeuEDYdVUJkyEPy8NusfPUk4O1OWL8aP7ASmr2cHSk7rwJL2+XuRaHo/ZyPrkUD5L0FGMX8RgmnaFLy4ccC4x+cvoQlHNamGjeItHSD8aZFpGUmmzTSq5TJ5O5ps0hpC18czoANmBTzc78pYxPw+ugzCeBNE0gXjYd/oYweBFdFwNY0d39YBWe85gnD70xfmfDKchm4kv9ebdVBwyRup7TDJf6fJqXyB2yDmOdnu8RYA8FzW4dKe4i3eJIlXweyqkKPCT91mKnYggi8qGRYBeoXbatxapCrPCtlEAxMXkRm//IqHZMt4qIRcEgaMtMx/DTa25XOWNnj/l3eeX3fBB22jPpF/iWT47SfUW7laFkKg6b8QEawGT7VnI32zQj7ObD8eD31yYRnCLKPbCmLhioMmW1uJrRDCK8CSSeKVp1BNtBct/tYRETLY1hSq8VgMahCZA5BJiCyq87pjpQVmE0GaHMxHuMwkoU9AeNpjTeAUd4trcZr1vHu5e+VObiWfTdVvIOIYmSHLZb66bnCmqUKb9m5AT2es/XXxBbeDOBlMoC/K+3IGXzDyeK1wrrZfctbAyDrObqJCN1PHaP0rRQ3+wLIDNc46vEXeuWAKHSvg44XhBOPbs4ftyDNjdB0r7BWWf3UktIhnING3H8YFaThB3fvRE++gx0xx5K6155Hf/1HaNfpeAblnxEtg+sW2y0mfjtqlBADixUUHx1ezXSs84nIOg1hsHxs3qffHGM1GDN6dDDi3qayvUBgmTNKVt0Lks3Oj9ZADXelZgffNNCIvJgv8HcN0BZ1lWCm0aCmqWdEIoy/DN1oG1av7vc0YBi8QUhQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0f48d43-ef52-4c89-5207-08daafb11aa8 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:41.9063 (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: HsDeswbb8vJX2PV+P3VXTaMz1b75W0Whrgeyd3J4JGRrXM/2R/46rzQsizqlKJhHFcMp+cAqpqXvvrN24GajDGn0qnSqIYGNbKTPBxi0F80= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4603 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: Iw2Xf25j2ovGmG6le6SROavlubc1n1Im X-Proofpoint-GUID: Iw2Xf25j2ovGmG6le6SROavlubc1n1Im 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 16 19:59: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: 616405 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 CF7EFC433FE for ; Sun, 16 Oct 2022 20:01:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229943AbiJPUBr (ORCPT ); Sun, 16 Oct 2022 16:01:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229849AbiJPUBO (ORCPT ); Sun, 16 Oct 2022 16:01:14 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78C1F437E1 for ; Sun, 16 Oct 2022 13:00:53 -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 29GJlr1X004935; Sun, 16 Oct 2022 20:00:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=GmOtgDWTQm+DIJCGDPaIxGqc++SvsLdQKZoRRmhKCZU=; b=mulpKDayVRLnyD6O7GFDN+OvfVwgwvu647/zLdlTRHD392q3VIMLW5RMUvYwpeLVRzzJ SIizIkPqulvm1FXJ01S1xIVi/XqF6qYJZMJ4h/Mk4ZIW8ZyKjIxFTSzegYRIrC1aKFGY qyo/H7IbBsqneYKc4kgmLLaPewgw9UtwJOPmQ553W1XYt/OjgdWVJCEHigGFId15lVwe qminUuOMH5YGZVilIZ5S/DTbdu0AmcXMteUybse2TLcDH6v7LYAL4nGT0Y+H04S3ncMq JbVYqeRHGlGVsAUOjChViR88DAs1YY3TEAWSGVh/n5Hsxpn2ngNKEp7oNQ0ufZ0FbeBZ NA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k8jt2g7ah-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:46 +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 29GCBRO7029410; Sun, 16 Oct 2022 20:00:45 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2177.outbound.protection.outlook.com [104.47.56.177]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hr84k1x-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:00:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VD9F4RzUcSSXbN6PLt/Tk3cTJkBVh9uTUaYtVvweR7aNzZYESQ4r7ZjjLw4rTE+kdb2/YlfraXGq5RLgQ04UDNBboccwagaaiFDDnBAGhfLyeTyvaAKJaqKNKZbvN4Vr/Fpl+nECDphqdJyMtcrIpM/Nfk0ovPNHqQvL622QuYLSqHJdc2VB0J0QZfnSPj9pbGg+asG2g5MiIsAfiZeFLCXJnYZfbPOCv5ukHR9DvtjLTivTDEXRFNCswGZuivRbuJmRZ2iGEH5IUDDiueKnbw9ecl3luPpZOSNq2uBDmkxuqqFIJTZj7cJ3VqAd/wSBKr4DjsMYpBbtBDKy+YTpuA== 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=Y4KvHpniaOgwI6IHhO96sJiwdSYcsN90kPL9S16//GPx4gC1UqTE9aDV5+5DiP+MQcyuTaO2vmstLJa+EKtjsZKou3vI+CBsyJRnlDT/EGuR12Dqv2gtYa/H0/H+6Jej9ximkKSAYs6EAB/hfq6esS4en5djVAH6dLUHPZXiVsRrHveyGp3Fgnfefaasmlc7+i7TU5ybPGONuwanohgllkdej9SiTvI+v0bilJU+vWLil8CRKeDljmfg60xo5jO9G58fO6ZYI3eTbsaauJovWuCs58gZJMF8ciKEgkrl5spqZAHfRCdhp/mIDTzFeg0MgyI0AI24G5cP257urEwkUQ== 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=iP5RFrZ8GoasR5rPxdjMW4oDCmn2lrN2Kj/92tLw8UFc4B0ACpgrMuUfjU25Ub38mED6GhNEm6fSK+RNdwIK8U20pRVC5R2QRwrwR3M3iuCFNJvJJD7b0bUweg1bnKCDr6a8A7x8BUY2HotYuGPpU8+dyXGaWOWwxj6+4HtR650= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SA2PR10MB4603.namprd10.prod.outlook.com (2603:10b6:806:119::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Sun, 16 Oct 2022 20:00: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.5723.033; Sun, 16 Oct 2022 20:00: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 v4 29/36] scsi: Have scsi-ml retry scsi_mode_sense errors Date: Sun, 16 Oct 2022 14:59:39 -0500 Message-Id: <20221016195946.7613-30-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0045.namprd05.prod.outlook.com (2603:10b6:610:38::22) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SA2PR10MB4603:EE_ X-MS-Office365-Filtering-Correlation-Id: 25378d9f-116a-4a2a-9148-08daafb11b8f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ro2R5mRMgMWO3RJgKjpAJlPt7PjgvaI5qoWZTCYR9VhrkeW8iamXXNYA3KNI2ArPhaKsUthVyAmXeSISwDdqUiTnM0sEx+v2e+YrFFfiJBeQ4QRHuQD6vd16VCcFC1FbM8lYSB+RPcxzz746jhF3EzF1jIkyC1T55os6jh+3Tf1BMoLxmu5PQl9mSpInmxtpd8GmDcqBmpyg/S7fjouepTOnn3SI2X3SW/RbJzMk1N16O+pgoRfXtkAP0q8M2Up7DREmBvFE2UHyvXE5pcs4PIqBoQJ5jVcHRbFQUOwwOpLhuLlxYgMPImZP/exS0AC3iv/JWj4USZyMSIAXb8wkTDfOeWhGHwCOU5S6tFghBOCP5zSbjkPCPbGOTxBKwTZPmVVbDSxGOAdMNL8t+On89Q1tzLibaO4lZ3fSOYjgpwx7GKotmEk39wXNbqteNFBh7XGIIQgvPedhj9GoGY+YDwp8B/kyZN4sJNh74SKaxMAdQccnssEroNM+EaN/+i7ersPI3cE0ZI+U3SqPNpdYqbTV1T+T4uCRX+k4WuEHKt7SfWIN1eOH9+c3Ou1JtHrqI7BoBRulqtC3jGwktdw+xo3hqrgj0hq0fP3gGyPaSoh5Kd6Iap1L9FGadSz9td+wOCxV6w+oaPc3vGVRSYzZ8YdY7TzRBwC7e5VtWv02TMg5Jk+UZeBYKWkcFcINE58YaFGfzmu4DJPjQ8KPFZxDJw== 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)(376002)(39860400002)(136003)(396003)(366004)(346002)(451199015)(6486002)(4326008)(6666004)(316002)(478600001)(107886003)(66946007)(2616005)(66476007)(8676002)(66556008)(1076003)(5660300002)(2906002)(6506007)(186003)(41300700001)(8936002)(6512007)(36756003)(26005)(83380400001)(38100700002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VEzq44rdgfUiEa1unTjsbm6YjuK+hHb14gKNVub/Td8rmzGmPUQjk2IBWjAkFSuIJxTvpxkH6xxnM/CGzcX/y4eUP+LXIx1thLbU5gh6dic1okovIEdo6UjlafGt/MSDGdTAX5v6ZfDYCm+koVp9pzEY/3uMvE2biczCTqnYMHIVDdLghCicLjHEwXPcURBqwsEKCXpMFhIqFqQaJhPV/TAfxhGiaQ+QQdKtLGGBooECcZLwCXuKUgOXHY1cv3n49W/8megtTMbVklY0wLLVfXdEfjA0VpviTD85K90qZmG16X8cxRlLNZmBxgjFaWzlWpXc54OitaAtkKTpmaYxpEeqgeOkAQr/DJO35Ivd82bWTySKHYBFW19NlhiyMbuB0eSETjIhUS9RudHKqiB9+dxUqzYUIYq2xYk8Gb8MJT4PFmedFYO7GcOR9Vrw1hnDRGuQZyV7NkE2zF4TtTLq3YBvLAafS8JyOGVO+2JajiuSIvovjUzjQPXEXhck4HYMpd7cO6zpQWLVGfKqmLir+Yz8zjza/AX1tT65VjbkdOs3yiTHZlrlN2WWvLidpfXKi7Lfz6MkOJuOVngFw7Phurw58fC1mH7VhL/XZ4lVEYD+FwpChCBcmhN2m5ZeCROdIi8u9CouUo6uX5yE0mGsxDKeP/J+isomr7Vg2QQpCck4c+SXNt9l5mRuu/hbIeypM9PHztnjKYZvEA+iH6WUbKBMgRhlElGvGUkHVpqk0LbfLGIdOt8QF2p2Ve42z8SMxLWpH2ITIuhWlFLTCA6knqWiA+zSHQoVQsgwtVcMwWF9poW8AIwjoVl90HQX6yZKxeBYUPYZvZpU45mO9xHCOT180ulLf7ep5atWcm/do5hK+O4BR+NJWtPszLdfQqKWb1vBkTkE3n2EpqYqF3pmqVQPVzWCifTrXIUN/V6AUiXE2CoOuQBxv6J1vhpwrH7jiqA+K0fH1jxe+AvZAbPCIFc+EX9sZhzu0146d2txhmwNeA2ndGRHV0Ii53PWrdKk35U++pM+xiIwxUbB11Ylgh56YrQiQuc7nVDWFl2bQq3fugerDaoLQDBrCzSRm0sBtsDEXCQfBGZeNGkus6Iv+5GR3Zfq0+3Zm11B1c1K4oqslLCQmc2jV44JMIRbicxoHcPrBOtRwLcOYpVZMb0hjhvurNJIoA1/D5XqIjwshfRTBr/m2RW8+kR3sNjU0GO9jrahkNcCjViSqJypt/9/1Bubi+E0WDjmO2Q9x5IgQqGeNoBhKllGfBcKXJ08O6dEpyg/43VTsG07uRMXkiZGv/99R9HsRweVprrhlMctjz5Q8CWybfgWpccFd51JCQm75sJrVPS1lum52xvpCrIBdVCE99KrAHILKrl+Y7+vfJpUinKpOiQiOUGFkhhZ4z8+L7Sd9yzAO6wMSjQGmOZFoOV7Z0pBejn2OK5hb+pyc8mIR+ufRgEMkNbN2jITMLLTNEmDs0CS5C6RHDEVVTlaC4erQLtcrWRHpQUjyCNS4+p5Xvj1HsVIf3inPc/94CTxNqTvJwhz3a8sCb6DC3FoJK0tH6xGQ5MIxgzlQtaQQTPu8M0zsIQwhPubcXwTXeaidbN7zFa5EG5emp552uHMrw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 25378d9f-116a-4a2a-9148-08daafb11b8f X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:43.4374 (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: q6z05EEyiRp1jUKiQOCdCumfBFOSne346VJyzR2grplroMsX2JXIOHG3g19JVh0iyl+4HjiM1p8VkZhHjslX0Lch6UpC9Z84/73g1/KZOA0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4603 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 phishscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: bmKRoTyBuhBNFWOlG1KsosYPFEaPyREM X-Proofpoint-GUID: bmKRoTyBuhBNFWOlG1KsosYPFEaPyREM 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 16 19:59: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: 615656 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 2C109C4332F for ; Sun, 16 Oct 2022 20:02:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229896AbiJPUCI (ORCPT ); Sun, 16 Oct 2022 16:02:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229892AbiJPUBZ (ORCPT ); Sun, 16 Oct 2022 16:01:25 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 111EB2BB20 for ; Sun, 16 Oct 2022 13:01: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 29GK1Ifx015345; Sun, 16 Oct 2022 20:01:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=v9Vt/+4lByIQ55PCkLsLJOhzpSiQJJplu+tsS3gcByM=; b=QDqQU184T5Xy6eRxRX9z4WaHc5h3DlXzE4ZuGUngQemgh6Q2WyLfU8AXDFJ3I/ToMWy6 0Am4g4b0bXDi4t44z5C6Yso6b2K53mycwIllVosfHPoNTXA98WolybD9ON1HuRKOeIg9 U+Mi0jMSjuFejgsGKc66lmvBgy0PM3zWRBrZxVyypJ6Lk4j3AYvoGEcW6iqAB8iUvFT6 h77a51TzsWH+SXJ2wUseWOzVqa8QQnwA9sE3NLt2mtxb8bIa/4+I5fBAO+WQfROfkc6H NBEcgwuDT15m7VAmGMvll6VKGgTcevwNPt1R9+w8fVFOST+PHR1KF/Q3O+K5zJqU/f1A 9Q== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k7mtyt2cb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:01:18 +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 29GCHbSh034322; Sun, 16 Oct 2022 20:01:17 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2174.outbound.protection.outlook.com [104.47.56.174]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hu54e0w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:01:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VFVQukB/A0ntYVy3mZowkSvKoJe9Tsy4NKuIpSTAa2ZQw/Ut6uywNNXF4k3dE5D2JpOyA3ipzP+FqEvk0pO+BR+D8G8Hv673a2gBwBUjIOrXqLTJ+kWpqOEs9il31yhbXrhoRojuXgREA1CVEnK0Nlyyd2QTh52qx3TLn2rBoRweHqH/NC43SB5pkehXiQCHLAjevExptovEa+WlbXoYwdlAcVOZdunQkkG1vBWf1BEhgbzMZ7fmZJItaGl9T9ad3dR11F8iT8h5WSm9REln6CWWTzUZYz9nR7rUV7vMwANG2mDISVXdqs6XckAC0D2f+kZH4itJpruDLoSTgMOWCQ== 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=v9Vt/+4lByIQ55PCkLsLJOhzpSiQJJplu+tsS3gcByM=; b=DCwSx2yWvxqBURCZMIdSWtXhJwjq8TGOdsdBZF2bNaXj3cm1JBlb7sFc5sYkmf8EEvrZ7Z+hivOloRr9QuNQwM9fsgYNBaFH75aLuYDU3BWjYK+AaO071pOkIFJo/kh3sBq0PUnuzNVXe+a7W1FhEjVJuGFgYVYxRon/WMtPTrfYIxwavsFK3qzGvKZd624dWj56/+UT2od67E6flxK1IMKvQcvlhYtuYXZxzhV7Fo0VBPfObRHMlDwkEFwUr4dGOSTHu+YPwAQBJdGnWxO9ngVgx6Yl+fLrIxZe6oy/HJY/z44Yq6i0Eg4uZhztiASK02P4w1pr7nBWHRB3r4r+HQ== 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=v9Vt/+4lByIQ55PCkLsLJOhzpSiQJJplu+tsS3gcByM=; b=Cz34PgbnhQVsKuJwzQThdnXRo17NwSfwjzfRU2pX6kQn70u/TUFfLx1XGaQiCOx9JgOwm9ESBoA8vNAw29Qx9UGr3ivuzJey+3xSxi7MrQsph7QgQbd+hOum0/1m3cqyzTCCwHiqAqn32yyzpAUQm+Vef2MubhtO47HdS9cOwQU= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SA2PR10MB4603.namprd10.prod.outlook.com (2603:10b6:806:119::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Sun, 16 Oct 2022 20:01:15 +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.5723.033; Sun, 16 Oct 2022 20:01:15 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 30/36] scsi: Have scsi-ml retry scsi_report_lun_scan errors Date: Sun, 16 Oct 2022 14:59:40 -0500 Message-Id: <20221016195946.7613-31-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0038.namprd05.prod.outlook.com (2603:10b6:610:38::15) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SA2PR10MB4603:EE_ X-MS-Office365-Filtering-Correlation-Id: 828042a3-0e95-46af-6e24-08daafb11c74 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bDiKuHQP1U1hc0ibzX0r14NDZoYVfJJUX1yQo+m3MX6PklvpB6UBqxMmkbQLRL4DoMeBorXaafNrvOpU7pme/n4G1QV302NC5K8K+I8E9SarNMvZLQB2XFhP4NqnGg9KSUhSXAMyyeLjvJGdOYmO5sR92PsMhzksYOpmoYKT4Ilm1XmYMznQ9WjYe8ARB+4rkdbv9u1uY8qE1Xotfxo4f44S+kfbPSeruwwB69fjdyo0lVaR3K0c78ZTe1iA5LYVsfMJKq/9z2LKxrEUwY4aeyROBqCE8HZvArnva4Q/+vNrxZWQWRGBIqA134IwrkdMvrqZMDAV5OudwO6osZLjx+1SHgNQcvLxfA/Ng/z0XdVKZlaWWiYBSKZdve5u4ZBqVhMU1HFOOLCQOtQopxhYCyO3b3Jnz/7KRCpHohPLnbnhK5qf0co8XZ7AL2Q9wrIjyjJunxX6jtVvgVHCZiwGUjam/rq6aiTrzJ6cnQgcG5dJ/GhTaoTFEV2pWNlVjmuWnKr1zZu9SQkDSTm8IGH15ut7YaHI+B+w+u7Dia744npiQfKa+X3OcnTuXF3YcWdBLOoBjcE5bvOrMT8cB9r19TKbFbAMS1Ba4eMMlATukmzbt+3INja4FAbYwm/z8PRXx6BpOjhRvWnNvcG1qTE03I8N+z57NMJwaVG//Ms/2r+a+XlLgWoEqNve0NzrjAf7IsZCyWJ2u0xTMjUcPSdxrA== 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)(376002)(39860400002)(136003)(396003)(366004)(346002)(451199015)(6486002)(4326008)(6666004)(316002)(478600001)(107886003)(66946007)(2616005)(66476007)(8676002)(66556008)(1076003)(5660300002)(2906002)(6506007)(186003)(41300700001)(8936002)(6512007)(36756003)(26005)(83380400001)(38100700002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: b4cHdgrj+n4aXJ63AJu0M5KcqbPWy3yVJ0FzmwmrPW4sIf8aDyzW1iE/q2/73tTSIO5gDlS5760kbhvOtATOkyreWMuuRzg3pgqajstnGNCxpoz++udCXNeX+Je6t0ueUWEf9+IxGCEAbknOQrtSvhMT9thea+g1D3lrfy3rTth2i1I3JNCCqD5UN9Vn4ITkDKLcNu+ezAMZCohm3DQUaKSUC1//DT53ZDKGEDaaXYoZHWFC431uQiZ4jKkSF6i6iwujp/zb6CoJIGeCdOURmL+L7g6D6xBtvbbrrbegd0Pk1tqft+F7NAp8lrYH8JZl8mT0Klim7fqxgZA82YO8zDmL+hVGwAGr/7Fkgkar3Mp8Cv9QlkmOTtxA47WBhOJJ0M7uJbIZ0he6SQmAvLSp1o2Xp66qeMcabs+6BrWXnIUU8iezrmCBvS5R91hf2jWbQJ39bYHmqE7oMGDUeuPHN8JLBxfVkRoqTB8JRIrANVbtTG1nmlg9bcLpnf4OAbdBPXtHeNG1D1tqFqA9WnHe9Asm3ZxyrE6SDXhDn90C4LwVSCewLAjPEjRdvepUaGoJ9rsWEDuFv9xpop0vREACpwDbJ8cfGkDqn4QdDR0UnyYjdsSZtg1qMp2vRIl/YsZsdVry7HEBPrzxo3gPwtgMRWdEE0zNeHhA4LnxZp+fKcsKJQWQJjYxNi5PaVi8iEYVvu7frA2erF/rUQFLfx+Efgpfw2BMtk9q5MH6cjW+25OErl59gVMJAmUxsfLppCYSqOIrZ9bj7Bk586rakVg1hFMXmJpILo3D++4J8y9LvV0tWf/BmAUzO8+6TqGq2VwSACJGKDYSyg0YB3q2q4ZaGYR7PoCdeIO+5vej75/8xx4DhfZRzpEkSar5ygm8pJi66VNWnzAPXLuyjVfOfPipz6z9DFqoEB5xkrsSqdrG7zU4UZibHfvjZ0LaM/k/LWlWEG312qDVgGjFRKAJ3c2reIYLm7WwThzl92o3PXpo9yGncH1M9pL08sA0fQ9ansU50GbOEgG+6/7tLr0fCDwLVt0GlfTjLLJpkHSTTE0YDJHsI54TVBKfj9pXPJj1Uly340hoFOTaJmdUCNkrGJLQFxe7RQXEHXi8/1/Fl0FuknHX0ou4vV7YemQdMIJ7jVi1BmpLsqJYG44e6aGG4e0cRhu2MSGefpUzIeRab7N7Ldm9anL5/o+M8m9sgmX69ESE9P4eod6gj0Bu8d3bWUpJCHhkUkGL40xZV6154oi/Tl1wj6Y6kPCmqx8ZTqQ4ezCSu6//S4yDt2+CTomjvmd1AxQvQkA6kTqTSxa8kpOeOppjCeK/DYSTsluEb4tohRhhcX8Or++EKbDLz4Ou1M8zYOGqqOi0q+XPppLzbc9RoI3wijrFOLV84iLtT2fr2CJIH30jIUIFsGvlUkLDPiCXP4VMZOrHn8KI9FFSFu6MoIhzbonuWWFima1EhQKuSnvooj+GQUWSS+/INh3WnqVgI1pqBlOfKnPYHZknpXpV4aoJkWBqFgzKXLnVzO6K3rUZvLu5nG7ZafNghx2XesjwGlOLmldG0zGIh4GtfhGt3Qt4a//RdK/th/ZV1PmAUelAHckuFPXZp1zwmQSdOUP4qg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 828042a3-0e95-46af-6e24-08daafb11c74 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:44.8904 (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: zhkd6gn9G/Lswfdt8dbnhZkqkM4Vtyu0dC9xIxi2cb758PHxnDDODYZpRLwl0ikxBu+OQ7yO6r2M1unr5I40hYacw7Bjt3nHhpvAXk+1YEQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4603 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 adultscore=0 mlxscore=0 spamscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: _laxGahyO1eC_YVjWxfZ-9LHVhwmeHoU X-Proofpoint-GUID: _laxGahyO1eC_YVjWxfZ-9LHVhwmeHoU 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 | 57 ++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 28d53efc192b..564ab7507f2e 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -1425,13 +1425,21 @@ static int scsi_report_lun_scan(struct scsi_target *starget, blist_flags_t bflag unsigned int length; u64 lun; unsigned int num_luns; - unsigned int retries; int result; struct scsi_lun *lunp, *lun_data; - struct scsi_sense_hdr sshdr; struct scsi_device *sdev; struct Scsi_Host *shost = dev_to_shost(&starget->dev); - int ret = 0; + 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, + }, + {}, + }; /* * Only support SCSI-3 and up devices if BLIST_NOREPORTLUN is not set. @@ -1500,34 +1508,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 16 19:59: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: 616400 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 B3E29C433FE for ; Sun, 16 Oct 2022 20:03:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229797AbiJPUDf (ORCPT ); Sun, 16 Oct 2022 16:03:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229793AbiJPUD3 (ORCPT ); Sun, 16 Oct 2022 16:03:29 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAEE82615 for ; Sun, 16 Oct 2022 13:03:27 -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 29GD7nOO013302; Sun, 16 Oct 2022 20:01: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=4LlbmSThvVhxDqjW5AcPdYBTOYyTXOuIh/PUoH24gmk=; b=ApTKD92j5nF6ta//rAbhvcwP/i0kHfK+8YdgSfq8HI1X3vbLHrNq524MJ+JU9vlF592B lnT4Dt1zUNvwgmMnKujEH3bsstsSyzskAUudJdHVkLDdbvUBBiCC8YPuGh6jM33k6jFf 5saz71yId5gh31o2GiGIAV0u5fJO/KdDFptsAD7TKbzJEIdl1AJBMf8chwqt4igjn0os GR6eNpToHQWGZqWLe+WtaRxVR4ulAN53cGQ0mc64ikHmHXSBTZa5gqFCI1z7QZzmLfsL Qxit6mWOcrFqcxdgQGlaIwR+KZdxhnYYY6vI693jWVtiDGgiYDrCcXJAOxXPSIJ8qxEA ag== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k85mfs5rr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:01:19 +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 29GCHbSj034322; Sun, 16 Oct 2022 20:01:18 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2174.outbound.protection.outlook.com [104.47.56.174]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hu54e0w-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:01:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kgZAUf8YRBMzo9z9aDV6WpyWFFgnMonq4DChU9jNdcFWCzVk1vYgxaPIXuiQsde3FSHF4M2WXUiZnhcnx0f9IMzo7hX/nybsSiqjsHeaEpRwdTIP9hgAAGl1Q0ndF7i6iUwnmyZv/wjKwOo6cQhD2sUqyrxYzZmg8N1CEt8COTgEqQ2Rz57pnwMTf0ZQIloQ8GYLJpSoALXPkJa8MObFPSyjWs8jrJV5mUcoYWuMBrmWDG7AKabOFjhzctq23gZbU/HNPfQ8iMNsstKzBu06HifQ7Mxl+uXJNz12XxZgiFg7SjvgT/a7azLTQVnBFKEYzz12B0TncO+zXlbd8Dcuww== 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=4LlbmSThvVhxDqjW5AcPdYBTOYyTXOuIh/PUoH24gmk=; b=RjNmBtz4JbgGiXpGCucYyKPTmN+89SR7AgyCthNhvakxWf8SCjQKXB74YsCsQO9jaP90B/1LzCxJAPVG2/0xeYRDIido0aDU48jcZGo9MWqGiQkE76LmsW8X9wXHgcaq3f81zmN57aeqI9qRdpBxX7SEBkx1t0BCHXLgGaMautuMzqulvrEKmviM+pHueJtorI8Lt5KsC8LaK9p9RKKtv3O7iz1Judb0h0qvG6zv/waXOhJYdSElp+zgTVXUlKd8xo67qGG+QutXKGLAKI4b2vewK8cYKTVso7AWivuTK+eSP0GVS85FVxD0Hhj1T8U771ocmGV1vnPhR+rFHpmpJw== 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=4LlbmSThvVhxDqjW5AcPdYBTOYyTXOuIh/PUoH24gmk=; b=YqdpMhFuVIeIULP+ORe6ls9a7YyXttRfiff1NRLcNx75472VgdyI0EWZ1NwGL6Q10Pdyi8io3KpgAq4RXpoAyekZU/9WLA6FflAxkX+oKaNV5APpq7jLnHG/Rvu8UFo5fG1q77goXUn7/EZpnRPApIP4toHRlm9zvehRIdF6yO8= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SA2PR10MB4603.namprd10.prod.outlook.com (2603:10b6:806:119::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Sun, 16 Oct 2022 20:01:15 +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.5723.033; Sun, 16 Oct 2022 20:01:15 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 31/36] scsi: sd: Have sd_pr_command retry UAs Date: Sun, 16 Oct 2022 14:59:41 -0500 Message-Id: <20221016195946.7613-32-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0069.namprd05.prod.outlook.com (2603:10b6:610:38::46) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SA2PR10MB4603:EE_ X-MS-Office365-Filtering-Correlation-Id: cc224a89-64c6-48aa-8679-08daafb11d54 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gO15dZMelt/slv/dCiPkYUv1AOTeMTiUJCyCub57Mg6sVigshiVUjxTeKqWLw+XLVSPn4+qlrcwYyLE6vDKr7fw/mb+hOwfCiaR4Xsv7dO+k0xMlZQZHMaLbGEEuNpxwV0Pax28pExwPSlI5wnyzSkVq3GUxFje0zwLjlMQpan2J1ZRFzSGwVFJj0KdEjsyKoNZWK37fUze1U8mJxaCr95jwxo2GCYjJrVamZV1rXEjxxLou2yFT2Q89XNDr4mcxqKK+BDCdpWvfBatoHwd8FRDk06NIyeDP/OqYSg9iKGK8jGvWLNPtEX2g1dHiqWt+d3XIDgtFhmOY/rZmqE7tDP1Fw5yN4zsEQzVNV7JN1c3694mt6qzdMUFHyMJGwXTIPJOgvN6/scZYTI5TJot0GVpl2WYx6CiLyW8amT16+8PHLkq6Jxs0HQelduDRI4yCKWcbl47PWdZTuooeq6UmdZfPXkuhzAxlCoak3cnALHirKb8cRsWrKWflhBfUc89MUPMormw74KZikUchPKvd8WWcHYaNV0QoycRtTEFB0TafOsg3/uku/wKXXKYdP7irbqJNBoZhb8hWzaCzVI9+TBEVuCzvFdFgplb3HZanTImsmpm5hN8osmYRys6lGGvhxmba62NUepsSFReeamJ+LYQ1i/aOtT4Ef5ALnlkvh6OuXWywEWR7l2eb4kvMC/TVvtd98ENZKG7oUlhaoae4zg== 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)(376002)(39860400002)(136003)(396003)(366004)(346002)(451199015)(6486002)(4326008)(6666004)(316002)(478600001)(107886003)(66946007)(2616005)(66476007)(8676002)(66556008)(1076003)(5660300002)(2906002)(6506007)(186003)(41300700001)(8936002)(6512007)(36756003)(26005)(83380400001)(38100700002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sDSrOxGPYAcoKiJpXemVQrOj4QG7mrZG8XTTvcpPyNHl+16N7U+BTI6p7pB/mUnw36r6nbJ8v7tU1dOCt0pg3aB2ccVtRDomVBWw7OG6ihHv2MFIkh+LA+CklcSTL+npKWv3DO6op6E5IrTPZUS64bLkjQLQCEgeQ7qRrEktF+sTtKznAkZwCeZEuBInnFf3hjZPK5zUf0bopl9KCODWmPmebVqPcy8FNncJTfn3cMWHSglXMeVPmtpcxFz3Z/28qp2r8csWE9B0B3PincYWN3lp/YGJ7xupPNBiRuQECb9DjU3fS5gu/Tkgj7qsf7SZ+MeBvPXw003KcpBq3cEdwnAN/JbLv/3IEKwwZZk0bYeb4sUt/pncFqSGrEU+38Q58WZCizQ9yQDro2E1a6MhUAiC+sePrPUk8I2DBhxXyoGPAmZO91AdTSBGspJ2O5y6jFSg1a8o+ZMG85JCQeHBhT1TSGj2rDaGKtshilve4jnj/13vm3NbGLRnjzx5KeG1Y5el3SXtm9vG2v3pTOkFPq93bcSEB04464S8N98lJ6CR4Oxikq9duVEp6Sxe5IUF1DFbQde15+bYyhcYAz6rKbIxVpegqbT4B+fvC5o5qzheXg/3z7+aWKZw9uqm6x1XH1qs+h5s6myyULEmFqoJNuKHlkofMlEc/uAil8CFAR1fuw8/6fnBsUVcwsIhHLXl4zCQeDrx4/8mSueHnR6GFRk+1U6aj0envCwTKB+j5Ow6CPbvX5PZkN1D+IkOYa2905BG4E2aDfjnSg3YSqjkQSq0NC/9tYgrhHpT7pmbhvqv8QFrmU1CiY+J8bthI3MLTuZ0YMe1o2MH2i1ECbK1YLrA7guGGV0eMmVG1uCPiS7//XUE9rhpWnxONDCwy5lMPLuLlqMMsjsLoS2mJvqvNlncLPPKEcMj4ZL3cuIl+GwfC4S1cCpwq2IiiUNMY9u7TC4q6GkNle1a+Xb55yehvFzRRwYcFtSvS3esshLkW6GNSOgrQ27vjrWjm8fM8cmmA471hj7KacgKGqPSvw9bMxzRoeKwIw9E4ZIHrf4b0L/9bKUPWZ3IDiEGgPoAlVrhnyQp7A0KC7Q6NKBlufdcBlwqFnhENkXvJSHntNRXBkZtlCUXJI4tDPJN5dknfUGgX+aZ/U2jAqTL3B6u8kNke/BV1ou6aIVchdXqVsFIHA6kC1wDiTQM9rUfwOX5BkV6Cby3POTtfYG75cYbTCKmFEpT6Og/1QT5EAdmiayH4dCBYs9io0sqc8z9WSyC3/JDY0Wtzq7Nxp0q0BDWyY7JqQL7doqj6I5xOd1neiokGywAKD7OsbUTcxTANvsWvpfZkgI1rzpWBNV0ntmHkrsdKw8HN2fGRcCo/osg/KghvX3jgL8v0bw8GyhblKeb/s/Y48d3W/KF/cXbgx1QEkZNEbUXrve8zEohwMW0Zi3LYCLWU/gmlxtItudIJk68/rnaRAMRiw4Rf9ZK90cuuiuDKwwr1TnaoRpInpDIweSzDLeASI6gDJcE0jwMS5EJnyZHiORitn4+Fp2ERf6AVHoJFvcyhkg+3faCs41xh2Bv/KG6GPX/cyk21PvqmJUq6QkxaaOS4uVYNXFhL4uE3p/fjQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc224a89-64c6-48aa-8679-08daafb11d54 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:46.4216 (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: Z7iVcimQisTax5MXDrxunrzPR+TKs84vDKJHALxSktEVOseEWhQsyYReTxlDdNUhtm42wc+h3tFVIOnkAx0Q0d9bMZfsI2Yco4jhRA/u/s8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4603 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 adultscore=0 mlxscore=0 spamscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: I-74pOb9Ffyqwj85gVVnh2bD_m1PyNO4 X-Proofpoint-GUID: I-74pOb9Ffyqwj85gVVnh2bD_m1PyNO4 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 c0c29b948476..d19e2d20ad91 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 16 19:59: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: 616403 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 A6F8DC433FE for ; Sun, 16 Oct 2022 20:02:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229905AbiJPUCK (ORCPT ); Sun, 16 Oct 2022 16:02:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229900AbiJPUB1 (ORCPT ); Sun, 16 Oct 2022 16:01:27 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EC482C660 for ; Sun, 16 Oct 2022 13:01:26 -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 29GJXnrX015579; Sun, 16 Oct 2022 20:01: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=jxLdzpYRskLFdX0/hNwKee6XSQV0rluU423kGQiLvB0=; b=cvsjd56xUkibPMd4km+Y1Wl+JJ1HbvCo8iDyN80IKYF7tRTKOlfIkR51q2InGMOHr+Lk 2OyxZsa3gr5jEwG7qS8EH8kcodx0FWQPLETnnLAPT6rAnz3GZLE686TPe891DjEyuoJP 1BB8JnR/VFJuEmNaa1cRgWn3emU2Jv0AsvOAr9LVcB+/qd/QSVJckbuagfhtY1747ld9 MEb/wSnFDxPnu3X9sJPRvaibPj4uBJvht4tOsqwgdE05BWDR+5GIAxtU4mFUDm/f6cJs VUJ+01Rzf6IEcF2eXbgkDyuWfNXCLOGnvI+rX5r3AX6BImibtPQvTxuEM2wo0hQ/JHn1 7w== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k8jt2g7b1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:01:19 +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 29GCHbSk034322; Sun, 16 Oct 2022 20:01:18 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2174.outbound.protection.outlook.com [104.47.56.174]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hu54e0w-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:01:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VClkHHDCkBpWNElWCbl5TuRXA2ntRHSqU4ROz/yRH81XOghGz28DgTHUCPgzKoqJWvDPUY/Qxb4vYDY+oi0asXtE0H+DvL2jJZy5DG3Z45wMKoIUN+BtwUQ+d0WjlL/+ZAP+fClwvI845WGQN8HdJFN+5aVFBU9fmr94ZR8RMFPwSMNrNWnOGapgIxhy+vfGGqM6vOe2MSAB5v7okD3Tw/mg12BLv9521cwT+UCwLa/vMbMpGa6e3CNCpOnV4m0geV7lqS78D0162DCxcuc5ZiU2xFkpr0FtMTeeSEjuOGtMz6ghueS+gz1hJDu8bAsUzqOrpauTKrU5xzZhGvZf+A== 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=jxLdzpYRskLFdX0/hNwKee6XSQV0rluU423kGQiLvB0=; b=Dy9ab5wOxNbO9m/fvhWuysXQVI8Uk7lcNvNR0WTLWhRl3Rzc7NMtOenPoGIpSe0rzw/MmCb97DI9mGPtGmEw7wSM7j8qBeNN1HBql/jkJXDAw2D7VkxFZQqWLj2UCwFIBA4NPXqeW0Fsbf7yCXmDafafCKH/8Mz/08yLZ8pnQeTGD+pmGXLd9y7alfdErnPRYhvEgg6FwleAhXSoKhQMI1460w5ByK3aERSNfcGheHYGkDH74n6kBGGXoDGov3NsqzETGkHvhd0qyLMrO0jPRj7pw0LAx3Q9UnUw59JIz9Ld2SsxNhnQo4pXuAyV4lFOnd2OQdiakNFAhT9NyVcfzg== 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=jxLdzpYRskLFdX0/hNwKee6XSQV0rluU423kGQiLvB0=; b=CIYH/7Kvp3ZbLo2czkZ5HwK+3GHcxs3cyJ+JVZ2UfBgBT/P5CXO7z333tV9KflHgnZO87oRWcGnWmloB2u4rBSxLEStXSfo/iBuVtS0pb+oaRhlVKLzI2CNj7usYMjP75yUhYagR8Ul9L2R3Yz0NrucMF0+XQyTSEfPYUK2Sxfs= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SA2PR10MB4603.namprd10.prod.outlook.com (2603:10b6:806:119::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Sun, 16 Oct 2022 20:01:15 +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.5723.033; Sun, 16 Oct 2022 20:01:15 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 32/36] scsi: sd: Have scsi-ml retry read_capacity_10 errors Date: Sun, 16 Oct 2022 14:59:42 -0500 Message-Id: <20221016195946.7613-33-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-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_|SA2PR10MB4603:EE_ X-MS-Office365-Filtering-Correlation-Id: afa79b2c-1ce6-44bf-8a4b-08daafb11e40 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6TR9MCIXAsGqFEaeK7SwwJzfYbw7ZdTZI1jjQipFI0Pp9MMpC77Ut4hj/vUvANhSTQbOzIbNr1WekLy9dJ5ZmSKCimB84f1mkL4iNkii9IO1sYBUlDvCPImlw990GxJOERvF+HJOAo4S/ChIMtLI1DPebvxAdvJZIo9/7TZp28qLQx65gFRtb4K5SWOs4FLY4+BEb6s4b1j12a6mjqumJchsr9liswfRsPw5Zwu2d6En2pqTe3gRyYpCcehVOHNvbLy3sj6liL7nQtGdbdfMzTskVKt/fb7/kNPEGh2qDLHImpf4eNccVgydwT8XNA2++AMH5op1m9gQith6jAeQclzqWoy7WvMTee9zOiBVvZJBZTOyUYqO1FphLUsUzUIoWnS4zR0J6NR9G3+jIuwCKbwRG7Ab9urGMM+pwtZO3CU+DeYJ735Ey8skSAE8wUcvrXWT4U1gKrHohs/6y680O2s+2mQs6DK6l3PiLNonmdG+GQ4zj1RxEuVTI4FwtJGp/8ruz8pKtyLJt7z/Ge1Waqe/eHAw3Fgh24IaO/uJ2U2vrLgKqL/zsudXgRdl4gaWfsf5tIb8CbXqzSFnO4187D9+cH/SrldQrJZBUrgIkXUGQs/SP4b87ysx1wHWsksj2kU57bsT5TtR2/tQBMDjJuF3Arafa+b42uY3Dsv9u8H2FhB5B21daAJmo38C36lPGWYS34t2CiyM0s77nubELQ== 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)(376002)(39860400002)(136003)(396003)(366004)(346002)(451199015)(6486002)(4326008)(6666004)(316002)(478600001)(107886003)(66946007)(2616005)(66476007)(8676002)(66556008)(1076003)(5660300002)(2906002)(6506007)(186003)(41300700001)(8936002)(6512007)(36756003)(26005)(83380400001)(38100700002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: M1HAzKQinbPXsaOJSYVs9fNlMTX6qLctCVlADjcY+/FaPBOS9zd34iWg2HwxTO4+XXV/6M9OoWnaZciHLowhJc2CvmyI2KD6JtHEHP+hAF7SY5N7fEjevbstwQTbQJRXQtZeYpu15FEJ3Gjvi0fwoz3s0FhSYnSFH/GqsywTR2IgRh0cHmfQxFJ9tfKrtxr9frEjOsEEFqTEevEt8YCJJSj8W4rgZRqhIzqoHoKSX9bJgJeqtSD9ppzNTQo4U4NZamd8r+vCWEiJjesc9Btoo5H2sKtbVhtDUlyjOMqSPNw6YUnjHfKJ9GldfYtE1Cv+hmfT/gJzd7SMqWnSbDN+G4IP0AmUftSQ5bh/OztcPstvuzsBAUdqlh/Ibe0aEg4HhXqyVbNcXu9WPtZTBg/8zo1PlF94ST8cKAEPuQJhVl+KWIbGPTy1zAjBHCdxhlE5qdWp3iDzTGgg2uQiixMyHCeInGA2s4kFiL+uFW5ymFobMxmXDQk5vzmcAU10A/s5rIN5y1fSZm2yLUO+KmB5b54DhoohQWIlycGYzeCqaV0Da9P6qGzciRpxG5/pYLmZucwrKEJFAlCtwfFn5+DBcVQ8SyiD+IvPFWRo96s2CcVSPohMWNFuSj6lQgXIoGfaP54LikKFGn7i+m4+N6u2qaJ56Yvavcs+oG5t9vmHnW4PCnrAoFRf7TLgJPQfra6+aULAzR9FXZ+pX9BThBsvUQkaYZSjnj+e0ng0eJch+yp4nC7bifXo+m6ZxFELtsiPUWr9oEz5u/zs4lHeu3pcIYUD7O8kYEoIPs4GFYhySmwf5L1Y60bF5uMzcMt54gNKvcihdJJWZsVu2l9YC847+2zNne5ypcR5cbrOMgxLTM6U5b11tCJf2BYHp4fxEvWE9PAYkY2yO3ElGuOdEaSqIbWnGzCdif6Md1pvTVfbEGnvdofMUaIn+J7XaFHzrj+kHCxfHXLmBTCyWR8BptNxquU/QlfAdaOLpTN53pOr1hJJA1MlRXJssTDUS769i6pjnzy1G8PCCT9bgkvNA+vndgWTanE6dPSGQSIG/6C5tJLzUEAaqXfDTWMYQ6hTbYz7x54RhG0MUaIfEl/IBv23QgGIa+j9tmnaXV09d4vaC1tsXMK+4RmbMz6k0I+xvErZcBWTt6Y8ZcfpFDoQtQQ15DCNI+yafr2wiOAsPgjUcm/dimc1fE+IocWYg7JningfjqrgXvWfcA8KD5MvFEY6e87Pg8ZOVG9+/inyQnWLJKtHzblzuOBrWwtxLQUJ3erb7QOAMFrvnn4EJWdewqg+w4DZy6rmXZ6wmqAcOS/zE/qG/cMx+odddbgz13qxIfyW6ez6QlJRu7w7ZOHCOQPe2G/1zS759S6x2N4mPjhfv4BnuSLBUEpoHEliqUCY2KJfFmfoW65Zd2witkMPNYVAeKSCO0z2ADyC0XwG/1rx2ZMT1ZwlVsgjatCQo3n7N559uqqq9SmMsAN8TsK1rzAV4Gg0lp1jVU/tIGFjFW8A4LwEj7HTpdb16hgL7b0VXK+Pt3S3z7mIFyHturMOtAEbSXJ9YF+w5APEb2hFpRrpioFDgRlg5zW/mj+vyhfCyF7hLdrvWjkv2i5XnLa9SED0FA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: afa79b2c-1ce6-44bf-8a4b-08daafb11e40 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:47.8902 (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: 522ShI/Vlh/rtcMdu+ebvcNQL1/sx2R1dvmR36TwHwFV6oW6mv0CGO6ay4xc3FP/TNysfcbZwijnHsS3cE+N/lXOe6mtYcmuAMWo+VV7TxM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4603 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 adultscore=0 mlxscore=0 spamscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: fw4LLebh6j0r7MnX_APm02ovSXzbbx_d X-Proofpoint-GUID: fw4LLebh6j0r7MnX_APm02ovSXzbbx_d 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 | 60 +++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index d19e2d20ad91..7d8e269f3954 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2391,45 +2391,43 @@ 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[] = { + { + .sense = UNIT_ATTENTION, + .asc = 0x29, + .ascq = 0, + /* Device reset might occur several times */ + .allowed = READ_CAPACITY_RETRIES_ON_RESET, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .result = SCMD_FAILURE_ANY, + .allowed = 3, + }, + {}, + }; - do { - cmd[0] = READ_CAPACITY; - memset(&cmd[1], 0, 9); - memset(buffer, 0, 8); - - the_result = scsi_exec_req(((struct scsi_exec_args) { - .sdev = sdp, - .cmd = cmd, - .data_dir = DMA_FROM_DEVICE, - .buf = buffer, - .buf_len = 8, - .sshdr = &sshdr, - .timeout = SD_TIMEOUT, - .retries = sdkp->max_retries })); - - if (media_not_present(sdkp, &sshdr)) - return -ENODEV; + 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 16 19:59: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: 616399 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 87C48C43217 for ; Sun, 16 Oct 2022 20:03:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229801AbiJPUDi (ORCPT ); Sun, 16 Oct 2022 16:03:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229774AbiJPUDb (ORCPT ); Sun, 16 Oct 2022 16:03:31 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2308323EB3 for ; Sun, 16 Oct 2022 13:03:31 -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 29GGLn6l007234; Sun, 16 Oct 2022 20:01:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=bv2QDst3SvZ9Om5sDv86682KKPj3G+AqO8+l3f6Ty5k=; b=rqVEb6mkLexEO4/0n2uOnk1rr+0CAfkfLoNuhWrQd3EjdAYwZulo+Kg4m1AkjTgu3lZV 2HMKaT+xnekmN0Pz5F5JehyujHSZdC7zN5U2F5v+7IMy9GJehQO9rQmxudWnbK2fgB4H 27/cUP80tEXO8aI8AKG+UOfFGrwXZJ5yByPdWg79TrKR5+9Ko6GSZa/cORawJEOXhfPx ixKqwYpNR/qImEMrR5OFfQd5uaT02OO3k42Lzcn0axOI9gL0aDyXLyi9H3qA2l6iDEE5 iGG0nbd5lb6XWRAzF6jaP6NcUoqsy5hNFygxi0wYeu2OgOJroad05RFQ6y11d220J/Mh Xg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k85mfs5rt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:01:20 +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 29GCHbSl034322; Sun, 16 Oct 2022 20:01:18 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2174.outbound.protection.outlook.com [104.47.56.174]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hu54e0w-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:01:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N6LRYcziZSmtNVQw+Klqf9NElUM22TM7S4q5GxkHJXAi8Rn91FW0XVZ9xem1meimzpZumrG+kQg93vgMWn6idFEfOWJuFM+5bJNGueloHwEjGl4XihLCOcQDFDdIGyoCTK1T6CQLokk1Xw6/p0BK9kRoQIyd6C9WeLKwyrV9lHmn9SnC2WHNCP7/TfU6sl4bYYLSF0MUY+WN1YGK9pcknOwPQhtNjWVYGhotFEhrDK3nr2C5ICC4mBsCm7gsaEyrs13c8PQS267v/fFviYaQqFSxuKF8+UOyqNQ+AYjmaVezo7y1ppNm7FKiMCVEER4x80T/gcxQgKTlGjoYQVklew== 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=l1eySLNE0bJxhQyeAI+VUC800WFkxpkWpB4qC8DaNAtK88uHmsJ1YBsKPe9XGIYivnDE2Q1oMybfDs5IEMcdDuY8D+9yr72cf/pimV3x8/YNXuu7wBMGJ4IBlC6yurTjnbgzl9kdruC2kJ2Cn/cjouNw+Iab8D0fBe1FBiimxLHz5BZTp6oenChlUbKUR2JTOos10huM5JwG95leYrFnlvioyxPVWI6ZtGcqd3exU749coDLeK6Pw6hViHQxeTno//1Ux4a1FjImhz8JNic8Ub7VATudjvdgv1cKr2JzziQ09dUpcC7ShoEZ0zSQDhVu2d+fpuKjAnhxmQnK/7S3Mw== 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=keQJWvETypLaNfgw0QuIDgLFmueMlJNPK68wmxL2V1hSfV/UN2lrFlhcIoPto57gSIMct5nBOtNA0svx4pPXs1bCh/nrsukylj220gp8ki26MnGIxwbheV7mj989HUoRioZQTFdEouTFk5QIc9V8IT9UedW1mw+1IpYxhh5QyZ4= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SA2PR10MB4603.namprd10.prod.outlook.com (2603:10b6:806:119::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Sun, 16 Oct 2022 20:01: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.5723.033; Sun, 16 Oct 2022 20:01:16 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 33/36] scsi: ses: Have scsi-ml retry scsi_exec_req errors Date: Sun, 16 Oct 2022 14:59:43 -0500 Message-Id: <20221016195946.7613-34-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0046.namprd05.prod.outlook.com (2603:10b6:610:38::23) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SA2PR10MB4603:EE_ X-MS-Office365-Filtering-Correlation-Id: 07e5ffed-738a-4f30-f277-08daafb11f0f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wUf4rqYMLGE4yrIAbUNdb59VjLMlfIsN5DmC6JKtbsazvduZtKwbo/dsm7PLluQboxhTx0+lw7fN2yzNQtAE+w+yIqtB1V8UK0N76/B9T4JBDd7UIrxHVqkPUCEoETWpDy14G2z6whZ4XqWuKsu4mXX9gSjgXJ7B7LWiZQg4sfQ7BDWXKWL/qt5zuR0SBlDi5J91gcfns0MaZ4Ipfsbpe1lsauHVaxE3473xBCQK+4PkeXjP2LOpLwD+5VWowtsLxRjITusOPNWA/HwoxJvjP+LuyM7VnXPtznTF48uuqMYuuWPvWzgzOWF4cwtqrtc/It847xfNJfoqFZrqSs263ggtT7opcJj8ThJys0q6/2XvmG3hiIsfYD9uKNn8H0+5Fy0apHJiv1rNU3E4G9c1FEkJr6lk++PZiSMHTzRcut2bl8xDsm47b/chNAtjuzxawy7OgkKJL1F7gbE+0bRnVna2SMBneozoGKIqEnkFXpUfsblSD7uWqKHjO/4ALD3EjmpmMpywpSjmSt24/0WXu9wqGCb9ofE7cU4R4KMwYioYfxefa9846rgFnZoVOE73eIcR6UNn4HDr6K+EE4mTWzRNB5ajyyX92O4oc08/gMHpzs+trGsI1DYoqTk/tLQbhdkF7cjwaf9Xs1dJ+qeH+rIwmtqxOudQ9pvcyx57Vjm00yX8kbg+66x6QJKmydGtzOVYiyw4Uh7eDLltERqtDQ== 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)(376002)(39860400002)(136003)(396003)(366004)(346002)(451199015)(6486002)(4326008)(6666004)(316002)(478600001)(107886003)(66946007)(2616005)(66476007)(8676002)(66556008)(1076003)(5660300002)(2906002)(6506007)(186003)(41300700001)(8936002)(6512007)(36756003)(26005)(83380400001)(38100700002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: H+DhKCnr9m7VX5hHKzUh+SUQ82+dcM/1sZuHwakpHSN3Lna72pwd83srHjZzruYVUVR+HtceoyzBHBkTeKxcDhGiVqV5LecMj4RoHPTZa9HMR1Me5QhXf8mQHgxui+W1h8mmaBS3WakZPEuAXaAUST8e9I+fo6Me/+jJWu9xn85v/qfS4+mKYZrV8CytEIZbvGDD/csv6eeNjlGcBnXkP9IOn5JLNuLDv18wbBHJp1a/NYxp1JPJR2ZVVwzyG+Us/ok9p3jdpj1q8pFsylUeTkO2YndOcg/0zqR5r93iE5Ghlyxv5fZeqvxWHKns+VPwSgPyQEImY7icZSArnAw0RzGQpEFHAMog7ZJ5qvY8qw0ohX8Sx2EhdzYX5wAqQ13SCaWmQ8EeDZfLn1aXmXKltIDzVWAQKS7RW3Y9U8kQAPzIL8Wn3sCOfbkbpAEKMiSSxWfEk13IU4bokGmEc+rEa1AaLXI/s4XF91GlSz2Lv4uacLn4hlMDT//CcQV9cUfNEWV0P8GOwWaRKI+3VkL4DHbaQRKVcTBet08LybStUcEw4f1pC0whTwAVweY2dD/H5W9nWIkbvQ7uQunE5j/L0Osfi9eabTWaHWvpYBkgc9CDdz15QTuGc/fOhTkLvUnlq8+EaIcNZ5ixspt6bYQaq+oP4NNSzxL1RFhQZ/4YLaJaeLBJFTukAobB2Fe0LiscODrolG/CAoJfmrk9NUWL21ZY1yN/Rrw6+5rkoSoUtL3Rzzzbv84WKRTzZim/u+9JS6qHYC/VTg8fkZE6sHwrmF7SnP8aJgliO6xl6FGujRQRviu9jrDInv7heVFbTnDEV4+7LOep/2r5+Bn8eLpsO48GxLLQX7gecNi8bw25OpF+y6W6o1v1tlGNZD9n1azLNZHOoB76riu/izTQ//aPaM+9KuSXImhxIN9Lu4eFtQ1aFVcfGAZAYXXXv3dsCqOMdaLeCmnzmq1aaTDMbip3jEX+e6Igof4Jmk7SuIVcmGFeqt4jJiAtvdmdh+lGb03KkBtPav/ZzlBSfjz+qazRptG0GrqIcbpc9eopR3+DxKTm6TKSm/2Fj0sGoJzZ6Q462bb61GXMEX4lB3dwiAnurxT6lhvXL3vIqDHUX8MelORLCewebAyFcK+1a1Q6iFr1vX7/MsKnVdagbO1DMmAuxVylBCYL+HcySCffSwE5o0KndOVMJhN9f+N8mkEvPtfF3opASFEbTmDRnJbVv4D0Zap7AazDEsqblkadHX61jWMGCYezu0ekiBtIb9ssDcGamN10e+TByLpNK+W3HbEZXm4r+D/SIVtijdp82DwBXc/9KLXmZfoMvfTp4KeXPPs0IvgAh1oEjzKUHZHSb9ESnR5cuaBXgIoUBlhK33pqRx2rof4u2JGmJqRJLG6wGwfDa1leH2eXut/rjsggxepKNEi5x8hSnlnKOkWJOBm/hHphZytvY9cWA72qxTrizboUio+Veg4r0ZJmP6uxguNowMn63LeVGkw/bP415p9QqMT1sqacEbfcEQvY0FwMe6jj6vaxIHQbexpPkz+BMYij+Z2v+T3QZOhC9KaHaCEInEnbnjKTmTgTv7lfu7kYfIdi96FiGqsybFkVxy6GEPnGUw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 07e5ffed-738a-4f30-f277-08daafb11f0f X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:49.2651 (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: 74JNP5oi2yON+tCdR5nptQEuteEBYPn8gsH1MrbpkBUyIS49I8Nishds/3N4TMXCw5zNXrYIJvXGEOaFRvctglItIfy6Iwy1luhguItmGNs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4603 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 adultscore=0 mlxscore=0 spamscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: v4JGfrYsEHkKUZYicbgj9d0usNNJsOI7 X-Proofpoint-GUID: v4JGfrYsEHkKUZYicbgj9d0usNNJsOI7 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 16 19:59: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: 615653 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 9C22DC4332F for ; Sun, 16 Oct 2022 20:03:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229819AbiJPUDa (ORCPT ); Sun, 16 Oct 2022 16:03:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229774AbiJPUD2 (ORCPT ); Sun, 16 Oct 2022 16:03:28 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E41E24BEB for ; Sun, 16 Oct 2022 13:03:27 -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 29GIrTHJ019352; Sun, 16 Oct 2022 20:01:21 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=prXqfiklnCfAKIAJwnFznuL6k5fw4y8eoND6CzRTVB0=; b=SBt6D1GDEonmf0Md+dlZexSmSzRprLSHbnDSmPX3OxoUcyy0w67uugCaDd0dKbAeN4pi O20OkI2EavaC/m3uxJHhQKP7ygNyCoMw7zmb7NzSq4DAxLv3DaBLZZzddkkEMNfkx+53 u5FnlpIbaqR0GKEqr51f/q6AAfv5Zhm7+bmxVi5rive1t/41n/+N3YAPLnQFj6KKkjC0 fkpWldbwY1W01LaMKngzSn4Ua2R6cu+hgha8YIxEEXfVcEPT4WHUjk9K8gFF/78QJ6xe 70+M8Tilj0T2hL4jfp3QhYE3kd6oj6OplqDNhrXNfalGcYoW87Il2Qhfwq81CKH+J95r nA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k7ndta64v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:01:20 +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 29GCHbSm034322; Sun, 16 Oct 2022 20:01:19 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2174.outbound.protection.outlook.com [104.47.56.174]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hu54e0w-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:01:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MhEe/+TqUxRQtWDeYLiBZpomzVQTFGqz2no/TZmWi7eT4EJtkqeCK9ltrdr3bzS3wbe9cDK+4npkLwJY6mrxCd42n8OJldncVJt8AaeMihMcZjU2wI75N4CpiNlu+BfM+wlCd5aMgY0jjrT5gYvyq/cYsLu9FMQpw77coQyEYJcw/2kcp4E4kGq7Svin8CaC7cGVu7Fy5tIDuoe5tMo7c4Ug7BhVkXixKFD93/Oksjy8pMj9nmHORXMbFI1dq6a1NC/ArSXKqF4J1aa7KRpXS/Kp8uNv5UGackWrjnJ6NjGECqQPY3DsI9hb8/jHoZ3h7cEdNvnyv0NZ83gYMBLqLw== 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=prXqfiklnCfAKIAJwnFznuL6k5fw4y8eoND6CzRTVB0=; b=enVlZlNyT+QDEJHKc0FEt89P8jQnRxR8mFpEW1qtZ+tMcnYcEi+TPV2KUu65GAHTdNCgA0r5biLQbNkEp/qtBnW+j0OyUOrqzE3P7WK2aK0UsSn4EcsB675ei7W8HKJtCYBI0eSPdLt0YTLAq0bW4V1C2vxHMUofZjLl++Rko6iy/Imt/j9vR2AfTXKD83c3kpyvEHEe0ZbQtIyYEQ71fE69MDAQwEjiFXP7QfuplJc8++mbd8dhULpo3GZ7weihG2YLvVm8FN3eg4H0ZeM/3Qk0Gt57a0cbGW9xGD/86Woqvbla92baiPJhQ2rakReTzNR3bmBFrQct1yV+ltcy2A== 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=prXqfiklnCfAKIAJwnFznuL6k5fw4y8eoND6CzRTVB0=; b=BNBiMS4RwfYYA4e7JcjYy7QEo1zam6+EcAC04tJ0jbOPR1dd3nUt2G7G/PPVWFSx6gigHbVvihfbGt8uIDK4ZS6XAeG+VZ6fWfCk+YxgRXPR3rIkdTWKYMuc5HaTznKZVPea9unDIta1kH5dIRRCe6+CnSL1vqrrJj5OLLlRfLo= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SA2PR10MB4603.namprd10.prod.outlook.com (2603:10b6:806:119::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Sun, 16 Oct 2022 20:01: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.5723.033; Sun, 16 Oct 2022 20:01:16 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 34/36] scsi: sr: Have scsi-ml retry get_sectorsize errors Date: Sun, 16 Oct 2022 14:59:44 -0500 Message-Id: <20221016195946.7613-35-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0059.namprd05.prod.outlook.com (2603:10b6:610:38::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_|SA2PR10MB4603:EE_ X-MS-Office365-Filtering-Correlation-Id: 387b1b0c-b83d-4182-aa95-08daafb11fce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OxhhBECwYsTeUAt4aBbJ2i01coic/DVADhuvt5290s4PcqvDYrBlu4TlfucYlR9t4LCetrw49kDmk7Xtv+90970YV53lQjWGXtp/he0ZUjsTw3SUr9JJiGzbRsOOzJ5t5z17mxT66pdgbIK3G08/sYig6QI8MAmeDEseFB2NzK4Coy5wqWLeiI/UV7v/eM2sm3fpfLm7GhuYkYisBFmCbBZlNMuhax0x1Wjteof93KvKveQ0daIP0U76nf71C7ggXz1H5+VUriuvA20VzDO+8uxp5fghG35YC/GGhwinDbdzjl1qJGBoAqZ51FbOSpBfEjpW7Caf/LQj7RfROyLZ8M3X5NZsvHSPbgBD9sVXu6q8C0JhBxXeLUvSkRp3M4eiHR6AZY9AxGBehmH50h0MtfacwzeNdoqVoCQt+uTXDcWf21sZG7RG0zbStw9x1dB0UaK3USUhugP7B8lskElbwYRSFzR8HznZavapl9pLn52BbQgUfDqzRXNfr/AkpQ8MXPw7dYvyvHTQD4rNMfCDswGFRoMjawBIL8V8fsUjqcnRxyR1v6i9c6N0rG5l1CZ7jRb6txb3+LN1Hc0kB0Ggi9gSvbiUT+k57BY6F9BfG44g/oZZ4am+eLpIi/CtmJnXpxjUsfA4j7ZPkpVkA1rMdpsxIkEk5ZU+3BPi40zMgYn7jV0XBxX7YU9I0kH1wTpRxV/DMWOOTo6P5POpRQpeLw== 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)(376002)(39860400002)(136003)(396003)(366004)(346002)(451199015)(6486002)(4326008)(6666004)(316002)(478600001)(107886003)(66946007)(2616005)(66476007)(8676002)(66556008)(1076003)(5660300002)(2906002)(6506007)(186003)(41300700001)(8936002)(6512007)(36756003)(26005)(83380400001)(38100700002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DmQPT2rDI7HLB7OabK4L2gf1btwXGLhrVJISIn7/K1fh62YmoR1h73HeBveipua81gEPbWKYNc7C8yalnNNpKq1yNNFy/6L4uN1zAiA7g7xNy6Vec2ODzZLsK0U9Brd/evSZP3U8Nm8f4VN2vclv/0aYFbP4XlzxFWeKHswso3pdKSIRErXwXQ+iplj/EW/yNgwoKsYGMOnFKSxbeksfS20+1Tx4/T9IAhf509SBbTPQiHXnbeM5Z2c3j6y3S28PCVv7RFQh38oSC7+6iVniYcEUchUgWDlxIzffAKSUfBK196JDiLpUK4FvGRBIu8AspFYTwCs6n2mRsJeyEuP5P7VPHTgxYDoJUI2BsQTqgWlM+uEx8XglV5g94OONy3WtJLPd4WTduDIFsE/6mYMv0g6dR3pKLcQPZCHoBxWfk/9vPAtdOB6FVb7ibvh/3c+xSxTnf57JBnNa0jx746Y8KNXDyKFel4dZz50EHJ8uPCjeXQzZXIR6jaYoog/1JfMmMDCcgVM6RM2UTGuEjdGyy0UEe6scOrg/nl/BuMWedCYA1oPWJ6GRYZDUUW/k9bQ5QkMMShyDekZnK7NDE9Qnw3Xra2cwCspz8PxqqUqmErwAVHsMM554fUJRF2e72KW9ilfTjmeMpUuSP4+7jFmerMCLlI9rDMtJaWyDLb1Fz3j7VSIba6BcUX+/WShUdpS3vao2OXqXReBGwSebTszV0JIbgYVBCppAN0VzZapi5DAPoAdctfpGTMUoISsy2wbjjS3YMSsWgYkrGxs6/X/dxL5+p/gO3safWPWP05k9UM0yt9jIgLDqlrQVPB3w+h74S/RBF4muyjNtmIG39oAIMy9qnnqxd8JsiMsw0sn2TDkmfQykzQhTMu+JiRdWM0z/mnRuR7JgJJgwG3QhVL9KtGwQVPPcpFw2wtOHg2UzFqrrsS9FucDtVhmaaVSOZ1qWsqE5mk1LBFUch8NZo4kh1p5RDvg3ZQuUvD4QdZJLosnWh5yQ59TON2fssIOHpej/l8F6+1Q3z4waQX5iW8qPNMGtroftnTtFAwyBR7hfoVpdbZR06frrHRguKD9CucZs3iU6oLGCQ6cYrRLOqL4GMr866IuGynR+eSQ6bgPSv0SqGmzwfSO/IuV0hqI/GRYJn81qv54qMISzzxTZv9tQ2EHKSou8B21R3+P/tfNkSfeBzZFMU9kbUNYY6I9dJQqC+ack1ltYOb1jc8ac28doOmYNwf/+5tP05kEjKmplHOi6SYEsmT53FFu1bJtzmvWQFC9HpcK39/g0kJUhd9m6PDL5Hydqwd9LGBgu/yQlavZY4VHSYkqQShGWag01zoZvpU5b+Z8EcZDfnGDC67iewCxghCthe5TiVuhtXWuJ8h3zl7JmX4Wbzb7ZoHY8tj/kkb+SfFrH/KNy063OHhJkzdfw51xJ8A6JtgKMNDffc78bZfoFRsUEvhv8Iu3wfkLyBmtFoEZuqBVU2/3tXLSqAgDnNx81pjNV2hIDktWekm0mBnMpf3KQdI7nSWJ0Y66aP+sbbIkKwPZeJwSuvWwtNNcHOzG1KqEp31xcxS1cC7nzBIJS9sZF64a1zMCb7COfRhd4Ma3GpbNfqtRuWRuLbA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 387b1b0c-b83d-4182-aa95-08daafb11fce X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:50.5306 (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: cHBBO2JVwjcv2p4DLM3WHRrTVBqGI1j1WOZQje06iJ+2y6n3KfJBRiKv38v00mSvP6r2/jIi/hi831fdccxI2nFVPIhrMWX352rQo4inJ7o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4603 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 adultscore=0 mlxscore=0 spamscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: QOw4PF8WZ2IbSdEMIXDdroikix2_qSsT X-Proofpoint-GUID: QOw4PF8WZ2IbSdEMIXDdroikix2_qSsT 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..a282441d9872 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_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 16 19:59: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: 616402 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 4BF11C433FE for ; Sun, 16 Oct 2022 20:02:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229646AbiJPUCe (ORCPT ); Sun, 16 Oct 2022 16:02:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229849AbiJPUC1 (ORCPT ); Sun, 16 Oct 2022 16:02:27 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D27D62ED4A for ; Sun, 16 Oct 2022 13:02: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 29GJ20v3011562; Sun, 16 Oct 2022 20:01:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=5AI+pzfkeFlpLrmQ46clNzkXWsL/x0YYvdRawOO34PE=; b=Mv+x+vQC1kYW4ZQyBANqwXC1PoV/T37UsHsPWbqDaW0Ae5v2FLIhO21JKt3MYUgzQwJF XPTuU0WOVWBccV33ihZ1Pi1tbat0Oo5HQ5QkwOmQj9KEhTce3u6Fe2demtpN3mQ9aUFF 7Emq+NzEA/cMn64rpv8Ggq5PQ9AuiwbsiSA6VM1+fIFcuyoty/2Itb+hsyr3/xgRuH0W tCgckeZuye3NDN7BjcO+ulsBnDP3pSdjTl5kt87ji+z6BPX8Awb74zQpKV3V2n4gBgL2 bJGFb06ZclhvTeYJfhCRRP7NykNXQnFYKu5bi/xSdGTjRwvIaRa3dcyZ4WujtkrwrYTI vQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k7mw39yed-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:01:20 +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 29GCHbSn034322; Sun, 16 Oct 2022 20:01:19 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2174.outbound.protection.outlook.com [104.47.56.174]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hu54e0w-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:01:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DhyaYV//INZRpnV17EDgzi3X/85dZKWpe8r3tc5Y4uK53cJYEXB1qoOpxG/T3ctHJok6WNLIPuwUsLb6wNezVfVgYkchOBTl9FOD4WapGZGtoD0vkra8Yn8wSS1LRR2iHJio5TRj7onR0ctQ7339EsBNqHALP9d6IwHO7IuuEyGVuRRKid52uELWN+qMtbGt8cOXIYL3pX1BpM+JQL6WenKZXJowZCrLT0Ojad//OmRl+aHgC3uJId/nxrMc9ZMQ3zp1BNID4P3D9fhJuO8+17rAGMAwVCL9Z79bpyoSJ7kWMk3p1FdIRJR0ppIHwaNqH7nW8J9naIeLzs7I9t9bXQ== 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=5AI+pzfkeFlpLrmQ46clNzkXWsL/x0YYvdRawOO34PE=; b=GsCkqSGsZN3r/xSBeF+/C1Wv8UYb3+UOcBLAzHeDWYaxSpkc+hAF+FZgMU1VZHXerzwbUZqPkbUozH936v87m0VMb/GMtZCeFa0lAKJpLo2PFgLyWOLic58SKhHSilfZxnmvlg0M19nJCU7y5CD00lsdDZ2Hu27R8iLp2j+5dr9Wym5Lft89DQ7tlN8UPS0YfuFKUNj90fRruRGSCGovCzQhj/GKuxBvRT6whpaq1Vk4ILkegYfzExJ8HTrMxXNrja7egTKXiMvOCtv0u4QyJY7T9nbqEHoSzKouBbVCm/qKNJC3rxktOo1mMluNBcfvEgUTZeBVK8EcsvfhmM+f5A== 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=5AI+pzfkeFlpLrmQ46clNzkXWsL/x0YYvdRawOO34PE=; b=f8/+SBI26JKckno9+FPZ+xcWGS6n+b9VlAvQSCXxF2ASrYmfFc3v6rewtOznMbWcWyGe6RNycvHAOZGoLmNvb5IqSfGDtZjc9eswEj7ejEyERUue1flv3ik0EEKgHYmnqtQi+IQjQlUsOURo4baHyWOUMxUhCElFtCqzjgh+6Jk= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SA2PR10MB4603.namprd10.prod.outlook.com (2603:10b6:806:119::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Sun, 16 Oct 2022 20:01: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.5723.033; Sun, 16 Oct 2022 20:01: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 v4 35/36] scsi: cxlflash: Have scsi-ml retry read_cap16 errors Date: Sun, 16 Oct 2022 14:59:45 -0500 Message-Id: <20221016195946.7613-36-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0038.namprd05.prod.outlook.com (2603:10b6:610:38::15) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|SA2PR10MB4603:EE_ X-MS-Office365-Filtering-Correlation-Id: d646caec-4e5e-4b22-6096-08daafb120ac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Xv3mRdaaPVJoYDHrBao8mL115MBGrrjHQts/fDUgfrCGmglZNKgcCc5V/Nq56z34J0l+TssxpAJZDFrnyHIqWk7+bZoGBqAZNTOjR+WQ4sSJPa5PfRRhRnEp2PsSjh4ypMYz214CjPjG4YzUuyyXP+zJgf/gtrlOdWqvJ9LrFDEdH7Q48kRLV3nLyGxLTPiV9KRgUtoiwuucOY19WYqh8eiGDbDJ/OgPR9s3F4Y07vvgDPhY1FwIJxgCvLB8ZYq+f/8aYUZa49RYouuM5/ox/yAZegbyO8k+wNICT7+P6yqTcGlDTa8qNxkK0pzskCGr9BCyvEt2x8l0fnKVN5YqTtF7BJE+tOlBkukcqN6+D6STC3af150EabyTO8vgaqRkgMRQXTpuvtVEOQqadhlRrstN0tGRuNyFq+AwyN/0LD4SYACzkkdn4+6KXMkxLvmRJfVXOk2ErhVYbTZOgDtw88dwfPTnWRSVfV1RKUy8qVquvACqXzYNuXOI45fZQRV8jd5kRr7z8AAYT9Vt42maMM/YU3QGynGbLmkieQdvG5uv1mRPRlcyPomu/gdukTDUnhgYNTHyiChiE2fNI2feyYRNIaQy9Jc2h5Ww20HQNBhoy1I3TDYtC2QIc4SE6dsJ3OMgrW6AHSmIr4+ZJ4wqfFGdGXjch9NR0b1t3YAlSi8YhjXEQvrA0hRb1U5dvvQFfK6x+tQnU3itlkPgmRLMFQ== 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)(376002)(39860400002)(136003)(396003)(366004)(346002)(451199015)(6486002)(4326008)(6666004)(316002)(478600001)(107886003)(66946007)(2616005)(66476007)(8676002)(66556008)(1076003)(5660300002)(2906002)(6506007)(186003)(41300700001)(8936002)(6512007)(36756003)(26005)(83380400001)(38100700002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /F/E00jrg4OYeCmcW1CcCxDTf9KHDH+geVeeolmJarIU7/PawzVzBxl0QQrXDjkccGo71PU+A7+VqKfsc0nW/f1y4x6uXmFI7rwJip2ojZkBCPWWb42u0VZDW6Zh0b6ETq54itREBKtl54/IY2usWGKCaXige+1XNtdIUGTG/stnIB1c2wRlpEjnLdESyehZcBxKsJULDylcllEnlnpZuDXD2xK3t+wZBhgu6jwt0Ae1Sg3MbAZY+CslHvnWImRu/LK03LMkv768O5kWmeiqt9MTUqiLPwOB5BG6qhH5e0536Wv+EIWyTHF710l4PonisZ1lA10dru3k/mWgyx3q7/wsb470g8isi3V8ht4ufI0kZZ/SmxpinVecD3L65zPMnZAB5ejm3szFzDC+7w9FjrFc5eSj8vKBe3goxDMGAkgIXmq9dyU7gT1CWAmtTSdSq/x5RrcfotPKcgem/pWFFPhRJh690MgBgzSRXJEdLUHNfeiU3GKQb5tjUtaqmBKwH5tNoxDXbTcU+cAA7qzUklrVZqg4eX8i+ZMrAsND3Agt52XyVYqksQvzb05qpzhy/RRXE+r9dKmwWCd5+61hqXJ63V3axdZs9UlT3esOxpPSJEwOX0Z303y233xFYYPx8Wy0NJiQHUS716HWt/XG6/cyrhLz0KWiExit4Qgs9l4N//G4c7oKpvXsh5VJ0A1UcHRxE8J22yK845tSlHHfSHMAehhwJK8n50CS1lYu8jU0P/no0623hViZJ3T6g7NQhBSq0sK40ItEcwfMpT1b9+FJvph1rCKngKlt0nzMIlhdH30y/xJv32BB0WYPL+lDhqsoERboF4DeFF+iX9+bRQpJJQu6oZBIihPgno0ELvfCgG87JxMZPo1nZAncNagd66Kto5uYziKSrNo8oi/BtsJ+WL8upOQf0irLB7kwtJ36/NxRENqvXsso8rC7F01D7axJYtYhaT0SznzKw2ilql7rj1dJX+wtke0paCgjUqsl8MEwfB3deenweaNTQdXlohMFQOLkzZSAr1kyGXDus3uK48tc+X+rwx8vmfAGc6n01zMNUjEZhmBraVPdSpEdybJ/Va4Mb4LcrlyndefjOTOvufmDHOLzzntDuAU8238qDfC/PVwX9si2HEp2piDJePO6JIAd/M//Em1MxJuwMtZ8tK1k1lWHHhD6/tzJY3bc+VnIIJadA57kSCLa9UMzO6smGIbGjThlOsQzYoupWUyaTipHiw62l95530pVZ43Pel1U0hn5e7oW6JMldoGnvJGGC7zWUdM5kbiun+BxdjSJNfFgwJlluEE11zdcWefdTDUwm6Gl+F26ZMJj2mcU1VxekOFAJ6gUsQ0tyG2PFV6p971BzQGK4UJvkz0eBL1nM7Asyp3VpMgrCKZEblFqAqGd7xPgRbaH3saESEkXk6C+kwvRpntbzFZcSNbKxdnKI2iBa2hdFvaOkdydgiNXsfL07lV9j8SCNt4z+rLA19VwSt8jUlnx2v4gFuQCPFbpbMerP0s7hBMC1v3yH3QRdCb+wcEZ0FSnWEZEc1bDqonQEv5npIhiehJspSZiFQOvPyhuiotYquZUKF9Dw5xcyr2JEF7FvUAMis30xQbSWg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d646caec-4e5e-4b22-6096-08daafb120ac X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:51.9523 (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: VCzKcbOXDVx1s61jbufaPwxfqdhyYTfzcN+NcGZz/+llI/OKBo5BOitE9yJCdrytf/6ExJvGHcCek4rpnnQ2xBAPero1Cf49EH10tPZRlRA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4603 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 adultscore=0 mlxscore=0 spamscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: 2wKKP7fm2JkzoCzWfEhGupzQZIArJlUx X-Proofpoint-GUID: 2wKKP7fm2JkzoCzWfEhGupzQZIArJlUx Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This has read_cap16 have scsi-ml retry errors instead of driving them itself. Signed-off-by: Mike Christie Reviewed-by: Martin Wilck --- drivers/scsi/cxlflash/superpipe.c | 46 ++++++++++++++++++------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c index 724e52f0b58c..8627c825d031 100644 --- a/drivers/scsi/cxlflash/superpipe.c +++ b/drivers/scsi/cxlflash/superpipe.c @@ -337,10 +337,32 @@ static int read_cap16(struct scsi_device *sdev, struct llun_info *lli) u8 *scsi_cmd = NULL; int rc = 0; int result = 0; - int retry_cnt = 0; u32 to = CMD_TIMEOUT * HZ; + struct scsi_failure failures[] = { + { + .sense = UNIT_ATTENTION, + .asc = 0x29, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = 1, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = UNIT_ATTENTION, + .asc = 0x2A, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = 1, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = UNIT_ATTENTION, + .asc = 0x3F, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = 1, + .result = SAM_STAT_CHECK_CONDITION, + }, + {}, + }; -retry: cmd_buf = kzalloc(CMD_BUFSIZE, GFP_KERNEL); scsi_cmd = kzalloc(MAX_COMMAND_SIZE, GFP_KERNEL); if (unlikely(!cmd_buf || !scsi_cmd)) { @@ -352,8 +374,7 @@ static int read_cap16(struct scsi_device *sdev, struct llun_info *lli) scsi_cmd[1] = SAI_READ_CAPACITY_16; /* service action */ put_unaligned_be32(CMD_BUFSIZE, &scsi_cmd[10]); - dev_dbg(dev, "%s: %ssending cmd(%02x)\n", __func__, - retry_cnt ? "re" : "", scsi_cmd[0]); + dev_dbg(dev, "%s: sending cmd(%02x)\n", __func__, scsi_cmd[0]); /* Drop the ioctl read semahpore across lengthy call */ up_read(&cfg->ioctl_rwsem); @@ -365,7 +386,8 @@ static int read_cap16(struct scsi_device *sdev, struct llun_info *lli) .buf_len = CMD_BUFSIZE, .sshdr = &sshdr, .timeout = to, - .retries = CMD_RETRIES })); + .retries = CMD_RETRIES, + .failures = failures })); down_read(&cfg->ioctl_rwsem); rc = check_state(cfg); if (rc) { @@ -383,20 +405,6 @@ static int read_cap16(struct scsi_device *sdev, struct llun_info *lli) case NOT_READY: result &= ~SAM_STAT_CHECK_CONDITION; break; - case UNIT_ATTENTION: - switch (sshdr.asc) { - case 0x29: /* Power on Reset or Device Reset */ - fallthrough; - case 0x2A: /* Device capacity changed */ - case 0x3F: /* Report LUNs changed */ - /* Retry the command once more */ - if (retry_cnt++ < 1) { - kfree(cmd_buf); - kfree(scsi_cmd); - goto retry; - } - } - break; default: break; } From patchwork Sun Oct 16 19:59: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: 615652 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 DF8F3C4332F for ; Sun, 16 Oct 2022 20:03:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229821AbiJPUDh (ORCPT ); Sun, 16 Oct 2022 16:03:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229780AbiJPUD3 (ORCPT ); Sun, 16 Oct 2022 16:03:29 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24A6B286F8 for ; Sun, 16 Oct 2022 13:03:28 -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 29GJXnrY015579; Sun, 16 Oct 2022 20:01:21 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=kR2nyLxkkoYrQAFPenTxZ+MOjmgs96Nf4PAvce7NKWk=; b=pB/5dPCmZ+jBZCs1yX1dw2tSn7FbW6w1yyG4bbBpQe0ycD+Jt5YjsM3w17AnvhHxAH8e HViVBNcTXX7pzsWK9RVIXQQd7lC8eJaj6hx87pqo6Qtsv/22lXTTY7FnTSy1tStkTBuk QcMoc6a9CSWY1GA5n7wyVJSHpfxyw6JL/ryGNHWd2hEbWhYuPplJxTSlQNjKh59bu00e tc5ClFCKL70ggtC5E1E5DdHD0P8Dr336bhUwTQt4AS5hPDSkdmP/NTgdPQyNyNR8bgJO yb7aSiU1ndc9ZN4w3cbUUMrRI+NWLlVCmgwspSTpbPESiojP6SzffaqBx4pdpCBxXSY5 Kw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k8jt2g7b2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:01:21 +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 29GCHbSo034322; Sun, 16 Oct 2022 20:01:20 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2174.outbound.protection.outlook.com [104.47.56.174]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3k8hu54e0w-7 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Oct 2022 20:01:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lneNl5hE0UTrLkqzQdSyTgf9gNm10oiO5K9mny6QarimepeUZ9W/oJCRQhCvj2ecZM9KSnc8PjoJ0sPVDQSyk/xbQd1J/OpsjixyjoCa7wOZ5NUHaI1SFyo2R22SM0muGrLhFDpvkQ3p7bbMqN2RXVGRYuduGvZUB6BCYOWlZrkXZOuP0i1ca8QfXQGQHwF7MwFTLE1fWNETvSUDIgpcs0xUy6fIAr+3mvoz31GOhZZ+L+CWZANlSUDiMKNUa19zFjrC+cYmoCvt+Zl1cTKPqpcQQPeb1NRQP0C3NRqWUTH8nwUjeC6C4HaiDGl2QqLkyGloM502gO4PIrm7IVKBbg== 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=kR2nyLxkkoYrQAFPenTxZ+MOjmgs96Nf4PAvce7NKWk=; b=Ef3oAasLHq148kG7sRIUaoqdVJEX3dsD2W6G3HYo/eanjyeF5HM04apES5MDta8WZbFoX78Eb6LFr2wNLZSahk9klka/S51sutw/WcyIbxCAHP5OvUh/2HTgm9N7iKb17lFSMq48COzekeHlmRoNOt9TQlLbOK7ArO85J2zw2U2Rkt3Anda5n8VzoY7Vx+qgdsLD1vNM/3WPOMkX9FP5VYKsNzQqJvQO7rdTY0g3SixB6o9BO2rXJ3NBueNqVb6OyFxdgG0tQ3LQwLbZ7Gq9BvFQCPotcxnHFdnzKhS5Ewn18flzhTUtG/Of2EVONv47o+HgbZeNHP4FMFc/vKDY8w== 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=kR2nyLxkkoYrQAFPenTxZ+MOjmgs96Nf4PAvce7NKWk=; b=zkSkXbMCQ44qD0xb8YbytyxlDFWNYNhMCtLNLdZGznfriWqBJm8kPPraG/YdvR14WQX9FgO/6NSQIkdOGZzFSy1qR8nFOPVp7Lawpa/GTvJu0UibySEVTlKvrdxqiJ4lTqtgpDHDl3jm5u/XiRQOZmaXQnBrCBECooK4wcPvDVo= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SA2PR10MB4603.namprd10.prod.outlook.com (2603:10b6:806:119::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.32; Sun, 16 Oct 2022 20:01: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.5723.033; Sun, 16 Oct 2022 20:01: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 v4 36/36] scsi: Add kunit tests for scsi_check_passthrough Date: Sun, 16 Oct 2022 14:59:46 -0500 Message-Id: <20221016195946.7613-37-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221016195946.7613-1-michael.christie@oracle.com> References: <20221016195946.7613-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0054.namprd05.prod.outlook.com (2603:10b6:610:38::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_|SA2PR10MB4603:EE_ X-MS-Office365-Filtering-Correlation-Id: 368d786f-c1bc-404d-8b59-08daafb1219f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mm6F9bh1whJXaNOKTY0eC4VEIlyZUbsJx+aTHX/Mgadj4EdQMc9Vn4+i157uosgBQ5mBCG7N+Zxzk6Ms89W95N0yZ7nCUgXq73qFgIkcJz5oA0pFxN477JK6ZyA7t5tpgt40Rvuy4TfXqH35+doE5QN+8hV2te+xUIPwLNakkiaXJsVkC0NTuN1HyaFJlHDIuDUPQ9VgTqegkWSH7PvM3vus+5zS9GdtoxKQgSBEu6irbAaCGcmSV9T4rHq4QY/2/tl6ojj6i88eIRrXCI4S8i352DrsjIhYwPqa+/uUPRewVS6/9A1HsNRSSPbT5ZDNreakRCENXOpeOuaBMEsEqhHyOkw5jfwDWU32WI2Ftjy8A8/xSnsDpM9unv0bblf5lcwWIfpIGN5kCcunzH/9qaU4+VQ2L/GGWKn9NLH0KMmzSjszTLPznvTMl7D80sNySfzUbx4uODJGse49u6Nevch16up84kY/Xjd51OKtGRIj4TYGxFa4iReJ2Bdnf3HsakBSus8fVTBpIwcby6OSnmcicMliUjjuMI2KrI+ZQJU5m91eyM/Bmw1uacf9QVwkyo02zFOUNnD20yOQfYjmzdrPMBx0DmW1aG3GeyKhk4ECx6bXqPKxvYOga/TfgzeTcW1DXJqBnLwsGCJpHHCwSaS1Pyw1yGALr4SAvrxwq25IzpwD18gO/shBGpz513cGKUUbsBmzwBJbPWBIE6YROg== 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)(376002)(39860400002)(136003)(396003)(366004)(346002)(451199015)(6486002)(4326008)(6666004)(316002)(478600001)(107886003)(66946007)(2616005)(66476007)(8676002)(66556008)(1076003)(5660300002)(2906002)(6506007)(186003)(41300700001)(8936002)(6512007)(36756003)(26005)(83380400001)(38100700002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /Tg2fwtT64PoxlvRllaFJ5sPB49wS6YwYwGXEGiHORrJM38639PyTDrv+C5tbfttC4+js+EGXvoAsEud5NBri6uFXjztTqvAK/e/DBY5Kmp0nCVqZomuTv4gtXDe2hLxIPQKzAjHyYl0O2JfddXbqJ6IfQ3mwika51P+MAGS++abNsNqgnG7iCz0qMrFf66I6NZM40orHkpPSME4HK/VygzNtY1ZwafeQ1r80am+PdOZPmaaBql/ZMRQSWfJMSj29EgzHM34RyzLRB+lVnjDbLumtlLmPEnPo/1D6gDjOj7VmtzE9uGRRtuTbEvm1sorkTeNqHx4yJwy+z84SOM+OyHMXN+VbiWecqbXpWcXRBa/IgAnEF89mUzI5ZTvp5iPbbA2qoGQoqqNiPDW+OSCdmuJHjodW3GT8hGy2oXkb2XNTiJeC5SzfhiL/w4gsgmqc+ej+JFAqfv8/58WoJtjWhA6oMB8cssTdcjPSoue/6uqxrmccBShKHxXdFf+ic6KdTorZt3rnfm3F7z2B/Qb9RMlisMUH4FaIXWFiFbnd8q1RaPxRG0ejWkG0o5UutFGVev/S5ng7WaDlNuAr0ldiL6ms5B2YAXsVR0XR9CedNnVINVCKU4K17QP/tNCcUz+II2X7lLTq8XAmlGGRX3T8pjM4IvrCOh51ypA/GjHMJ3UQWG85wehCO5x+sJzjqY/+w1A2SPItDCDuWjnh1af6NIZ4AQxwurqLOp2gwc24UJMBmC79R1xNbOSx/hwzGJPyWm2E6wTiYQc4SfRK0JlkS+c8kOwsXHaglafF9ZBdgzt8e84r+YhlaAxvmBzXVEyclGvOO4zR/kWp0xBqi/eoQd43r7az0cgAgyEHPixemh1Mu9BiU1XcTkq3iBee4NkiSL8/3nqWoo+XOv0MRh6ijiWVBRHUAClu7YFFPKqbWQVnCGU4HLWWkrHv6AQ7KvPsIifgA3hjna4Kk2da39SUIbWOkDkTOJkae5WYbXS8sUkDIrqwY+a4V3Gsk6sEdpFgw8flPxoF3zD76H2q3QfpJhe/Ypv0oGaRmxB85h8oZdAr/gcNvVSpyxSGPH7TnWqQx7/x9HLc6NyuzFtYcOIRg1y0rB2ADa1Job8VjWs6NHeyXvFwndU3vdz/2m/g98in4E9w+riUpjXjpkY0bHH7sMxED93xKIuUMAwMYKq03U+3Ie5/2LrFRoBHAMgeCVTcu8ypOkBWMdhluMgk1MUVS4egVm3Bqn4Re4XJpo4BsikMNEVX2YmHbnB55Tw+T1kL99OmMckg+CFLbfNNIXbgwliRteqRGVeDHSEDOakECeIT6NrmSMFwETKmlLZ5k9GyuUgVITu8UCGFKI15jVAZK3zSIY9gQUrLIZUvhYXeixb7qQG5pqDtmV9stzmYxcsDkVC1DWmCl2dtYnkjDrGBdRM3y5UC4soCr2IyyVORLlKz4tduyGVHEdhfouWQm87S7uSKafu55szxjZ9+v4O0GnbslzEX7UxPZZ47h/ZbDXdbAN2nODz1lqGMlUUB4/ksPUClo5YQoJfYSllO58gL/7jYhIN+feL170jWos2fp+HNlGRj37M+4MZOXlrzAsa/5AGkuHyDYhbUDtNAJi5+w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 368d786f-c1bc-404d-8b59-08daafb1219f X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2022 20:00:53.5772 (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: aVOuEc8ti6Xfp/Ej357BxhtJecQ6RzaqKW8VqoObk18fxS9kwQsWVyrUcLD46+WC0ZEQ+zUa7lLGp4OFprAWI0DFeDhBP9IPlam0DcmJKks= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4603 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-16_15,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 adultscore=0 mlxscore=0 spamscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210160124 X-Proofpoint-ORIG-GUID: pNaWa2ZPMF0Ynx_S8Drh7RxfT_qx2vZE X-Proofpoint-GUID: pNaWa2ZPMF0Ynx_S8Drh7RxfT_qx2vZE 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_test_error.c | 150 +++++++++++++++++++++++++++++++++ 3 files changed, 161 insertions(+) create mode 100644 drivers/scsi/scsi_test_error.c diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index 03e71e3d5e5b..00f8574a5916 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 2aa162406107..ed37c7eb6cd6 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -2618,3 +2618,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_test_error.c" +#endif diff --git a/drivers/scsi/scsi_test_error.c b/drivers/scsi/scsi_test_error.c new file mode 100644 index 000000000000..ecc9a39633e8 --- /dev/null +++ b/drivers/scsi/scsi_test_error.c @@ -0,0 +1,150 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * KUnit tests for the 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 = 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_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; + + /* Test sense handling */ + scsi_build_sense(&sc, 0, ILLEGAL_REQUEST, 0x91, 0x36); + KUNIT_EXPECT_EQ(test, NEEDS_RETRY, scsi_check_passthrough(&sc)); + scsi_build_sense(&sc, 0, UNIT_ATTENTION, 0x11, 0x0); + KUNIT_EXPECT_EQ(test, NEEDS_RETRY, scsi_check_passthrough(&sc)); + scsi_build_sense(&sc, 0, MISCOMPARE, 0x11, 0x11); + KUNIT_EXPECT_EQ(test, SCSI_RETURN_NOT_HANDLED, + scsi_check_passthrough(&sc)); + scsi_build_sense(&sc, 0, ABORTED_COMMAND, 0x11, 0x22); + KUNIT_EXPECT_EQ(test, NEEDS_RETRY, scsi_check_passthrough(&sc)); + scsi_build_sense(&sc, 0, ABORTED_COMMAND, 0x22, 0x22); + KUNIT_EXPECT_EQ(test, SCSI_RETURN_NOT_HANDLED, + scsi_check_passthrough(&sc)); + scsi_build_sense(&sc, 0, HARDWARE_ERROR, 0x11, 0x22); + KUNIT_EXPECT_EQ(test, NEEDS_RETRY, scsi_check_passthrough(&sc)); + + sc.result = SAM_STAT_RESERVATION_CONFLICT; + KUNIT_EXPECT_EQ(test, SCSI_RETURN_NOT_HANDLED, + scsi_check_passthrough(&sc)); + + 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)); + + sc.failures = any_sense_failures; + scsi_build_sense(&sc, 0, MEDIUM_ERROR, 0x11, 0x22); + KUNIT_EXPECT_EQ(test, NEEDS_RETRY, scsi_check_passthrough(&sc)); + + /* Test host_byte handling */ + sc.failures = retryable_host_failures; + sc.result = DID_NO_CONNECT << 16; + KUNIT_EXPECT_EQ(test, SCSI_RETURN_NOT_HANDLED, + scsi_check_passthrough(&sc)); + sc.result = DID_TIME_OUT << 16; + KUNIT_EXPECT_EQ(test, NEEDS_RETRY, scsi_check_passthrough(&sc)); + + /* Test any failure */ + sc.failures = any_failures; + sc.result = DID_TRANSPORT_FAILFAST << 16; + KUNIT_EXPECT_EQ(test, NEEDS_RETRY, scsi_check_passthrough(&sc)); + + /* Test 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);