From patchwork Mon Oct 3 17:52:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612517 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 7196FC4332F for ; Mon, 3 Oct 2022 17:53:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229824AbiJCRxt (ORCPT ); Mon, 3 Oct 2022 13:53:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229797AbiJCRxm (ORCPT ); Mon, 3 Oct 2022 13:53:42 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A53D3719C for ; Mon, 3 Oct 2022 10:53:41 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 293GOJi3014340; Mon, 3 Oct 2022 17:53:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=Yx0/1yymjXfxf7tLRSmIJZrYvu8buN9wpAVf3zsZ1Ew=; b=wFqjaHEVcw9iItqnesN0c6ps1mJDobOBHPCuCk2hGOZv4xd2u8Y0heTbzjJ8L/xd68iz aB2JyIcuyWao7kJNXkhbD+ILSlFrib/gDOsbuN4zt9OZ+whUludoGZC83Q8WcqZ3ISun lDHy1JZ2YgAFx/t3N/ployu7LipcJy+f4UCmko/k2YTnmbF7N9hgZ9mNRuSGE5z5HBej 9NX8b46Q/bItkd5umw+ws+YXyuwkEk30+t1S1qfrmAlq68lFuf0LPGP1AhiTRen6p9b4 8uUhCg9ADdlV6KJv+Okay+GoPUnlM3dUSi67h3YWd6ZnoR3Pzy7+5Ea59vCxP5qZyjfE rw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxc51vj21-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:28 +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 293FKuSp030179; Mon, 3 Oct 2022 17:53:27 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2048.outbound.protection.outlook.com [104.47.66.48]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc09rhsw-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vg/ZPg9ND1bX1Qoj/SxomUwZ6PRrhDqr81LMMSZcGVKaVMWFTDa3rv0pT1cRqQtXHGixI40aQktrfOkzJnxy+Cg1B+6Z38D20LzhQfdPOPYMYtVZNiYijMWRCX9acL4qnR1lViM5D95ThVlh5X36DDoUSR1bu3CkvOFwTuadGxK7atNusMWv3MiDWHbqM1LHXxSgoe0mYL7xndrwnlWhJIR/eUXe4r0Yb85I6dXdvX3JHJlAS7Hd5ifm9mIEpiVxTqokY3hSQpF8t5A+LMW/Dznun2KEKdk/C2vH8ro5+KxJPsJ2MZ8wXMEiZ7amFlWUeT3OYwwCVbM4wFZ4rA4HsQ== 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=Yx0/1yymjXfxf7tLRSmIJZrYvu8buN9wpAVf3zsZ1Ew=; b=bPjzzhti7t4e/kwWyWLDWOfMFBhpvia9KT8E1q4njY7IPBqevG6wlIHeOZcJATQv15XZ9fMf3G6M6yowkvFb82CP7BTBy66TJmYVkPaM+skCBZPFqXL5sp1jFqGO7VazdwbKnxd/MBrByh6k79l1ipZ4NRF+qBZ5JhOQggcymRnijqdZsgzpk25+5CXFemKYQtPeMn80iY2/GLQv8SvvfEAMKkVnrC8HhxNhat/75Nn5I+aoslcmpp3l9D5lP2nLt0GGA2zSrc2waKsB0Sq67E3ZLU6YfvU/Ycw02CIgRqEPSDWCHfoHkHAlBDeZqo6awvv6PZOBncnpNxMWUi+NHg== 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=Yx0/1yymjXfxf7tLRSmIJZrYvu8buN9wpAVf3zsZ1Ew=; b=uYTBoHBJYGT5+UR5sgX2NBsEL6o4ifnNxfbHQAhPOiHL4+3cJnsRLyQd3QOPd006Cx39QF+TxrvqvkGLWLpJGKHYFpt56R9rB+ZLICrX3nYoNFmJKTfwcUJtaj1H3D2FUm9uhhXz5rVZmG/ECGmSCGBNBlAm1EIkOdQPB9VBIng= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BLAPR10MB4834.namprd10.prod.outlook.com (2603:10b6:208:307::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:53:25 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53:25 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v3 01/35] scsi: Add helper to prep sense during error handling Date: Mon, 3 Oct 2022 12:52:47 -0500 Message-Id: <20221003175321.8040-2-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR16CA0012.namprd16.prod.outlook.com (2603:10b6:610:50::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_|BLAPR10MB4834:EE_ X-MS-Office365-Filtering-Correlation-Id: da1f50ef-d7eb-4267-7658-08daa5682bac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GzAPMYLQG4L2+k5TSVZryXVDD2UwFmOXjOc+Iq4zfrzrlSTfyzG9t3Cmid4+iWoWW3I+Rckawe9JTdTsZd/egWLoaIfB5bpUFKXaa1zOnK5SFGv2o4UIXoV+3U1YxQ/vztP45DkVsC65yRkhX6ZwFXEw93vm3J03celMBMcsAyYjs2ddGPfL0XZKqAHrlBcx0vywcR/bn+EXV1dLEyiv/PTUSsZvza1Spw3RtW5yywTAwainZFD6l3JO321wQ7FLnzh7ZGxFNkAi3JaZILx0DM+lpTSgYsshpEl9vdLJ7tfHKt8lkDxn+7WBSkC8iq+D9JF30/8aBgA8J+W3UOYE2947bJlKDxLzb6Lhhb6cFmxgID91W1TXuj2vD7mKRm1NRFD/3WleS6Lag8vP/hxa/hfpVEz+fbIvat+xxbPS3Ke763C9Ahs6/ypzTeZxU/4F0lLhCkq2N9aFFw5gUkZv8//UG39Ek0cyS930iVt3s7XzLP7WSIExw0AvQabH7kgE0HM4sLGWaqj5FUuqcRMVAfpWQvBUmOXXHd8s20aapblKOx/U26tXBfbGkrh2srtfgW7mtOtCT5nPNZTLJdC/tgd7yLOHAkfQZ/vUAtk0T2jjH15gWaZA/k1IWMNNBploM9dXXLOsoK9ScZam2gI+DF29c77Ky1Bmp8K5Lf+9eA9E+6fzpYC8/QctyzgeYsWd6P5bS6YR1zXWItT37sSE2Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(346002)(376002)(136003)(39860400002)(451199015)(86362001)(83380400001)(38100700002)(186003)(41300700001)(8936002)(5660300002)(316002)(8676002)(66946007)(66556008)(66476007)(4326008)(6506007)(6666004)(107886003)(26005)(1076003)(2616005)(2906002)(6512007)(478600001)(6486002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: l6K6RISk3fTZw6kumneOrU2J72W+dIfrr8K/jB5WgqB57aFa9m73ALHpCwiuwZUp1qL/sV7crTYqibKpPsZU2qbfut1UKm+yOD9PffaUPcIX4qBnrhDMvZSjmm3R4Rjo0z/VFwJbWr0Ir7rM7QkD4kb056MlAVbDSnTaiJBk0Z1ZXOpDgqFUNU0UK6N7r0R15LNId863cK8HYEldvuAmw+PrUNlnjv5+rrDf3ygSND6Wa4O0p7aEyoVdBWdDurri/axKsgTVo0qsMMRiIkFUnV27NcfLEi6WWoNckZHcVwrNbQ/zzDT/onGrYFwKU26OdJ+N9xdtSXEEw1XVmW2S4eAS/yuZjewYPpnU8ngRXLQWrnkzi8ERnhkKQE6C4mQES1zpYjuD3UQYIage942VRt8Ma7GbZjl2lmR+9X1jElnGo2Nvj0In3ovEjOGqc9BbtoQZwV/x+nZQPdhtLrekBPMR2qNO26RkeEXWLUYezb9B3VQuphzmYCn0e5sEyLAkozB13VNrWcjmhHpajxPtYxL42DbV63+Jila4KwKAHe1LLjP/81dKZ2KsEUNnJOHRTXaYYLy/6vRaaWRqijxfnJNXnays+gRoHH27ncm0bBUTvuBbP6sfRsMMHSucX/hD1IZXxNpYpbi2ynkvFl/ke2V2fgnpgBnlo7DK4kyr4IZGDDOJdbUGkk4B1k/xMYC6lQ8SK+Ms9ju2r8etDPCq4UE0Y2maiW8sgnLc+bfWR/cz6Zf1JlbBv/qlcXlwFN9inZMFWuYjVFfrc7wiTdgzFBSQh5rjBR6UkqHoQfORwQ9l6vgjjEz8FQzWH7XxZh+xcF71dJZrhzAhQj7JW05ZORxQ+/6a0EOLir+ZnaWWG1tMiq3fFRJKnzTBkU4fI157gu/p/N8sdee2O6TpWeWgs/vsBtlZXC6mHydPfqsY437WBRK5AHCtRnZVF9OhP9OSJxx2nVbdmBq/CChsAqIzlEBR5kBSlsGAdBBidXUpYdb3SBmgK32d79+LoS6AQxeU6/z2WMDYX5NNxk8zb0qFoxCwaS63/v0AgVoAduS3ZsYUFJ+NmnF7fzgH/ghOiTfi1ipHnkKUjCAehiaGPN4p3N58STUyGCsqn9iJamGWfYk5cupAWYfO8h3J12TdhcP1Ll2KJ9gqqCVwoNMC8jaM1NRFx2qRloLj5mYBcVmn9uWApKFpTGhQMwcfR2JCr3M/tDts1KTSjyllrtuaYsQrQe48Op1Lzv7x6aJqwVGhUrct/23kDCJFxe6RWHv/H3mmKhkwOkZOHJCCT9rYcXZnJ/wzX2oKdGjmvyTOo90nWZ9CBHLonjaG8VJunRDX7398qqj3lGifvxDFNWtZlbg3bwefJkiXcV0H1uZYXaMxW2qVgiBf4abzWbskwpIan2zVUcyqvaUHgtK19O8MEfg5EGIDsy+tpPtkxVP8j2Ked6QYD2DbNrEjnug4zodRe5NvLMbA0l8H3UoEcVDlK6N8seRgL3nEJdxdQPGPJtpLNpxhzxLaAra1JP/3XZhYzkkONxTlYpqRx/dXSuLHgPRhMYjRxe6Lb/U8PLQqXp9lelfZ6YokOHqrCIdcHxvQXZel/oY7QARCpF9GXudQEGfCVQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: da1f50ef-d7eb-4267-7658-08daa5682bac X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:25.5813 (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: 7zKz1fT1oZmj7q+7YrBzXqrSb/Out3dXcJZ7dcqzIcCRMFKaGFluVASyjTCK9ZGdIS1FdpeszaFyrbi7rtI8km0cMJ7+PvITdOoFglF64VI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB4834 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: K6rIl8QmtdrElOunhHnfiZDLcdygCoZq X-Proofpoint-ORIG-GUID: K6rIl8QmtdrElOunhHnfiZDLcdygCoZq 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 b5fa2aad05f9..3f630798d1eb 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -519,6 +519,23 @@ static inline void set_scsi_ml_byte(struct scsi_cmnd *cmd, u8 status) cmd->result = (cmd->result & 0xffff00ff) | (status << 8); } +static enum scsi_disposition +scsi_start_sense_processing(struct scsi_cmnd *scmd, + struct scsi_sense_hdr *sshdr) +{ + struct scsi_device *sdev = scmd->device; + + if (!scsi_command_normalize_sense(scmd, sshdr)) + return FAILED; /* no valid sense data */ + + scsi_report_sense(sdev, sshdr); + + if (scsi_sense_is_deferred(sshdr)) + return NEEDS_RETRY; + + return SUCCESS; +} + /** * scsi_check_sense - Examine scsi cmd sense * @scmd: Cmd to have sense checked. @@ -534,14 +551,11 @@ enum scsi_disposition scsi_check_sense(struct scsi_cmnd *scmd) { struct scsi_device *sdev = scmd->device; struct scsi_sense_hdr sshdr; + enum scsi_disposition ret; - if (! scsi_command_normalize_sense(scmd, &sshdr)) - return FAILED; /* no valid sense data */ - - scsi_report_sense(sdev, &sshdr); - - if (scsi_sense_is_deferred(&sshdr)) - return NEEDS_RETRY; + ret = scsi_start_sense_processing(scmd, &sshdr); + if (ret != SUCCESS) + return ret; if (sdev->handler && sdev->handler->check_sense) { enum scsi_disposition rc; From patchwork Mon Oct 3 17:52:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612147 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 D6910C433F5 for ; Mon, 3 Oct 2022 17:55:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230000AbiJCRzs (ORCPT ); Mon, 3 Oct 2022 13:55:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbiJCRy5 (ORCPT ); Mon, 3 Oct 2022 13:54:57 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AC0A3FA0C for ; Mon, 3 Oct 2022 10:54:20 -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 293GODGW015434; Mon, 3 Oct 2022 17:54: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=yvmRGgmZ6AJW6SrBp/xYx73Zw+rkwBR1aTRdjZOXHhE=; b=yS4jtdb16vYSfG4yTgjoBX6HM7C2UUr6ALWYMwIUil8lZyolpxpAkzrxcQ1xUIOY++qW 3Nosj9CqVEOxQ1034d+DFhZqglPCLV5h2vhqQFrxSzUs9P1xbDlH2RdHRcVqopdFO9x8 meoaU6KM1gymCtRcpNOPXtfiYBP6N/p6GwSVkfuONQWqQ2i0rBQeF6RMn35ZPpZ6Gjb5 1+vGzjbua4M/HOeoTf/penjll1tJksovSM/RsIE+iu60R4jcIIt6svhj4/5HXTY6JnFo vgCC6/dCy8E2rIfjMAXr6GP7vwBa1wC9Eyv4Z2ChEm2AT+wuRJrEqEuQBQso/bGNBYza vw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxcb2mbmt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:01 +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 293FU5Qu028008; Mon, 3 Oct 2022 17:54:01 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2045.outbound.protection.outlook.com [104.47.66.45]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc09gda0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e4G6bNA5kbgao3RnFD4b6kFR7pfFprxSQnh6A4R8SsU57RCdvgIb4d03MeLHIbH7pFVrCUE3rEFCHacph/pduvxqqJ80mqxUuRVq9ibRXbLuJSXwyoj8beZZY9q7oq6OncVTSfoO6ffGlm00YdVi1HPBGP79N00bd8h1YDrP5r0GpxwwZ0flYw/pZU3KPQh1KdnI7u86C1/Mpg8eNQhSdukKWbzRVWoB4744/CDRZZOeJPlMYApvvPeTsjybRelkTG0xD9Sn5G498RBC1Qe+PcGJTFA0I5UbnHuWwztROOj4EtkvUB/LJtYj7ZqQ81Vnr7y69Yv36WxXW7M1SR8fmQ== 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=yvmRGgmZ6AJW6SrBp/xYx73Zw+rkwBR1aTRdjZOXHhE=; b=EvF8I36VcuI9pvljRjGCQeRiIFxxvshaiJmTDv2JMfxnGyGG7Cn81KkCkEnQmgyXjzAwbspO8GWWq7/SrKp6vmHGoFqK8zTD1QMWXeY5tbR9WTrG8txjel0M8EM3S2RdglzJLrhTpP6p8MMWXIw393tRRPEj3yM5L6HkwYIq7ASVf+jY9J71FndZD5gdfkkvPbTjz27SAsGpSY4WlzqQ88cExg7wmmpe1KN7usRfwE6iYbcC5EmS4ZivHjVE1sapQ7dDWAdg7fUdUZ3WIfK+gNWy66waQllYjltgl8ZVKh7IN2lIoGBJuloiWqEycgzp2NxDbvGhGx60K7iM7Dugpg== 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=yvmRGgmZ6AJW6SrBp/xYx73Zw+rkwBR1aTRdjZOXHhE=; b=ipKt4pF8L+U0ZPyP7XlEqxM1paNLOCSYkliYpSCjuIiWGpIsDhCwJfrHlS8MnsiXctBW2xYAtT2uIn7h0z2EBOHaCdVIzwbeIXQDhnW/beAOE/kDvKc9bkNVflcQKCWv9Zk1MPNdCsaALYHlwxG+RTTG19eiSveN58rfmwZ/SeQ= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BLAPR10MB4834.namprd10.prod.outlook.com (2603:10b6:208:307::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:53:27 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53:26 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v3 02/35] scsi: Allow passthrough to override what errors to retry Date: Mon, 3 Oct 2022 12:52:48 -0500 Message-Id: <20221003175321.8040-3-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR18CA0055.namprd18.prod.outlook.com (2603:10b6:610:55::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_|BLAPR10MB4834:EE_ X-MS-Office365-Filtering-Correlation-Id: be918548-c53c-4dbc-1a01-08daa5682c77 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dfUsolmv2eVp4RVxzwq4MD9qTMqKWZ+dOrYP8sYgLhQSBReYT5jfiWe4Ln2+nyJocE52y8/7ct8smiTnwDn+z6fSTZ6TOcdZnd15OTSJksIQqjxNe/gATrqgn7M5keiplVGweDOl7M+1ghZIoKdQ4T04WlA8TzB1cWGj2cguwaaaQn9Jvg6km6Abd9AnV3tDfqNafDTApRz+D0rGhlWGIbzHYg3G4lWt5iHlrN0gtrAFfWOUjJrZ09wXZS8ppoNGf8Kf1YPO69QSBJJe2oTr6KXgR5mJ2Fn+OW8sDPS/B4UEBQlYE7icNWrdJeka8q+53z1E2Z+FcLZI2xZRPQZsCN9Wq4G3m63kpGAt8tbplXWKPtjZNOAhZ7xZg37Aqkuxq+7ezg8l71NTuK8aJqucQfBwJcxSy/WUCx2H8KxL/Jpx8IxnXw8L8YlxGJHR04jwwGw/rZqea6c0YJvo4hO991ppB1AlA+O4HHxyZBLVaEIl2Dni8fNNMKSfoZOt8MJ7GhLyoqkx4oKv+2CZ+UrJlR3HgSNCkMQm2zz8aefMEC21W6EcA6MjHOK1Ghd93HzOTsZp3J6pR3bHU2mAlIrsx5ko/moiQYmHcyAeRzM8X5cyox8UkaOETqZCeaQDJQID5o0X5WyD878NwS5Qv1Dfu4RxHLlwoYzs34p95I0hboLEwSRBtwblO7GF9UBo17J2DPh4pTcV2bHvfO0pUvGIxg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(346002)(376002)(136003)(39860400002)(451199015)(86362001)(83380400001)(38100700002)(186003)(41300700001)(8936002)(5660300002)(316002)(8676002)(66946007)(66556008)(66476007)(4326008)(6506007)(6666004)(107886003)(26005)(1076003)(2616005)(2906002)(6512007)(478600001)(6486002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0gDgSsHbOEhfqAbH3t2HTXj/A+r1HJxAej5DV1w/slih1Vf1/PSVIDnU5dqcY1USjt5Ls00miMbjB9H6E5FYfTNAJY8Ci5LcfRK0nEhwb5HU0Hvh/K/K3UeUZn0Oc3IzwA8IZJLAXrNfdsvZHFW9qvKy6o2jpKHNTDyXG7Uax6eUtHrj6VXBmOGkQvVTlsmzv7/OpUJicDWSf/yCXJUe2vdwkAu57L4JzzbRHVJBO4z3NlJ+iq0/tYcD/nF4/Z5UnRZVwjUo+fUdlu8ALxIpXWrWe2ExpsWWUkZL7Yw9vxD+mKFbNS2lBDHeh4MlO9Bdq/EuQgxeVlyVDX6jxPjcSlUXpFPddUsHzbqaQKKrpdrIeegD3ZB5BYbHvTJJ6mdEOaA1Mzmq/qCay/Nualtl4omN2rAQ4cgrrJfgQsjWS7W/Ov6URCC0+eu+KjqrtZFuHWzFyDwsOb04Tyvv4weUeqD00Cdn5YoNVQZ6FSNF6afAV2VCWIBX42iK8RgJoSZPjGhZS6EAsIV24m+OIPGnWZ0SzF3nIDwupruTbFvAD8C3ZvmTHeJomXkafRAL1jrLgbYBQFcFOMr0kv0cG/6+Mr8Bgo7Ny56zr0IoI9wIqVhp+Hw7XhrmY9ZD5BqG1g7pTZzxTWul1Flehg15RpkcywWsbXJSSbaPuMK6/YDSNWK45iF6t6LPC4UcBb9CRjZKFxDxa6N+3YZNrTnGft91pQtcffWiiEd++JHJWpjAtZMsAaomwRb0cxeH/4DU+EDeoI9PFehAlD/jiDPr91qGtMYUKC1lmY/tubD9CwyhLBPToNBHJMlAqzwQiVd5Hx4iBDs9/rNJsxXB06W/pCKheY8TuhtskA1afzj3wFNKzCIJ13SJqEeuG5OPFn24b7ySvLsCLT1kBVWrDfAThvkE36mTUZZ4khHuvcq3gLLzyQAGKN8qF9oZ3yW08nBHgMRkoM0a50LmPM9//+1t8aerEJqGqZWeWFN+B3BSLM7h+zBybkYYOlrZ4PAkEu3aD/GHuxHyl5VSuwkQdAkB9W20pQCkUs4uwO3/VuaYu0shmE+hQb6HA4s0UHOzFyg977qTgITNNsIyZpVF/9uDj5im091oMe/OOOaTnbG5uq0lIwJsY+3ejILHXTxMGkK8G0I/VTB3tvkg4ONTmhQc1meQYecrnlBQzRZ+tLajXEWAspDoLTGxnzztktS3EXOPqtstLwUOvZkOmX59QUyMuJ0N1krrcok8i7JrhlnmAeEoriwljo3wuaeVRZv5hMyKoFspu+fK1cuF//arXX3E4rR3JRq1YZ3YvyWx8yu4zbM4XlM2uLvIZij/EJumIjcMsDWm4Qiro6SGjiQtafr3AXyUbu+9fDmSZ0cCj4gp/oMuVuiozzLCu67VC8A/C35jDNH4RgPm1NJe0M9ZN6AHq29UVANEU6G466BIB5pnY2+1f5SoQUi02SedhYgneH5JMdLKxNqjx7i8gKK8I5xvO/Dpzyoe8pkADnZjah9EDZ6G72ZTIIGOvXL5q3xF615t+Fahzy/0IFLTMcNJczgdhKSOldJAyPcEMCITPKCgveKUrQLrUO/aMpnobcxPxRnTuydBJNR8q8xodtP+JRkwIOkGjw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: be918548-c53c-4dbc-1a01-08daa5682c77 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:26.8468 (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: cK9vuNuCk8iMKBLn/DavfXMaKpGfqSNA+l6iBouASlYuxJQwB68iFyvjeUNjSktkDbZJX+xH4L2hEDB+ZPwydIr8Ydxgb0GDD/n33yltz0w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB4834 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: LjStGyx8L8KcJSRq8VJ27Z4DQ5sVAeE2 X-Proofpoint-ORIG-GUID: LjStGyx8L8KcJSRq8VJ27Z4DQ5sVAeE2 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 | 73 +++++++++++++++++++++++++++++++++++++++ drivers/scsi/scsi_lib.c | 1 + include/scsi/scsi_cmnd.h | 27 ++++++++++++++- 3 files changed, 100 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 3f630798d1eb..55765efa9067 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1831,6 +1831,73 @@ bool scsi_noretry_cmd(struct scsi_cmnd *scmd) return false; } +static enum scsi_disposition scsi_check_passthrough(struct scsi_cmnd *scmd) +{ + struct scsi_failure *failure; + struct scsi_sense_hdr sshdr; + enum scsi_disposition ret; + u8 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. @@ -1859,6 +1926,12 @@ enum scsi_disposition scsi_decide_disposition(struct scsi_cmnd *scmd) return SUCCESS; } + if (blk_rq_is_passthrough(scsi_cmd_to_rq(scmd))) { + rtn = scsi_check_passthrough(scmd); + if (rtn != SCSI_RETURN_NOT_HANDLED) + return rtn; + } + /* * first check the host byte, to see if there is anything in there * that would indicate what we need to do. diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 497efc0da259..56aefe38d69b 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1608,6 +1608,7 @@ static blk_status_t scsi_prepare_cmd(struct request *req) /* Usually overridden by the ULP */ cmd->allowed = 0; + cmd->failures = NULL; memset(cmd->cmnd, 0, sizeof(cmd->cmnd)); return scsi_cmd_to_driver(cmd)->init_command(cmd); } diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index bac55decf900..9ab97e48c5c2 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 -1 +#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 Mon Oct 3 17:52:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612516 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 5EA78C4332F for ; Mon, 3 Oct 2022 17:53:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229847AbiJCRxw (ORCPT ); Mon, 3 Oct 2022 13:53:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229803AbiJCRxt (ORCPT ); Mon, 3 Oct 2022 13:53:49 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C9CD37188 for ; Mon, 3 Oct 2022 10:53:48 -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 293GO9WF029401; Mon, 3 Oct 2022 17:53:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=MqV0MSihMMcXNM/P4R6Jq3SqrHYn5s6HiyWYFR54lmc=; b=JQXB2hLv3y0v2jAT2/rUTh8tIvWOdp/59dm7KI6fYFeOUzscK/+StUkbAOFxXrvbh9Ns 6PlUXmJM+dNAsrtA3oQojIrIHi6c0PODQIwHhqWfHvyXenRuRRXXmK38ZmJSiD5Mp7Ol r3yoUQW7IVWl3o2MfX9aI0K4oqJbDjGnROocIwofczsKQsJcsyuXJhqKgPY3K5nl0uV3 FOEKS7OE3o3BwARwdx37aJyeh2Gapr4Pa8DoxmwC1agSnjJdtmAvCT9PhJcNAetDyjzF 4XLLNiDha9aVfg49GuFOcWXcPuKJxRHP0JKguSCU3MP7bNoYepk6BncNJ68LU225Q7Cb wQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxd5tc91k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:40 +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 293Hd0xd015519; Mon, 3 Oct 2022 17:53:39 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2046.outbound.protection.outlook.com [104.47.66.46]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc03g3m0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dgVKD7fDkIJ3unchJRAHT3HJ1YD9EDW9Y3gtSys0HQyCSE6FYvcNT9MEE89ihx0vKhJvqFaQIjzgiyMyT885lNQ40rH5nBSJ2pKKYC2HQjFkF5VhnP+Qb/NXuFqW6aPuqd1xHbIh/vr+qQ+KcHvw8G6PMD09uv0y+P4HlNMyjRrxM1U41D3dtky+9cxVYi3UxaPjJf03KPDitaTtuQiJiD6Hmus9B2n3ewAUkWusLvK92TWyM9ZH7xFAFLgBLdGMxY1S9lsWanqqiVOe5F7fF+efj9KOHvDJNVHiIfWbho7IWfoYvql4DtQoycsfotng0erkQDFxmzoa3dNzapW7bA== 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=MqV0MSihMMcXNM/P4R6Jq3SqrHYn5s6HiyWYFR54lmc=; b=EaqaICYdUcNv/od4fQN6vgnsi+FHYKKnQi0sEQEmxSjJX7UHhV1ypIx1nuoR12L9CgOaA4kCNYMpOrvVKgX1eIxbDcfJV0f4eWco3vZJnav5u43C50cqXELISX24Ga49F4r02jyv84UVjrYADUGZrlJRP0c7dkje9gdXCx4ukccFlH3oZhVRTGwu6vmWZZ3Sj9b6yFp4dlYx5w20s8GCzOhCx8icZpLaeG2IB5/4bHe9yWWO/xuNW/dLfo/cEVHkqSP8yMd+jtj4qGf3WWx3Uk26l7DSpO03fM/Z+Y+LN6olux97ABa5yLy30IHMzZPX3gwsco5+OJ1prd7+wGchYg== 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=MqV0MSihMMcXNM/P4R6Jq3SqrHYn5s6HiyWYFR54lmc=; b=qwxFv9GSMFO2FCmhx58JniyRz45LuPzzog4wKRFK63XgGlJXsiN1h47c95lf5HUUI9riCXAvAf8yMz452Umyll4XC+UVGuzTJoH6F5+3FjiE3TATDd3tzXle3wGD1cemVkClnzOvdVlwcWNsSMuqn9ZFuTroWikcR+MLxGYRGCo= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BLAPR10MB4834.namprd10.prod.outlook.com (2603:10b6:208:307::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:53:28 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53:28 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v3 03/35] scsi: Add struct for args to execution functions Date: Mon, 3 Oct 2022 12:52:49 -0500 Message-Id: <20221003175321.8040-4-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR08CA0023.namprd08.prod.outlook.com (2603:10b6:610:33::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_|BLAPR10MB4834:EE_ X-MS-Office365-Filtering-Correlation-Id: 14e74ef2-7f08-42e7-7e1c-08daa5682d84 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aXGlmLGogfzQ6FdU3QaPQkxEXwL21A+isC/HoLy9MBmilhhy+fRLJ9W9lv55lO6uV3kAbIB3gWjwrUNVhWtUm6CwMH69uSio3Vxrps39UXI10/mZ3FvYy0cTOauT4V+W5cdWhw6kpze6GByrURDqGUE12JrIQ82zwTcsdi2uKJ3B4FQ8dUt+YZhIhOY/tDSeG2O3dhgJ8genjI8LQeGfs9dUEajshtRxSzFTuOVUFa/ZLQseh4/PCQOsE0i+YWkQsqLxtDL3VE3DnmfSoGaNaWvTh7LLDNpUu35gBevi2JL3scg/mbX7LBOxzFeAkInh2a6CVksh8CkwJXaJsBQgTyqiuQPVZa6/9/tQddmJz6ZhDB7/5bJpRdTYDXgjq5X6uTLYrt/umsuJWq0AW0w4c1iXQOYERoEr7lavsQy45ZZH0S8dnetrrDzr+3Yhcuz5B+hJ2iNu8dUh7GAaLILF2eR7yVW++Jko9FEa7y1BujbETePrXR9r6eUzXDB2aG/kfYG6qtPwvRo8PnAJoLy83P9JPb7UcOGwG2bAmqP0vv0eN0TohO3MKJ78KiCj2P7jh5jluq+wN48uCbDGvxdUFFLpC/ZKrMSqWbf0s1pobX36ptLPVFi4LenPO9qsceUUwl4jk/G3Y+iSooGujYW5eiky5CcWX9RXl6HqRgxa80ujOQk89wyBOQ2zQ2myYxDgjz5Kk68YSBpb3KLAB5JmFQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(346002)(376002)(136003)(39860400002)(451199015)(86362001)(83380400001)(38100700002)(186003)(41300700001)(8936002)(5660300002)(316002)(8676002)(66946007)(66556008)(66476007)(4326008)(6506007)(6666004)(107886003)(26005)(1076003)(2616005)(2906002)(6512007)(478600001)(6486002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eC7NozQsTfXqD4nwhRJmhllXlQdVgdXoyckJMgy8x1Mjdc/is3/rnUxqjizU07/Sxk/iulwzk7SSUuvOQGm2dByrHXPoUjMj860a/P0jEJs1Avau3LB9ZMPvvAidIWPfM+rd8rhjEHYOuphpY4ycVrq+569pmPlaG3jeA0Qk63fjrcK65cii5hgRrAhFcT2cRj19mC5kZLnPCw1MkTfoVp47dncDtdiWbRPiDaxGICTmxIv2X2P+teIVm+3Zlw+cVCBZrGpXRkv/ujO0q52Kb7eyUFjyEapwMz0gCryqsnTO40eIV9NOAGI6Bw0UrzguBdkeqsI0O8A8WPtXHn2VkSvPCgkUsNHvakrAG5TE5daykYMDPoZXB1jQmiX2K/w/6DeHTyTCPjkf5dnQ4Y4w5bCU5VfDO675oWkboWkdHl0IIllmxnX/qEFplqv9UJzA2J9kYXT1x2QLJp6dDq/vF3PoZr4mmOTG/SyudlNWr4MU9wDrE0AKb646WlFYFk0P6OcrOYgRQEmsLypcy89bSq63E60aYP27JQpbx9VRDjA3BkP5CmzQ8JNLqQcpqxDBTF3ziDSZ7pjFb7tuctXYNjrZiw+I3/evFsOpjo2GkmOyftyjHVCbU2A6pn83YNTyiQgkp+6DzrxA03zNieKPPuFhKov/xfhKgtsjP27B7+75MTkHwLgCw760H7PvQdqEye+Sn9zVTtd8wSd0RL2K0L91wReY/V5SepMNORAFWI/V0noklLtDbr2zb6CldMdOtrKLRmUDGbLAfs1TsV5zUB0kYC13ln9J/YsB+gQ2WECQR3Ue5fzitxZR/GUY2cg/aBQJ12buvgB6clAVpEWd3nUhZDJu2uO0BV+NqdH64jwNoKlgOHp5mr4YGB9bvgorf7TW/+beEcf/u/xE7UkUETr4pyhpuhZPUmSVM063FRdDeB5bpe4PuJgisbNwobxSKQlJoRULjheIzlSDEBKQWRE+Thzg2rrQNTkLV9l3jNHMVodGL/YhBhyKZcu0bzSSZGvLjz3pj+CB1x/W4pmwtz8581O0C3DIXFaZ4wIExAEY3OA6ncHkTZhRnQuh1Br7m9VV4d1dpPTkkjtO5FSwpJxKYvAJp+NZTlQKZ0vn/M5L0TIwqXCCQFbB3rsJhvA03+kz1J9OL6lAlE0U7pXwccOO2uYsSa/412T4bY77t+BLoCQQmZm3q4cAUr+5kiURPtWtSxVP09GY/w3aCiWYTym5k5IPpsyjC2L2PFSAZr0SuNFJuWXacsSvxX6mHe3cXQlI3cDv+iUPCYL3iYnFp7YlnfqWdTvHHX/p3r7GMv8JcQ2K0CPPEf/MVjz03n98laeqnd1+8+umDRogA29nOuHbx5vlvOU2EJhBazCEgZg1KVwFYBdLEeOJc7ExnFf1DI0iEZw+RBlkKcnbg3urr4O173vFNAg669r8qRTQkjwj9z0PJEHRskSgD6g0bQ6PIPjIU5UneHGtAQeS2EmhRKPmUTOWjqY5gf6Kve2NYqXzKpCzOAeWz94CP5OTioAniI5+LHaZGrPlM27tP/T+2A5H+mf2ksmtLSVdv1bj11Ag+nwGbulEHAaLW3IMk7kL7qZz55Csy5N60ofVaDeDmA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 14e74ef2-7f08-42e7-7e1c-08daa5682d84 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:28.6123 (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: WG5a+JeGsayV4EAXPoS1hVbTnNTY+T0BBN6Yqm2+vThTf961K2DpEd5wPjqdaBJ6Ep92nYhTKCa3ULY1GuWHCFoeTzzKR8+mDmYTuT7+DYs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB4834 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-ORIG-GUID: J6GBSiXqGY-Fh-mV-OG5qFwSJmPFxLsN X-Proofpoint-GUID: J6GBSiXqGY-Fh-mV-OG5qFwSJmPFxLsN 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 --- drivers/scsi/scsi_lib.c | 69 +++++++++++++++----------------------- include/scsi/scsi_device.h | 69 ++++++++++++++++++++++++++++++-------- 2 files changed, 82 insertions(+), 56 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 56aefe38d69b..c0b4ef0a2074 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 2493bd65351a..9975d04acd86 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -454,28 +454,69 @@ extern const char *scsi_device_state_name(enum scsi_device_state); extern int scsi_is_sdev_device(const struct device *); extern int scsi_is_target_device(const struct device *); extern void scsi_sanitize_inquiry_string(unsigned char *s, int len); -extern int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, - int data_direction, void *buffer, unsigned bufflen, - unsigned char *sense, struct scsi_sense_hdr *sshdr, - int timeout, int retries, blk_opf_t flags, - req_flags_t rq_flags, int *resid); + +struct scsi_exec_args { + struct scsi_device *sdev; /* scsi device */ + const unsigned char *cmd; /* scsi command */ + int data_dir; /* DMA direction */ + void *buf; /* data buffer */ + unsigned int buf_len; /* len of buffer */ + unsigned char *sense; /* optional sense buffer */ + unsigned int sense_len; /* optional sense buffer len */ + struct scsi_sense_hdr *sshdr; /* optional decoded sense header */ + int timeout; /* request timeout in HZ */ + int retries; /* number of times to retry request */ + blk_opf_t op_flags; /* flags for ->cmd_flags */ + req_flags_t req_flags; /* flags for ->rq_flags */ + int *resid; /* optional residual length */ +}; + +extern int __scsi_exec_req(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 Mon Oct 3 17:52:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612155 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 C0A90C433FE for ; Mon, 3 Oct 2022 17:53:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229795AbiJCRxv (ORCPT ); Mon, 3 Oct 2022 13:53:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229810AbiJCRxs (ORCPT ); Mon, 3 Oct 2022 13:53:48 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D63D37182 for ; Mon, 3 Oct 2022 10:53:46 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 293GODei015444; Mon, 3 Oct 2022 17:53:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=DUBdMi8eeOUQYsnXxo+XCusZ9wKDAWj6SzP4m+poGjY=; b=wV8/f2XGXD/xWdoZAe0U4rYn+W0wR/KvnOnyeqr3I6zczRmXK6dounXK6YPlQA86IEqG CjpehhqUC7qr2akJTBSzuQ0DiY80R96EdRJHd44yRy5X140ZwOWXocXMnOohKarco/8E e/H651/lieqOfdOFa8IRWzOn3jK98FJCrXuvcAU1u9j3QimEVldDiaUvA95D83VNiKdH yvZrXaanhAHYqogJGZ8dbd9FCgjNNAKPouSP/tYQXjOmSdhIhFKqo6PgF2ODXAJA/fts x0Wr4+mWs23rX/V/jeiun5IFBoh73KXZrszTbWnJ53A/zASwPDRfUSUtC7gC+E16JxGJ 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 3jxcb2mbkq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:40 +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 293Hd0xe015519; Mon, 3 Oct 2022 17:53:40 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2046.outbound.protection.outlook.com [104.47.66.46]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc03g3m0-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TgWQKW06Lkg/ydoKU/rzFoJ3XxuLXLNuYBWFtx/AeD5T+11N6kdE1yqQ9BzEk2pB5/xvck52DwUfOmM41pDB4FzPeXnCS4GdcSmOA+V6UIR57peFHu4ToLI0Yk7BSoBooa7evSe8bQc7KWOZ7tCROsTEqGfFVyWfKvRDFIGlMeW3TfZEKhl9T5rpv4AdF7+BY3hNg7yOXUUG9YeDBGpX4uByvWcBejX+CqsFzjAciiyTKat1GaiUCvU+KG+YsY6wmHe3raJGzQlciZxrb77sziMJVZlzrFiXrc0VDJY3khtpDXA0+GnyJhaudGF/SRY2ZbE6oN8ElVDTs9aClecITg== 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=DUBdMi8eeOUQYsnXxo+XCusZ9wKDAWj6SzP4m+poGjY=; b=IhqNn85Kh7vmjUQKIvYpO0KsUyzy+7GWQYKE1fd0uqXHZBcWX3prhrCJTIuJI7E9j8FR9pT392VjWtRmo+pkwui4dpJEe11WMbHRhTBJYQ0xJA2B+7TtRcmmHmTgT1Cdk0I6FWobjC0y36PNdWuar8sLfvDtOBLCKsQrg42syXkblMnoPK0zs6rnVMTUBC5RC84U/5gUEv4aitOTpfarbzPLaGR0lg93IyiOkkATC95zrnPPmfWdhHm+1SKtN1RnqSumxy4I77F2DtBUvm4yJIXXMeygl7OeG2kLwjGf3LpDGbRJe/I2bZXZPlHIbQalRYLhrAOSuNEb4DThWt26ew== 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=DUBdMi8eeOUQYsnXxo+XCusZ9wKDAWj6SzP4m+poGjY=; b=jNIrs0ckpkyc1EpbzQPAkDXaPcvnBypmNtMKPrFJu0jtRdo01QTTfW+DYFIA0gaxF13XgDxfcX+yI7RgAAj5zMfBeIQCis9zPDK+OocX8Hek6aaxru0l1rEKW107TBAoCrdatJxNOIDcyB7IGfIrOaF8tF5v/uG75WP2bg4miak= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BLAPR10MB4834.namprd10.prod.outlook.com (2603:10b6:208:307::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:53:30 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53:30 +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 v3 04/35] scsi: Add scsi_failure field to scsi_exec_args Date: Mon, 3 Oct 2022 12:52:50 -0500 Message-Id: <20221003175321.8040-5-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR11CA0006.namprd11.prod.outlook.com (2603:10b6:610:54::16) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|BLAPR10MB4834:EE_ X-MS-Office365-Filtering-Correlation-Id: f9790356-1176-4094-a8e5-08daa5682e77 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wQh5bzT3KTESbUHUI5oLnaKivzcu0zSlDh+7+MKf6EZwZnJCXojm6Bt23LO4C1fyHsgHkcFzKNXkXj1+nl3AIIT7mMfnWZrS2ZvF8OBsi7ffbazY7Q7Pcw3Fq56Hc4RsJbKGQ0OlZglkLlTtLydlHrrmV00vNIPd8xXJir24oVM94/pCbxrmngDonlJJFGYJqfc6VsBJcYoBNf0+3el+xPwgWC2DUuhdT4CucfwMybeVsMEWjMfoHIPcOvpXzOH4yr031ZOvG/Vw9HpcTLFqLIMx3Gava8QZstwDBWHCCntEZ4BwdUwRG4s3a8QmrMlqXk49qHj030vyYuILuMa0Cnp+ewuoE8LD0+ppxJS6n4hSAXBQLqiBafOXqeqF5xAa+9/d4RErWThdP19RWQdnCPFh+7Iusxn16/GFPtw5FDMNYbQly9cn9VPCjqCNg9q+4WDxYhgHVhuSLujW5owL2ytSfzbhHNMr2oFG2cqnwsfnFGsoDwuMoTWRXXWZeSu08Z85GpGdPFJl/y65ZYuAMzGD69uIpmDq10kjgDQutCTWjGfZkf3OcIsk8ROrcqK3ii6rVuNxLMv19bZj/O5U+eToJIeodmlYu2PRAOnvTbQf5YXpnuywOQRqfeINcz4iLtKgN1RABhNuI5M+hpG3nLUop8W3gpt294B14Eihtgc0Scs4aJtR7t+O38qQJi5gGNXuV3a0dX88NJemasRjcQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(346002)(376002)(136003)(39860400002)(451199015)(86362001)(83380400001)(38100700002)(186003)(41300700001)(8936002)(5660300002)(316002)(8676002)(66946007)(66556008)(66476007)(4326008)(6506007)(6666004)(107886003)(26005)(1076003)(2616005)(2906002)(6512007)(478600001)(6486002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: i9BlhoZFnS6+CSJ4F5wiUFVT7GKvR/n22/XCIubrLJQLhIaQ1uCyG9XwVWz/Z0UR5KDaBUuhhnEGlwVS0EY3WyoC6aaVdgQCK2o4VRz7SZ8sJnmiHeCYIoC3rkQK8X+WtDW3pDyXGx4VEUVY/TWQsJbFgyA7Uok5SWGdRapVqesuiHpTy8NUuiD39p8srXFwSk+WjTqSwZaw9dvlZqekK+bUQIMDQeLv4rHb3c3BbmejClcr7I8v2m7rDjCMWSWFwCyMCD2PQo+IzsX9K5Ev6n1ly1KShV3jopp1xYrjgAafLiNuplB8m5AzEEWLVDD4Klta26U2/2LDLL8oXuVrcC+CdjW0bG5JhH5jyLSNBBnCm3+4daxrcAZ89BigzBy/9hOIbD59OaTN+6N5Jtzl5KHAxoLSJusOGPPR11pbB1GmFDLb8+DWFJeCVsaao2m2PMbHf6Go26nDvl/OL7JWsg9RnCMNO+1/NrPTuFWzZ4AJSkcSCAVBF2vCzpA4tVRe6GG7f/QFDLzua+265H9Gdkhomn4DZ6qyg8gA8koI3b3fMQG+y73uMjGaESeB/Wa6z47OYQgAy6EjDG14XjcKPiQX2f+mEoF49AgO3xVlJLPgk0dgg7SEXaThHYfBo1vp2ZYYrkJAItWBLInI1LeY7AWJ2n9zIv2m6JJhUywZ0LJVcKvhMB8sQPFMXPyISSGiQNPopVYO88ofKqL289N2dl3eFaLCZt6Q8UG/ECbyEiPtdVCgYU+/YmSwISRUFpCdHSvYrH+B0kmeeWDLukbVFG71r3tBVZoKzZ46Isa/9xjDOrm9wcADGXeGzAiQiDTlGVQek25AdfywNHUEdi2TczoThzcTUQbDGK9TFMlHJe33lOeyBdO+PXwNIA0TMJYzpZghhe8fKL/VaFLABZAxtCdf16JzXzvvPAZjvnDUdV9lSzQAsKlGjohVLx6Q7rLAg+1xDRSruICF7AhVEigwX4AW20B37VdBijYzmzkh3CAbeHGw6mc5qSYnZTgBHKSju8FL464ao7ExL3Szt8PCd8oD+6oy0q9dvIMcUKcH2+QHmQV7wxd23XMC3nwBch0Qscdz4XiDzV8y1dFFlwfqmBhxxpwauRh4zGCSf6ThQ6uu7Or25SjVJ8vrSUK9Usa0k6KlwyRxAhhMctnL58PJw2DySvEHuEGIM549qwbgHSrDAO1F/3m7DddbsomUxcCkqzRKqD6V4KGn/u1NpKNOwNyCwffmrlVxnjQMVegi6AI+pK8NLh5qGFf6YYNqn2sieVEP95wGC8leSdsviQ4mqaWCPnESRaZsqUaMOc8uVLq8B2S/RxyR7Ddw8yY9xHV+87pNgwjBFkr6aLswmAbW/GR27tumtCNzKUe7yEsubcZrqOLta4P33de2CVeRsmZhjLN59tEh5QNMdtUfQiRjhOpDz5BUCuyXzx/4cKPWFcrRuXmyYw4dg2pY9jzgZNXs4ry1IA6an2Rnxvqv3plnhzvj5fInnbfAVlNG15ZGoByisrUleLD1VdZI/nTcNzgjMeU4gBZ9K4cdZ9CF9il7ZnOjwL0vr00Yu4/qrms+HF1eX7+tg71roPVuQcPHfgIZIsW/J94akw8DyuCSKYENTQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9790356-1176-4094-a8e5-08daa5682e77 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:30.2059 (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: wZMVvPtS3N/76kYxExzjLrMzj+Tm5afRFM3hXVf0wkhJV7lwN5qJNi0WDG9wLrEe684iMYhE2kDLhrpt2TG0brBYoxCXjfF8U8xLRCayLMc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB4834 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: 3Arj8DWDba_zEPnWBrLOqpL0DK_8Hnbc X-Proofpoint-ORIG-GUID: 3Arj8DWDba_zEPnWBrLOqpL0DK_8Hnbc 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 c0b4ef0a2074..685f2245d222 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 9975d04acd86..6d91c14527aa 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -14,6 +14,7 @@ struct bsg_device; struct device; struct request_queue; struct scsi_cmnd; +struct scsi_failure; struct scsi_lun; struct scsi_sense_hdr; @@ -469,6 +470,7 @@ struct scsi_exec_args { blk_opf_t op_flags; /* flags for ->cmd_flags */ req_flags_t req_flags; /* flags for ->rq_flags */ int *resid; /* optional residual length */ + struct scsi_failure *failures; /* optional failures to retry */ }; extern int __scsi_exec_req(const struct scsi_exec_args *args); From patchwork Mon Oct 3 17:52:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612154 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 6CD21C433FE for ; Mon, 3 Oct 2022 17:53:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229851AbiJCRxx (ORCPT ); Mon, 3 Oct 2022 13:53:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229839AbiJCRxu (ORCPT ); Mon, 3 Oct 2022 13:53:50 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B7D237181 for ; Mon, 3 Oct 2022 10:53:49 -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 293GONAv006557; Mon, 3 Oct 2022 17:53: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=lkAeM7RbNmR9/2pMUIxoISiYj3HFSG79+Ej+yWSva8M=; b=Pn8eIbgSGyW+zx3NdCpynYUt4Sa8f2v6NkEBWPOHaa4U95c0PUOgnUTlRhqGKMYoezH/ bBOYBGYAVPvG36DyJYviZFX+8BdS4049kYN5jcdEIMt+kUlVUt3fsurQDJwun79qkVYY Hqua7rZ64eJz/DK6TzBmcPLKcxeDSkIFgunAuY2MECMCHvWLPR4LiSYpO3z15geWTjFw vobNzviWcxC996GrRdlA8GO87eM5UiKXluNMlA7XmgF9Aul5uKddfGIcc8cjReIN/elU 3Urjk8FKDuMS9E4P1Y9ElYf3jo4IwBKZlgUhNDekIV/z32qGc+bSTodaGOCA5P9YeI8K qg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxbyn48t4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:41 +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 293Hd0xh015519; Mon, 3 Oct 2022 17:53:41 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2046.outbound.protection.outlook.com [104.47.66.46]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc03g3m0-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZwUotUyUhieYN8AanqLWaMx9zycxFUfOTgaSc47IYNJ0bUmpSqoVvxGsV/M8k2Pa0bV8oJhQpNa8jOf3UwctOnUAuraSfYZo9Tthp9RXsBstOR5kBt9uhAnQk1oyjI70oxJitJ8IP8jDk+mbO5xhPj24Ay0Y+TF+e9KdTK0+YhZy8rB+tKxlATGLp7tGiFphMVy5E8bhe8zXGktxJjcNJW7M6ckyp/OpdHVvZqW3D9iAmQVXYOrqtJrI3v3Snk2Y5REhDpEmN5/PKgniG0/We+9U3uhvYiMmwS2OXKEUYAEZ83+f29/HauSTNp7zcWhxJCPVftCLIso7olCyyBT11Q== 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=lkAeM7RbNmR9/2pMUIxoISiYj3HFSG79+Ej+yWSva8M=; b=MBl+SI493dSCFVNrh5sE2IJios53NCvlRKs8TxEGlRCqY7iwcSeo2HIr/dQofYw+ndHAgP7aDMm5yIeEMi07ymHf02SBljbKgQIcdETzfdRxCU1TK9J1ESFgsD7clEWLEsi1qs9Iz8Ibc1IPxRHtJ4keDe5GtDwSLnZ41bk2x8m2Ca8gdrQANjRq25SLj10Iob6FaUvNn4zE9/qsOj1+cd1qcaP5jPOHWh+ZSrg+q7Ps6CIjBzpjEOU9DVnuS6tn5NVlpEjWZr+EJ8miOmF1FxrlPTtBqfvPtnJNvuwBDSemrsaFi5zQNpZqwT5wFhHLvivE7IH8T0hWST8pDpH5pA== 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=lkAeM7RbNmR9/2pMUIxoISiYj3HFSG79+Ej+yWSva8M=; b=QRDDyGc261B9+PF1hkU232aa2O6LktLBLSHf+c0ceYloLvVCObKCMFLi3F98WOwkWjW4hXoT987eYD1rtGI/g2UESDQxvYjuPM9rPClFbe13JAupJr3l959r4DoEhLyl2Nes65cm2Oba+Q8adk1i3A42edmziZ9XeXtjkZd4yIA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BLAPR10MB4834.namprd10.prod.outlook.com (2603:10b6:208:307::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:53:31 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53:31 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v3 05/35] scsi: libata: Convert to scsi_exec_req Date: Mon, 3 Oct 2022 12:52:51 -0500 Message-Id: <20221003175321.8040-6-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-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_|BLAPR10MB4834:EE_ X-MS-Office365-Filtering-Correlation-Id: 308cbb77-71b0-4a0d-112d-08daa5682f47 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bvThzffJc/23VtHqd34515MJ37xV1OUMHUTVhIcsn4mf5PCYx6fIZ+75lZwhBRrZLTQaKRTmMPeUHOqbkuB0jNGXhph6NS3YUkJ7ZhlDpXfSlyk9D6pkNgW48BRh7ntflwg/xXHESWIyJOfVRaszjKtW80usmJRCwveGAuJVW516sr6y0XrwrXrp5pkRDW6ONwcp6HhDH2WgkCyqJeAty0Oe2sPn6pPE/0bMIZWEOhP45MjXnjpA8/KqQrQeV/9I+eVBhcHO0YDc2AobHGsr4ep8z4aiKnVCtO1zG1TD4RNa8Z0gSxVrczp32iyJ3OJePG/eIAObZBXyUx7lzG4zRf3IlCaaUBImTE6SSxiP9oA18TLQ9lZhnz/X7Lv5vN4Nw8C/4wIh6u81SVbRs+fxk6LlSzmBemKTpk46rYg28aVDJodMORTUIiicwrMLqtltS9AnHpgxalj7UbA0Quoa/yHcNIoekTWLkGDC+5S+0Goq4mbo76oOxsBNJFXQMC0xoWH87WAsdW6FAi2EkZeLuT4X+5aOOcLsP4/X0JdrdRwBN9zu31vFj2TwFDAFoBmUm80wOHwkqQl6PrvC14k2CgqPKpsqmwYEykpJLcu5wCWk8nvh+QJ+4w2Io8VUESfDEA5HZd120cf4ObBFJCaVJ+anhOVpBX4xGH7EaefDr/Rzv8WpVqJvo2C5bNuT+QJrMyhLtQfWEi57lB1fnoKjjw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(346002)(376002)(136003)(39860400002)(451199015)(86362001)(83380400001)(38100700002)(186003)(41300700001)(8936002)(5660300002)(316002)(8676002)(66946007)(66556008)(66476007)(4326008)(6506007)(6666004)(107886003)(26005)(1076003)(2616005)(2906002)(6512007)(478600001)(6486002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fITZcn/szdsCbw88nw86wd8iCN0Tol0/f3+CdvSTkwBj9S87FcMq9vNlRhCg6O6c+zb26uUDfz1o5GfAqZ0g4n1Vc+fAPVyNSoUTzFfYMBv16a2zbqcyA86M6iI3ncV1mGWbKRBaD59l/X6J8QQPyD3QSYOAXVnuZZRet48YHFmsI7Ki/uvDdE5rfGx6uHEYgneZ7chkQoc6GHzD6tZSYe0Onnxhbx0GJUZa9DPTPFIMg1MXpGPQaiAd9WunEqHlUz7/66Q+6lk4Aga5/UgYnnBCPn2JE2/RsH17LzjZvL6EZQ0yba3f74SWWvWghRlt4UqfJD9wTIMJ8ivNW2qIRLdDtOxM3dF0A+mt2uhanAOz9jbO5ojIjSH81eaZvu6lGuvzh9oT0M1vR2cEX52xjz3vW21rsC20SIlhrbKnLs6V3hAiWvULTXVzOh3fgNoVxJ8lLfFvBIqq++BEbYke6wOD6l0609Wkm4zF8nl/hDLGwUsByY7ABz4Q+8+geYeOQE8jJ6TEK8F1F7MP4CPFUVuS1ANA19v8uq1vCyT6OxIE5MbMhAd0atvoaFcXQT3hj8cZaMyvxjxx8xHtqKa33xUtmuiuF7wevpRCROq4HvbdkroL2laUR6PT+ToTr1vpJ2/KMflzDJqxvOXKO+F1i1oI7tRqQzlJzb+1HKNUOUtUeuh58yPCdzY5s7HW8x8xreVu+v10Gr8enkzXdp2tcnAh0hoMExkNfcGBDmJ1QA29CJwCQpfo2ymMHgw45jHEU21T4p9Wwa+a5Q8MtQPSXzNNHKQFH14hip43oX7S3Z9pAl264PmV37gc66GxMenvHn9IPb5Uq2E6xeOL7kolRniTJ9Iq6tAbkivNZfNZm6EGuLOpiLPHsznPXGSJHp5sW16/SNL0OA744JLIxuo0w0oMEojrMuNmpheZReU3tCznA45Y3bGpmlkvLd1Q7Ob62zDDQbTECaM2DLbR7jNJtKEQxjSudLW00it7W69Mqb4E/atdrU2HW5lUBRuxfs+SzTvkqh22OtRyEVXPLJX/NB5QfLIPA+cwx8jeloXeso6ovX643BatR5dz1Z8mk33f3Ej0b6//I/nIbvksFrS0swAmXBioCLYmMO+Wqy9hQxG6xRG1kt1910Hv0OtcMIkYhb0eSbs/T7FCD8++D/ekIA+pGHBy3klCKDtSblyYssltnHM7pCWqGK4rGEvVA65A4LEznsQzkcSyRfKViAWn+I1IBJQRyz8d3rHMWSE+NVaqBNRRywp7KSOZUIRl0pS80Eqs9x5sh7f9YWOaLnRKfn4cJZgs7L8NyWEeyS2DEp72LlfS3Y1/ZbVtJfPDa7GY2ujQSX1oyxmW5sJuZAjU7R8QzqNP3LJVKANKUiZIILcRJT1goTjv2HnlCNK5Rjg56A/m1JJGBWygrgfRehjGsqJOu/v8oZVI3ea9OchFmoPCTHJxmrkRGdsARGtsg65Kk6h0em1EIe/EtoodLAOwZXS245xX+2rF4sHPB6WsGOjQ6trJlpNKDvsOsUKgyf2xhkBetDZLfwIFmmVj2aUMS8KdhhFLFcEn+OOvsQHLdEcPwtKVhTKGVFgE10BIdfsjlykw/AsxC5CU3WcH102L1w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 308cbb77-71b0-4a0d-112d-08daa5682f47 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:31.5496 (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: xF14ISUNOWm5u8yYLMNQLp+K1ASNxAc+d2zQ9t94noU5Ju168wA7wbIzIUtT3ZqO7t/AEhN1Bo76ODhYWT9VPvAe6zp2wew3+xrVZvxo3II= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB4834 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: 1UfMvCoFgtSzeeIuxadSOXXVEaiIZboo X-Proofpoint-ORIG-GUID: 1UfMvCoFgtSzeeIuxadSOXXVEaiIZboo 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 ff9602a0e54e..4c07d618bfed 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 Mon Oct 3 17:52:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612145 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 ABA24C433FE for ; Mon, 3 Oct 2022 17:56:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229924AbiJCR4e (ORCPT ); Mon, 3 Oct 2022 13:56:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229920AbiJCRzM (ORCPT ); Mon, 3 Oct 2022 13:55:12 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EC8C11C29 for ; Mon, 3 Oct 2022 10:54:52 -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 293GOIct006279; Mon, 3 Oct 2022 17:53: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=wx55CpMcerkKOO4XlPesewojj9SabUqzqSEDbSnVQfY=; b=SbwTQs4k3zlnBqgtvYQUD5KNke9K18zqLcsXFnn9v02GYXo8Velw6AsRL992Vw3fCmGu wqcSy3WZNhMabpYAL3EZhaDmu1pvWohUciFRKB5IIT59oLnXdXcFeh9RHXxXK3p9pJIK 5lv7jMMPQSKiAiiKvzSbJIh5Jwq+nml/mWqVkgIAxVhjnJCoxoHFMviS+fzRJWHkRhtJ KRh4FSfXyG94iSvZW043Ttsxj2N0AEHDb8N9CImt/FtmeTU/X4TWeRoYKDGPO3PKhJFJ wmDDllmpcX3u210c0zJN2oN/PvMh7ilH0d8EBnt8Z+b4V63se44VmcvTkDMb9N2uKJpn lQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxbyn48t6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:42 +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 293Hd0xi015519; Mon, 3 Oct 2022 17:53:41 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2046.outbound.protection.outlook.com [104.47.66.46]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc03g3m0-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AN02iv34Rp8CFLWETB5OBBRki84KylpzW20PrRi5KzM0fxzWGzcD0cjWLNXPkuLOO2P9VId/QLzP+EcXWn9EfarUqnCtwFkp1XHoLxPta79nl748XqsMcc4MoG+Qwtt1hbEeGCLUFIXP4PD9MU1SYGnjvRHR5hQHoSvAKbhVSoHpokFLzZJgUf4xAxJGBm+nmjUi2oW48DYmc5pc7DorJa8kDv6OXqMR6m33LCqx69Z/GpkMYkb+UR0PRj61Jb9AJWAz8dSUIc6ry53OaDgteDiKettZfeXZx4eF4RJZU9dEs7c37idZXylwK9Zkt3Bth85FqdPFNl4EJDCeEAqsRQ== 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=I53zZCMGeAlF62l/D/D4VqtEaameJbVa28JVNMUbNCptowMTlIWpC3DPi/ugK4c+G+8iqc+iX9jX6wGvhDUm8UHa8Z9gE98wOed3AANBZBggKNqxxvB0wE+H5K4+ESBqGYNPe53g1FaYUUfOhmUyLFiFqf+qrINSu4YBXNIhQJSg5Ok+DFR1dwj2Iwh5JK8uoaKm+cXF06vQP5h7snI4q7EelwfdPY/aTDmr5jd47e2dA7GEkOirMSlk0zNL30dqc1h167XhheysptYrTBNUsixeHryjEWr3kgOQF+IhO12an1UWw6gy7VoCzvHZ7zlvgjJ2fTr/9Sumk6LE5Cbfvg== 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=urRnrj6bxi228fI8IxOOOVAlgxG/10ehav3USpJqRo/WaYm6DwSq9Ubq8mjZgebhEMyHWG2XlziKwFEXpAWQp9PhV3HRkhF+UIGuSOD5TVBeD66flN05OMjtlEfF0xZG4Bdeg9I3XFZoYjc1YtnuKskYD7gyymY2KXZLoBm7Bkk= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BLAPR10MB4834.namprd10.prod.outlook.com (2603:10b6:208:307::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:53:33 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53:33 +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 v3 06/35] hwmon: drivetemp: Convert to scsi_exec_req Date: Mon, 3 Oct 2022 12:52:52 -0500 Message-Id: <20221003175321.8040-7-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR11CA0003.namprd11.prod.outlook.com (2603:10b6:610:54::13) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|BLAPR10MB4834:EE_ X-MS-Office365-Filtering-Correlation-Id: 2cc21e7f-3493-46f5-ee21-08daa568302b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oAr9IClu6qz8b6PzEUJxe6g9Zn9FJILmPA2JB7eDFldNh4p5O8hvibU1jnZ62D4LQKRjfkc3AIC8reMWBgIgioUK6DoAQJ38ISbAnKFueuGHmPys0Gjxr0eR7Mg4ITOrROytlsPF/1zwu92ygW75mgg3V5aGAm1zH9Cj/0lF0N2XmIBTpLo1Ilj2CEf0fCFooCb3keZvfXXt1DNr6xisc7demcotkgTG8zph9wCrxrzV0CH+sRlGq0815ao79LDpOW2WIedFZwWUjOC9OlAgX0pLyS46xheus4E7ZQzL5qUgX+G4eQgZ3fLCU8efQDryZ+PSHX0caq4qQKaU/5k34SfmWV4eyGT9DPURy13fOkttu07mzN16GnxAoHwNc+cXMGJ9sbcDRG6APxsOOHAn47vjutmP4mTJGaAlt0mdKlmIKWmX4fdyMg1FMQVg/bud0yZVeEY3RTiTRAs/HrDxNeEG59aLKuoxfU0yZKTZCTt5l5vI7I0QdxU6cGbiC72Bsj0dQ6XLtVEqRUGh7CnUrCMl/ri2EBx0nb+kRbU71ByQdQLOEPb5yht7XLw2qIKIVsAGR0vh25zB6GybgI6PpgCcGafMXwUlaNdcb2W2sUWkou1sARm85tXtofAJ+SopCCAelnqngR09vpMUulrozrjH3GvAwBoJezc/15lVOk6CADT/GnBt/JG0S8epX+zYRAepbK7sMs7bnEPpotpQ8Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(346002)(376002)(136003)(39860400002)(451199015)(86362001)(83380400001)(38100700002)(186003)(41300700001)(8936002)(5660300002)(316002)(8676002)(66946007)(66556008)(66476007)(4326008)(6506007)(6666004)(107886003)(26005)(1076003)(2616005)(2906002)(6512007)(478600001)(6486002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lwFbPMERYniVHNu2yzntngLPrNUSMaufkygABFXLkvuC+QjiKqK87jm3BcPCC3QpaWnKiAxprDCAflTtaU4awnHZOTZY1T9Pt7zx0Om1mvJ8SH8u3I/zczZPBJV2yac2s8JXl6XEtRpufpl0gDER92ltTL0gGFFHOaKfdBQ0VdLnxbBSPbIgbdgFq47OPf139DP3JrCf9z2bZuUcjWUNwTHNHpLVChuMraE99U7rm4hdVEBpdv1fLhjf4rs90kNDEQN2u6OSBruLVBQXA/HkmmyIlGrnrMW1/hgHYdlZ4JhtndnTQBcVfZwWc92mzoQ4a9Bfci7z/H9/q1uOk75jjM+tEqk2mLyiAqXN00N/R2Ggwvsc2x9bRG9Bn4Uw3dcp15EBLB5blvCV6RWemeszq1MnKtrwAnwPahtacKZdwTGDBRK4sIlhhpFzRanBM87/t+HWgxF9ZTmQ6ZtT6tktCaLw4X7t/GUSzlG005OSM9q5r6CI1k9PGbU10wSHJQdUfxsIXzdaIdPPAEUvwAksR9Qm14obA/IPZe2Lm1eyiMW0l1u8Xylx/2zIaHLG17AQoflcTcvJZKQ2ANUFjwB6P/xOm3q0iXKbsQy8ORWtRYZX+nuYcBYYlMirEsX7Ojb2fQu73+vWa3r0M2HRnVvRHkCoZNhiHqHrrngvzThSKTEddA1WfIFG6HDc7jJnZxwEDcqVpQ4IGVfSZ4ysnUyc1UicHqGHuvvl2UbtYUbsLZk3P5ihVgLdcObC4t7/wvDPTkRjHXgMKULC8s1DF33kDxzKBuB45leoZrcX8KvLoxPzYXz0q8v1k4zcyVkq+r4t6terBK5zC4Q1FTdZRvDluBFBl2G/pPZQ7dYrNiaIxI5MvS/MVt1wdOiTuDbpbD9zv8VgYrHlfuxkgapntIdtAXM7QQfJaCSSmmHr9Nwih9bLVvQWfJQR4RD7dW/+TkLig0AUoPb3HCBRcqnrMlaFMizetrxxpjgJZECpoNeoMIpJqHWDhOvQmybC40+OHwrGWTUIqIf0okWGwcGQ8woAenCGOM48taVT++IWFCw28DAGkF4A3xpLMEGIb2kl7PDtsr2KzeuNi5aC11hBVs3ZA68/j643R34O5mL38tT5WWquzTk1+ZoE82sFt9GxSzH5vVBDXOMvlSYgBigPBDv01j0OT3uPcsRU49701MlGj1TBprgJCmhEyjHft7uQ+BKhy7Wmnf9VAol0HIqvM/azPz57dmgaq/8v1W5ApIZVtcjnAMjsyi1lr/vVy+UAHDmnlqThoMotkC9B7KyyBshid7hjY3SgvxCBXlQo2FwOoRgo3ild5STuUmc6fPyIFu0EnokWZpdaEZiXJYSb/q7BNbCoqrpo6nmmA65mT92RjDHDbdNni5iLYTn8gVAtlKkyS6SXDD/ChVTHOXFeD4XTuFiCuzb+Acdj2y0ydPqzp13B5pWozlhNcbJ/i5Bo7LL3T7tQP7hEiY/8v6xrgvciLtuY/GdGOytDk7sNJwqOdA448qOWd3KBCv9BSVjrqH3nnEOs5x0v2uNhGLl4jJbV1iU0hDcjMp/BBbzSRg4f1giHkbLJutij3/7kGhiotvbO8iQrpL9NNjNQ3JfAbisMWQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2cc21e7f-3493-46f5-ee21-08daa568302b X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:33.0963 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bnVA/kqOaHrZr/VZbUvC1iPIe5Jk2W9emJ6+5vMlUPYLNhDsrcfSNg32lqXbea4evBdQMbd9l9YwNB9Mbsgx8MVonlnh+kLruy/KsDlS5As= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB4834 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: OmRBoDSD8VxkSy2d2Iz2oqv6Kye4P3_j X-Proofpoint-ORIG-GUID: OmRBoDSD8VxkSy2d2Iz2oqv6Kye4P3_j Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is going to be removed. Convert to scsi_exec_req so we pass all args in a scsi_exec_args struct. Signed-off-by: Mike Christie Reviewed-by: Martin Wilck --- 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 Mon Oct 3 17:52:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612152 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 DE760C433F5 for ; Mon, 3 Oct 2022 17:54:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229906AbiJCRyY (ORCPT ); Mon, 3 Oct 2022 13:54:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229886AbiJCRyJ (ORCPT ); Mon, 3 Oct 2022 13:54:09 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C9663DBE8 for ; Mon, 3 Oct 2022 10:53:54 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 293GO9WG029401; Mon, 3 Oct 2022 17:53:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=0uwQRZH1MRoqoy4nw9Eu8xYJvyrGSqKaXBn86AHK1y4=; b=wg2N9txUYHGwPF35xX+qn3oqPmhN+gHNeVBSnKdpNfp/e9w5ZedRuoUdUaHpB+hynTu5 OCN3A0AbZuMFdNj8MwcJ4Pa2v5fwN6Xq7Zet97vfUa/Re0wjuglQTS4Yodm8p10ig/tw VDwnDlDN+Ko+hhlvYZn1Z6ljGrHeA2tKNKD9V1AZDec/7yb3+ss/sfcYGYyW8WOCZQGb yl6YiKIbXSAZel9BO/YAj1y0rhBzRHOfYtPOXufao8/uJxpElQBeJD2uvUvQeP0Ic3Cj bKfc4aVlWLjh/iQtIo9HetxkozHiGnONPSpRhKiBCv+6E23n0BAE2w7g8yuiyCTFelMC oA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxd5tc91r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:42 +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 293Hd0xj015519; Mon, 3 Oct 2022 17:53:42 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2046.outbound.protection.outlook.com [104.47.66.46]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc03g3m0-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O59wcvD7FF2g8vxx1aveqdhlKDjTzRPhDgu3VPVwUODHIq8ydXohuW1pM/Ug25rAdxMlDnDgjrbH9bREHCxDVq3ncDJPqwQrFIHovTAUWU4k5sTmFIzOxU8c6hSq6iMxFaoWoE4vfEEmMGAXT46Kh7BI4Fz75xnKAiS/ph6hildVuVuHJB+cPHbVpG8na0e5oNjyJTLxs/1Yu7Aw9TccSwznKuPvZkknyDdTIiT9oUn2fyzE0o8/CUXcmeWUxgi65EX3UbcITP/CznRziVGvkiX6BItHqKHk+JtGDodMkAPeyb2gcOSYx7jwXdXPf0n28nkJXqHybkp+gxoF3Hzjxg== 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=0uwQRZH1MRoqoy4nw9Eu8xYJvyrGSqKaXBn86AHK1y4=; b=RTYhhZShAh1KElgweSUhB5MuXl7JLqfTSCS3BXyNu+dW9udf+1P7r9edEE7eCwGgoK8tzZpB/OXV7G5Lo7otsDPqe57xxsqbCFxX9QjdchfONFqcZZDUJFci58zQ8weiFCskjhRuNFiM7P8qUgHTJksubHhBhOxwI2sJpDLmQXdzFOvC60BGOwU+kH6K+gnS/n46Vbo094eMAG6lim6pjwSZrRjq/hItNOOpmmhEc2ZxswIDyp/oVjzeQMHyw8yEHBZ2hhJP4NocqwIsgJEtbUb6exqHC4aeVhq/ip/QTkHqrpIl9sgTie2iXUL+gQJzKU4JVfGfWHXeGuRUx6A0lw== 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=0uwQRZH1MRoqoy4nw9Eu8xYJvyrGSqKaXBn86AHK1y4=; b=fWnYFuqR3pzAde6vKMw5NIgMERpnb6cVTT0RH+LZwJ7u+s3RbPxkpv6wu9d49Uk6vNglIB/tQjUS0MV0TTjkna+VCeJ2qBkqIlbHY7EIVNJJxHKWfHX2G4snNPHnPqa6ZIrzEdawQ5dzGRfTeFv2ikNtXdi2py0BJp8NvXXwGgA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BLAPR10MB4834.namprd10.prod.outlook.com (2603:10b6:208:307::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:53:34 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53: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 v3 07/35] scsi: ch: Convert to scsi_exec_req Date: Mon, 3 Oct 2022 12:52:53 -0500 Message-Id: <20221003175321.8040-8-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR03CA0017.namprd03.prod.outlook.com (2603:10b6:610:59::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_|BLAPR10MB4834:EE_ X-MS-Office365-Filtering-Correlation-Id: 35a139ae-36cc-48f0-b8b3-08daa56830fd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1tIT+BDTqYgrCTkVpQDoktn1JKFzxajQkT5KO250V+YPbkPVmaWIml3UDZ3cQlZSXalyHl7OZD/trPiqOLMJt8njtLHzJRbAKAEEZ4/uPsjdtPGgyTGXln13iTTd1w4s4kjZBENiFZRdaOcf+KeTc4C3VYjwrroIrPFifhrTgoj90hGDwWyC9Xiylg+QmalWt6X1g9OSTKJ/MjkPyoU8PnjPPxEFoKceiWmFTB9ZKpYnBZerlnV92DKDgle0di2teTG4+7rocJmDScLIMtdwWWUoZweCfo3yB5qyZ0DDGYSoWBAZhjxHBxrmEurTAF8198R8ObjidqxJQQeqM54mMO5xRWfc7444Bj5oM5Mux4Yn6D/Z8HtUV5yeP/zvQfX4FQUwE9kDhOszM2QZM2gJuAFA6+SA8IFhtrUYbOgGjtYA3OiGRizL1S18fy61oPKS1/Brabzy7Q46WJTd7IUHafs+pOF3CXcNzJ4JGuzI2HK0MdK/5h2hI/bkr5N5aff4pFCz+nLOnV6eyWlUfTB1rLsxhQOLW9Jnh6WH70P3PWNpD45q6FJyuBynHdlphCKI+j8D7Vr7ohqz0d6L3z1hcIHHtrJZeG6JuSOh1w6UJWATDPLC9sbiZeSPkKUb+AP+xnrQHIAZClodUnwOou870Dmq5DRWwTG7/lRwUw3XWuo4Kyfs8BIPaQL+dMIGP6Kh2GaXRplkP+ntP2dhrlA7tg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(346002)(376002)(136003)(39860400002)(451199015)(86362001)(83380400001)(38100700002)(186003)(41300700001)(8936002)(5660300002)(316002)(4744005)(8676002)(66946007)(66556008)(66476007)(4326008)(6506007)(6666004)(107886003)(26005)(1076003)(2616005)(2906002)(6512007)(478600001)(6486002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ThNzdEXEzU/aHtUZ0ngF5zDVahPXNALBUIQmW4MbLn4gJBEKO/uxKp/a4Dsnjw1aloH+3GIjR8oyt2e+7z8vGCMpOATZMUzyOevsruu8tbWbJXOt4fAkL1USpiuoreIV9ZbdOMdoi5lZ/VSGWH+4qSJfiFK4QTO9PnSx0vN89umhmNXfnfSK3kdnJ1NLM+Ebhh5H32cRnH/E3hPkkUbMDDjDr3eczqswfyoajypDYAXYlAAj15EvS+goaQag7SoTvVOSrN7Fa2zcRfH4sux/pLpr5Ac4Pyyjuk97uFWXerIadxhiITFFzp3lvadbtOzkGtQyy/mFmZZ+FsEHbH1746z4QidMS3xm+op+vNSiizwjnXka7HjduClUS9oywsvVXfnOYABv/EL4N7FMrYKJ7MqBirJm8x7Eed5OuuuNBYFtx0GCuYXntrIfBsy2Wf252vNtsDuGDf5/pxsCHK+7YK7/OxhHQcRxzjszucYscy4++EJN8j8LobwP3WQTGUD59+x+3rgIDc1mpOmLqBmBcfzeBG8LizOFXottfIDks2c8I/U40CsKPea5+LIhhhT47e/n0Va1IfNTF4urSxTWKUJGQ4e+P36MPinAqFKRPbz6Eb1be7gV70zHthBLr8XdpHuNJWY6rdhdwpdhGI7Zsd7EHPi9xEcsvkRhIRB1m3f+T+7pM3Tce5gaaBdoGWM2sMF8sVkltTSZu46lo6jzD6t6vORy+tAxlI4bsS1HqiTnmjGnxiHOfKU1Dh3h8I5xzDdhhnPuBaDWk4oNaWZG9sRGNsBQi7ipM9x6pUkiJ4S+UR6NmQTcMxH130RhPUDBa+7qoPayz4NQmn1LmAPmnvlEtm1cXX/5zHIjxY3diq9IpuOtHGQohF+HhoEdnVhDu+CIVUjYLKFngmjyblRlpRMupywF7AA2w8s46WFqwASc3qkUiky98bKs+e7yK369A7CXt9gjHYWlW/4w5RHUqlyUzTljgp1fGabm5fBHnbpGU4AbstFVdWel57yPwZlqyUEHwsJ3QQY/tCLGJIzTtGPXEyKEYyxOJi79BqTVNaIY/VYuAZLVhWZgmMoe8/3Mb3BCb/8TatNaO19mD8HOUws8EOr0cwZgyC963LZLJcuXQNQPVQsKMcpQInkj01hxCOH6M3mikD0np3PpyCSl/UiuDBTzpSOMtrOfVo1BSpJ6Tj+G92jXf6FLikgzX19UDjzq8pFrK0mmIbwrTxK2fz8C3CPnfAynbCwfL0TDsV7hke556XxI5nKIUQA2ZCuQH/WBSHTxFk3zrs+ibwANpLdeJdjAn/0APUwdXR09uWj0FPCqTl3kCbprqdmNY7iQlB5Ta9gV/vXO0vn0QDyGHtj9HYecyk4NPZcYbnEnDk47AikG68jRwO2GQx/1njERcRsN5yYJH28aYIU1R08ZSCsxu/7i1i4Gs+D637Uyl0coEwBLdyM6TY2DoJiS14zldauJu/H2lUHTELo3PEX6hZkyaGr3U363tU2GWSgA5Kc6McuRZdXlsJ4mjoYqLTHSC4cM9/p3XtnDEkgsp0mhhw9HMBHyhQPit9ul82kEiA4zoOGfG3+bF1Fb5JJjdWZOMyRvZF+jDZeVse3DQgE58Q== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 35a139ae-36cc-48f0-b8b3-08daa56830fd X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:34.4400 (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: ZmLvJC8BuJiETnXtHCDsB2o4S4NAeTfgjnGIEQNqn2B0XcaYCES7JP0C7ufG7FwWar7qWXMFXKOLljBAf5e/vyqkug45SH0koyAgzSR8Sp0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB4834 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-ORIG-GUID: VNGsNdyiSTsD6v3tBgfVPP70q2sPWkxb X-Proofpoint-GUID: VNGsNdyiSTsD6v3tBgfVPP70q2sPWkxb 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 Mon Oct 3 17:52:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612515 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 B9236C433F5 for ; Mon, 3 Oct 2022 17:54:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229867AbiJCRx7 (ORCPT ); Mon, 3 Oct 2022 13:53:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229815AbiJCRxv (ORCPT ); Mon, 3 Oct 2022 13:53:51 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08D9436DF9 for ; Mon, 3 Oct 2022 10:53:49 -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 293GODGP015434; Mon, 3 Oct 2022 17:53:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=IW0dMrPTpp6b6jKffX1ZsG6XTvsN4xd7DFp4ZVSxR7w=; b=AEFhdgNoOWIRqD/YAPrRpg8cNJLaiRh+OJ5pSS3AVGCNbUNdN5/LEpgKWeaaMZ+7LDCq c0oVrVLUw9gILmm1LFvTe6q1rymnBORTv1Sbnnoz4a1D14W1G+nZxiqBUMZ0C+0oIMbb Yu5gw5zyeLyuwRd6TPNDRelEQQ1dhcCumOCvm/bwIStt3OpwJVT7UhgKKsc0ejAEgcqL zmpo7jvh/tQ6KiLCgI+BWMkkVGwfAVXuXET6UEbhaQ+w5qeqypKyvlg4cKBM/XN0t7oG CF3J7eD7LlB4HPh80Bj79aPfNpgSzCnBqqo6nPQsSlFE3DQ9tRvfQPYeA0viOeO0mnlw Uw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxcb2mbkv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:43 +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 293Hd0xk015519; Mon, 3 Oct 2022 17:53:42 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2046.outbound.protection.outlook.com [104.47.66.46]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc03g3m0-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D0xDdA4nAGJ9mOZvLLo3NltWchO6Q8i1YyOYlDg9q9IBMVmEGlIoOPfg1z8fhbcChrd6hy0Qw0QG1l2ZYXqmXawkls4T2cfG4YejYeaDOwN0FFHdLDqOS7qzndV73TbtwK++kQnMMf451n4wnD7C712YII0Q3Kp1YY2D+uq3xhXOcxXV8vntH8OZLdvuQkzJL1srZT+ySCPg+wge0YYNI0vMR1xjaGakiHbQ4EomMgBw93bX7ZRtL9YvDW39/ejVsGVlEN5B0t+M09yVlsVzyQicgyxyCMso3AMzleoAh2lSVzM6q5oLObkleXZAgKwYE8LbndlgZC69bDBftOonjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IW0dMrPTpp6b6jKffX1ZsG6XTvsN4xd7DFp4ZVSxR7w=; b=fkJ4vKJBVtTyxVmhW+c2aAlXBwrrraWj4znLWxlbRDzE/MPOxjM7dWrZ2mfjTawxtES4WHozrf6o9IMfWoyIZ9wueY7hSibh/K/fmiQXofYNYisq3lrhbeu7skdXxa1ttPMVQPj8phsOuk9NFGMqZC+1tJ4EvvH4P25dfVaRkb+R4NWhzwb40azr8tfxhELQwfH77uEQru7kb8Upjmti0OJYg4q/YExBvxZltpwsXH45wI6c+/2USZsL5SRW+CQj1/G0Ice6mU216WsnfCoE3s4iR7mOFKlfOsTcHUuKXQ5CeX7Dl18aKhei6oAZOugMmULaBQr08MrcYYclCZ+5tA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IW0dMrPTpp6b6jKffX1ZsG6XTvsN4xd7DFp4ZVSxR7w=; b=MAkU1ZnstK0BstGbo1GpZY37F86Y3i5eP3advP7kBO03P/Z4Y2xcR6c/2bRzO9oReVGwk1x5HErnAqR6Ci8hR6cOtgSx82hJf7oVXPRR2vZxxpwUQisEGwpPic72x52mH2tUfd0biGxOP+YLSMfQx6bqEdOP7g4sy0CQkdfQZJw= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BLAPR10MB4834.namprd10.prod.outlook.com (2603:10b6:208:307::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:53:36 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53: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 v3 08/35] scsi: scsi_dh: Convert to scsi_exec_req Date: Mon, 3 Oct 2022 12:52:54 -0500 Message-Id: <20221003175321.8040-9-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR16CA0002.namprd16.prod.outlook.com (2603:10b6:610:50::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_|BLAPR10MB4834:EE_ X-MS-Office365-Filtering-Correlation-Id: a84ab6ab-5bab-4015-e59b-08daa56831d1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DtkzwZd3ue+BYE6qBaUPN/vpl77Q/AUyA68liqK7FKz4L0WpnBIVFDE2fDvtQKJbBgEwTw0PaABRTFc1759Oymk3Q32oCwBzYhD3Yy/POuttzYwVL3/wamRDqH/dCXaE9rhquGKfLRTTjOjKoHM3RajDtgKboCRFLzE/1rXV8XBt+AMPPGXNDP81c07L1FplElLX+25DqJLeSDsZ7qYSeqWfObgXq8gNGRj6jlqZnik3IMPQ32o8C9lrj2gt062Ia+UWD+yrkQSchF7TiezwnHCyoSQ1ayFUW/b5dYGRfmv2TfDqe9hJOq3IO9cfbNCsFfa7jMt0B+WU/TkGrJco2bHR3Ker4KyzSOXj7VPKDmThyeep3zjAEG5d8i47c59TDX9jMCD1P2voFX1ciw+KvjfmyTOJnKhGMQ3GxnFK5k94FM8B2wLKdkHLDd0/z3sFP6FpZqbeFsflYN4SMkIe471mvUsDeGfnmr37OjWodvTkpOTYj28T2+MQo+cpmVqwDJ9VxbnhwZPRTn3XFHFruOv/cs+XQ1frW+WZDJQdmuB5Inwz30pit3C8dRGI2baTH3rqh2cZwu+fpOSObjwziEH1U1d98cPMQ8sK/hALeT8euPSUNEBO45WxGrIZzKeVV1flPfFhvBxLg7GC0LDVASd1a2/mk54DjTFnUm3ndZ8WCi59Uqzuvi0+HPs6txSQnFENh6Bk8gYEbQQHcqel9A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(346002)(376002)(136003)(39860400002)(451199015)(86362001)(83380400001)(38100700002)(186003)(41300700001)(8936002)(5660300002)(316002)(8676002)(66946007)(66556008)(66476007)(4326008)(6506007)(6666004)(107886003)(26005)(1076003)(2616005)(2906002)(6512007)(478600001)(6486002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2jt68+QTeUqHpUdt1WTuAkdCZEyxe0LOjC0MG5+rO+ep49/tmP+gZw/GHwTT1lq4EL8d4iZDM14QirrcmsWBkUaAjeBFSEwcK3uxbIAgvkZGQnOSapH35uC6o1ZwL4swE51rXrPKZECicQ07Z7cCZJO3TFeQJhh5YDcwzYcho+wzVwMu/TSLX/KE5WxaOzeZZVYGur0IhQUmM+c+bs0USelnbmiHDIVuvf480/KR5qdGYbKd5q15rKJCSQTUeIjUIL5pB92tASndB0rEHMggcxGbT4wi5cL5x2CjJoGXsV9wKj4uVlh89FevRbqKXWN3CA8pO9LVWUsxFvQwL6I6YrUsOGMCGIxTxgCRDkzo/wijgN6h66IlQQZBCiHkgRjAseZxKW9/CgNgqIkto8zgt8Bt7gaqkiwDf+HHLFLZ3TaXHIIym5tJI3jr2bqHWjQq/UOfhfgWx9AqtcB+l42dtxHZJZfmIMJatGmIjhWoj3/fL1z4+tffXX4zsbVvZqE6uYod4kCCzbPaYdekVUiatwoqjG/qHc/WIFO4gHTWBtqx78vZLLFtxXb3V41fGQ6D1Gvoi73uERpw64OLdMxiZ4A/XBi1iRzWOhWG9FIrOyxcOKwzNdoUsTfHxhyDddSQWUts5VRFrd1PFCWXLrjlRI6c/CDhcvfyq72gCb3oZR4PV2yIq3x4WtCMNP5ZHALMXZi/wsAEfc8NIx3KmCb6ohWM5ambAoeqmuKGntpS8sw8DLoLMjzK9asgRkObtGa8oa8ecEKCZQ5Xz6kGMAkvEqtCgFvOLeeDjzNIT3i9RfCj9qCQtBuVlJf2KK7kSWCwuN+xMoWyOey0AZpbGwjXgrx98/dVrX4anA7TB3hLhcI78bguVllKJkbV5PI9bHNnlRWY5d7b9SUz+uCtdISOhfhYemwtOkx2jSy6sh3lseaR9QhUOaeVOuah7x+PrvZkhswsNMndnK+YfjWyBpQ+SQUY+mfU9x4GqVDBAGWrur11mmX4EKwfEh0dWFgP0aqv+IAMaHoEspxt/XqAd/FMaalmlBpMfYIM/ulWgBmo5s8VvQ+1teXRXfaP9ctrIru2WIc1jbYiZmErD95ehVM77J72BaTgPVA4af5LWuXlMFsMRP7PxVqMz3WPt29OtXbwI+/xoSte2JzfxapfZev36SgusbesnYzX3zejZQKsjz/PPcZCN++5QaxpKo7BQ/kObgS9EHf0hDf9F/5kLrONNsfaqW+59lx5SrVbAU14hNqifko3IbmIbied/H22dsc+8BG01uWYxp7Sg2+HP9rsOeNCP1gEuDo7BSHVMcLx2rjtg7AEqeHso0+BntsOPaeMADk/AMq6gVeNuxcOc1/t9SWatDyLrBoKo4AXcmM+chdsJcesQWhsigcJqMrLZl76eS6/TOFz6KjeQn9VJzizOVtW0jQUbAvenJswHMQs+x83kLAQCzH738BfTP0aRYpn6Yv3U4lGFVXfk5g1+SchDXPmMOlVwsxm2bMpwspL3CFbvwEmilbIyAL2+0RhJiN3I0yplMBazGr8dDeOXT+lgYvyH3pe+87L8SQVZ9Wc3GCcHDlvpchukBebaGnw/3HyljHCgpNKqkOE7UgzAYmv0g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a84ab6ab-5bab-4015-e59b-08daa56831d1 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:35.8773 (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: ZSR6KxHYBPnXG/EqAmzb+o+XdJ/y2aIc9TMLlnE8XR5fCnbvJ/x49yJP8wAuF4dIssvk/+0GnYXYHfVSdbn/eqzSpojT3mK5RQLtdk7+2eM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB4834 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: QfCkBhfp4yhV-LLbwLxNJCzuwqnMDyJT X-Proofpoint-ORIG-GUID: QfCkBhfp4yhV-LLbwLxNJCzuwqnMDyJT 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 Mon Oct 3 17:52:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612513 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 D4458C433F5 for ; Mon, 3 Oct 2022 17:54:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229884AbiJCRy3 (ORCPT ); Mon, 3 Oct 2022 13:54:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229882AbiJCRyJ (ORCPT ); Mon, 3 Oct 2022 13:54:09 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 775EF3D5BC for ; Mon, 3 Oct 2022 10:53: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 293GOIcu006279; Mon, 3 Oct 2022 17:53:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=PUx6rqGj9Rtobn8tQlQI4sSQVmc5HfGpS9S8mQbe93o=; b=kps/wElJkOyf0sCU6GFVs5z5Wy56niaKAZUSNc8EO1YnHn0GdC7LeIwIedW88KaffWJQ 824PjR0zl3qUwZY2/1NjSImVSFcjHDvl/zziSYT6NPpxs56zdFHUPOXRe9fkJicP/YZ2 q8w17UhTDVVJri/RvfJm83Bo5K0sj+lfjjqX23My0b6JQN49gnEldh4iRaqvnSgVqFo/ cUrYlyG8TtrGOPXa+APnMxdZCijohfSI0ZnNJdTSZLnzwHKJy81D+bi6T/WBIeZ8TxeV tu85Aq72cQlI4lg1xohVHR/QhimvYjjObNQi2LMQiwgwsx4COfhe3+Skyh0sfepD/oj3 3g== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxbyn48t8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:44 +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 293Hd0xl015519; Mon, 3 Oct 2022 17:53:43 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2046.outbound.protection.outlook.com [104.47.66.46]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc03g3m0-7 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RxY0i7gTTJNv+OIEvLqT4OJk7oYQijzMoIi7wsGi4UQPFYZ25PideLe9NLUDmIbhfqcHhUCxPY3y/V9nuBvCX4jaIQICmesvrbUaM96gd/uj7vA8qKknMVKLFwSKCptqcmadem9Wrv39OAvkJIlRKzRyPc/0SyDpAzAbkrpeEAPCm7+kCSViNdGp4BaS0zoq+/XWEfViG5z6neL/2XQ8cn7tfiRrr5ofgwGgKGHGxR03Wb+w3VL62mYduOBvXeLbI41qzbcZIZMZh4bpl3xGK/3YDzTKRazHPHYInw4O7D/tZPzAwsmzJXWeyPCFFqN4P+bfvIP8EggliScN1Z0l4g== 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=PUx6rqGj9Rtobn8tQlQI4sSQVmc5HfGpS9S8mQbe93o=; b=nNyE7jcXF9PC3y+I2nCc/9p9w9Gl8hSvPsWUuaHMhJxnKCyTnmVBSmnRcO+UeF/doVSI1pLoBRxKZUovzgfFNNWkPuul/cKIKwRBrrdbu/+ciSGcUwUrBt45tn9YCZqw6VHjl2dh+Q40lCgrxyVxbdhZRBL1uhtVbvwpFA4e7NM4FBfZvFZsc6mtrMbwMyAV5PAXr3C3IsX4Adf62DBVGF1ztcAVHKPefGAcxmliKpZoN6aTM+KF/lARmaQxxNEr/3BhDV4AAkj9SzWxQvSt6uLazrsB+pUX9NJDANUhmSHFV2v5Dk5lD3x9Z/DLUSqb4RxVQbfFXJQMrh9ySW3IWA== 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=PUx6rqGj9Rtobn8tQlQI4sSQVmc5HfGpS9S8mQbe93o=; b=WWM0k/Ox3dDq52u8kqt5UqyedY030Yp1dQqkdxRceln1w5tbfLQoGeYMv5zzxU85bxIu32Baoj2Zkb7SXa/Bxs5/U7yfXye3YkdtOjQq4d/9SNv3+YYpw1DJuo1ba0y0JVZdiAJF3sZ8PPAOzw0Fdl2kfVJTCcVC0gsxy7E469c= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BLAPR10MB4834.namprd10.prod.outlook.com (2603:10b6:208:307::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:53:37 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53: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 v3 09/35] scsi: core: Convert to scsi_exec_req Date: Mon, 3 Oct 2022 12:52:55 -0500 Message-Id: <20221003175321.8040-10-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR03CA0020.namprd03.prod.outlook.com (2603:10b6:610:59::30) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|BLAPR10MB4834:EE_ X-MS-Office365-Filtering-Correlation-Id: 09213e44-4779-4073-fdf6-08daa56832b1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z69DugpGxTeplIznFUD5sHp/0Z1HR2Ru2P9tX0wanH87mCdXF2jdJngaTacmDInWv5V3UYuu2Sx/Pdw5hrUczBkDQiVsk2yjGcPRIYky8zqfk0HJB2TTFDjP+Fz9IgjhoXfBwFiOvd/G1aC25tRD659w2QokATjS36M5dOD53/VqE7HxqooDwhCei0CNPh9GN70fWbCIl4xJZF9ictO194udGy88rbo3Aau9Z+QoLePrfp1MN9Gw20QhgCr7ZM1md9ZXag/mCafI2Tg7Sd13TKJDrbLQYOzrkjKoMJt5luZd17rLzokhXi/YNWfFUxQq+eL8QXmFnGRgiy8VhxLdv29z8jiC2qT6L4vdiIrYYN9IGnsMxqWV1CHDEwMafb9y3xRc+SyVBtXvSHK2WG7gqg28OmCqio6C8So/th3aztdCZ6iNDRnrEX+sCvsRJGzfYQtvEWae6qi9mMlfheGvz78Li+DyApBx+OBemsCYt+yzxCBke7u6n8j98RrDMDFy6aOYK8S0rJTue0nmMnYfAPYT13FfG23xlK4iZnb+WgXN+g449fHirfhOQA++8qB5XquTviaBjmx64Xh1/HvrUkIzIrok29VmjpidiyBuBvfj/Ct2ehB9xbwYmh9P5hhwaVlHdFMaEL+q+OcaaVr6hSsH53CYvNhN/TEJ+j7uJlO6SO0xKXor05LyvjN8Z3A0AAQPyZAS+heXgtbPg9ykhg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(346002)(376002)(136003)(39860400002)(451199015)(86362001)(83380400001)(38100700002)(186003)(41300700001)(8936002)(5660300002)(316002)(8676002)(66946007)(66556008)(66476007)(4326008)(6506007)(6666004)(107886003)(26005)(1076003)(2616005)(2906002)(6512007)(478600001)(6486002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1owXNJqhIVbpSMtdwfj7o1wzpEoBRlRbwToWI+kbwWURzyYQYw79YPj95v4JxQ3l5KcyzihIP/XVzalUtag8InSdfaaJ0Vd/IEtpYYAZh62ExpboQyuN3t1IE3WFwavqFVuyQcIcNlIg2dzTmtqdKFOaiyDEfWC657ZUntP0xSX+ecRiFmqI9CHyOTybq1mGAwypaNbwsHOCRfu6LlIHTQdxA9RZet8MqdvHqt9H64ssoQIcHj9pXrLzwHfBpI3m0YPaBYpNiSgU8vSgSeeNd02j+GNwMMmozGXscCikxNk+WCLAEuHghcDKcx1QzFtmNXpo2mUmDje8o4Feypen41mV1fvCA5Q9ybs4HtYSom7+c3uYYFlfC9nHB13wdDS4k7BYKVVW9WSeELC4NSQW5F87vUeWGC609hUZhukoNHbh6UIPOVIBp4omIMii+tCV59RF+lHOdswR4CRJGilU0gGYHI8ttdTsLn1BPkcWoua5Uf/0631N/6kGvPr9GK/9BIxIqQYry/kEBO2jbRDlbwmgmWEgBkm0t05mzvWeBf655nuZZJyqOSFoniM8RPNkNPOqwX3aJxoavW8p5J18ML9F3Cziu2eETsXooKjGZTWvqAPPX7CkuCxPexGCIB6ONh2s3CPfOabrsEbrfuKjA0jr2wijTbMXd3W/gKYuO41mKxd2R4G7lmWQgK3byLoPH4sY1UzN5miNZwdl1n1Mv2sQMgZqegs7kZ+RY+grIdXqSi/OEZZ/OQ3YuiUCf23GU1Rq4FbXG5AiLv5HfWMwarEjRW17a8GGTOBNXQh21GvK5Sl2JE5x1og2+NDOVKJU34p5Bs4DRVt3LCArwXgUQJA+TbVM1fRbMO1m4Vc8uvnSQH+lIZKw0O+6bwMIB/5mDlNjP9JownLjWBmZJUBBqMIG59k+V//q3jY4yFXm9TyFZjyL3NuI+bQ/fvHCYoZ9mveKbh/9LazD5abRIr7o9IZHpW74md2vh1TxUFVxamqXIsrecCAjTxy1sgvnGhUt7kqJKBnJu9VZvpc3qJbkEknOkvRpxWRdUaBa3Ou8ANAb8prWjfwEjnpqgW6sm4P42aZ3U+Z2F48yJXLjhi9FPtkgC2S5rFA9oJtXTFi6FzJuCO870ujphUOFVpxclY7aEBC6I5QqI6m1fgxo0QUQxeF1sCPTcJssbchFzbZ9MhfkpDdV4zla84dA8dqWabZw8+elQd+4sORzB7VH2eFFwzc45WHgWJ2NfNmQLeyKjmiRKJ5dQMKJpdQIwEXoTAnnjGjPWgSRF0xGqE75HHye+RUntCZP5AQo3WR5TdbCUCCmUS/lUwf4sGD07ZAGH9xtECicqjGVaxF4rGsQeeXEty17nAhGxHA/M8RJZ4o++S/O8UMtW/4AgvyowFhkOt3S6LWxZylS2N4bIy7Q6/ThgV65DvJ9AexEroPKw2NUUf5who9uHcSw+thNoA1uNmf+80GBQwKFlrRvEhiACfzvRWvYHr3oXFwwXokykxzMo5PEbzdfd2GVQFEA/V5kem1Z4SaX99msMfYW/P/Lz5UqAsG/ov5zodyqQuyzk/GgeyvedCFv2pglPoVNb64NIh9JPxOOWGLjYidOkcZeAfnB5Q== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 09213e44-4779-4073-fdf6-08daa56832b1 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:37.3928 (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: 2FuOycf+7sBr/k9OyN7HQtwFtYx9CnBiBZkFwMXbz26qnZXmMyUGJV37pbOnOUh+3DUGRnvvbHagCAJIlJ99V/15a2WtNkv0jkHZJIiesjo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB4834 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: RGYUFNYkDG1BTc7BT9Q3ZU2hPnU6a_OP X-Proofpoint-ORIG-GUID: RGYUFNYkDG1BTc7BT9Q3ZU2hPnU6a_OP 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 --- drivers/scsi/scsi.c | 21 +++++++++++++++++---- drivers/scsi/scsi_ioctl.c | 9 +++++++-- drivers/scsi/scsi_lib.c | 31 +++++++++++++++++++++++++------ drivers/scsi/scsi_scan.c | 37 ++++++++++++++++++++++++++++--------- 4 files changed, 77 insertions(+), 21 deletions(-) diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index c59eac7a32f2..8d8090c8fb05 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -309,8 +309,14 @@ static int scsi_vpd_inquiry(struct scsi_device *sdev, unsigned char *buffer, * I'm not convinced we need to try quite this hard to get VPD, but * all the existing users tried this hard. */ - result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer, - len, NULL, 30 * HZ, 3, NULL); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = buffer, + .buf_len = len, + .timeout = 30 * HZ, + .retries = 3 })); if (result) return -EIO; @@ -531,8 +537,15 @@ int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer, put_unaligned_be32(request_len, &cmd[6]); memset(buffer, 0, len); - result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer, - request_len, &sshdr, 30 * HZ, 3, NULL); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = buffer, + .buf_len = request_len, + .sshdr = &sshdr, + .timeout = 30 * HZ, + .retries = 3 })); if (result < 0) return result; diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c index 729e309e6034..5708af4485bb 100644 --- a/drivers/scsi/scsi_ioctl.c +++ b/drivers/scsi/scsi_ioctl.c @@ -73,8 +73,13 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd, SCSI_LOG_IOCTL(1, sdev_printk(KERN_INFO, sdev, "Trying ioctl with scsi command %d\n", *cmd)); - result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0, - &sshdr, timeout, retries, NULL); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = DMA_NONE, + .sshdr = &sshdr, + .timeout = timeout, + .retries = retries })); SCSI_LOG_IOCTL(2, sdev_printk(KERN_INFO, sdev, "Ioctl returned 0x%x\n", result)); diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 685f2245d222..2f36b65fe0f1 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 Mon Oct 3 17:52:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612508 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 05801C433FE for ; Mon, 3 Oct 2022 17:56:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229948AbiJCR4L (ORCPT ); Mon, 3 Oct 2022 13:56:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229907AbiJCRy6 (ORCPT ); Mon, 3 Oct 2022 13:54:58 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C57636DC1 for ; Mon, 3 Oct 2022 10:54:23 -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 293GODek015444; Mon, 3 Oct 2022 17:53:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=1gJGGD09wn4XgCupqSgJ8AtiebueNWGHQUweI6zfebk=; b=LzkWkregXJAwKiydI+FNmmwu4pm1YSR5IEj8YNh9iAgRjOMHyEr7SBADETKZAU9hTHa1 N7RudgZynCkR6FNZnzCLUpUcmFJKECVCCB+jX5dIbCtZbf7n9fYpR1obmTVSEOW13W1V 1hkd6eh94vB93dmdKgP5u4H3sIi9VqAVPqqlMaJVRHBO+0gRyVqpLT9Iq8Li3tOL43Ru KUh1gz1JJUipaDtvmL+Cf10sFmr6vGeIil1Hxum8KoBwM9/o0UJRftbrz3iEjZzyTBl8 bJ5HRq+bPvsKxa0evw0C8FliWwb5G6h6iLbqNhfJ20EYvifJlMMBbPsbxLbuyM6F9Iob pA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxcb2mbkw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:44 +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 293Hd0xm015519; Mon, 3 Oct 2022 17:53:44 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2046.outbound.protection.outlook.com [104.47.66.46]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc03g3m0-8 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GNi2UO46Kt3TlFnuIA2WEn/464C2S9o3/WWE104YeMXO5e4qo0eY4+o34Jql4iDNihJABXAjbEmbWaEHWgWhEfAxTaTOK/cUK39coMYDLjsvStY5YqgPFr9FrbzEIqRKBIfnneLGgWR7LcVgm1tACcx+wK9jM64+KRZVDkUY4vR6aSCHv5xSbkjPdhkxlyD64alaZanxS8oMRhq0ofvpE1N2qYviQIOJYm659BfSwxhzLzzVd3ZvrVgAz5qY6UeBwMHj6cJbOFJV8X3BkJNViIir0hW+T5KiAdmSJPUQ0KhHq/asH62WNFh9f6RGrqLAaNWemPUVkV51TN1qPL2XBA== 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=1gJGGD09wn4XgCupqSgJ8AtiebueNWGHQUweI6zfebk=; b=jfORDbS7OBlGtr13hdXjBhGtrz9L2Lui9D0TQTw182KjbO4IEzKjSiJALU5LKMf0VTk47cFst3/7etNO06AnF2pG0PKFRP2nSETwt+pV2kb41s3375u+YiX3liPwUhmZWKHnmPM9FO578WXRyCjn9MkTC5prIPDywEXbnMig1QDVSN7Eixj04ocQ75gGvnjQcSXWuaf/L4M2+vXwH2LLgUmFHRAhSPR3U/fHF+4GxNaqj+Y6NkaIfdFdp7Gj8+GYlK8YdkNVFwVT32btghpVpNcKAARXnN1ZY2mgnPSwOtIH0I8vODzE0+TjlyGFLEUGXk1ciMhAN5F4HceaiLP0/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1gJGGD09wn4XgCupqSgJ8AtiebueNWGHQUweI6zfebk=; b=gCTs70ammE+sWOLDtxXZz6PCekO+UElhPZEiogyzfALqcyWMNJCbApe1U4YplPpzs1+2RFFFhIxSV8SP+hSthKZDJ+4WealMXzc2SkmY1yW43nh+fgwxEZx9qhQGDe1IRv3evqBrUUhoRW8XIljXIfYervCPcyNHIeZUG2I5Q1U= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BLAPR10MB4834.namprd10.prod.outlook.com (2603:10b6:208:307::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:53:38 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53:38 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v3 10/35] scsi: spi: Convert to scsi_exec_req Date: Mon, 3 Oct 2022 12:52:56 -0500 Message-Id: <20221003175321.8040-11-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR16CA0012.namprd16.prod.outlook.com (2603:10b6:610:50::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_|BLAPR10MB4834:EE_ X-MS-Office365-Filtering-Correlation-Id: 215661db-7539-41f8-9f8c-08daa568339b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FXput5dN5cAjMDaZtyPCgAL7M6VOG1FzjtiQGoI1SfqpwWnV5adZt5eouMFCuoqsNLjINRwuOnYasxhA8JxjuSc2vKbbhafWR1mTBBcDbkzlZPxMUrpOGy61OnX4CWQ+BbeKUow9q3mxn2ED6AmRWaWwwn46TEc6Uco6n0TEp8S5R5Vd6byRvoh3chFAB0K1DTWDTlFRG+/kY6llydUUJVImjOdcT7COy7809bN1Ue6gxEgZJ23G4aYS7EWpRljoVa/i9O7Bpb17bW+nsso7h/6VRBxxEtO+uiojZjicfzCPiMQ90tTLfsn93pyoQO7fTd2Z/UonzIEiBtkmsTnbo/pUEfc3+/xsWjwI5xSsPhJ3FFZSQOaTmaCOgbEHNf3bDYYZgeaLOjOrcmuJq8zjh0gzmuzdCZoPMhMJaS+5cgSbwZrPvQq2jT5r7xYrhram6i/C+fsZGvmG+4H4fk6QYsXT7BRWyL1/4AfkeWb4iNdwv1pbMoFNyRAKZLyu0d5W/iCh2RmpV5tFcp6EcD7TdwGPi8XNwCCQVPsX/nWknoYA6u/mDddheMnXxk2g1wKbzUHZ1Xxjfhm6i8870PD4KnARqFBMBFhU4rewsbTuBNELWN8I1jfwWpcJmMHnYHrVjDlWMpR4R1i2WFsbhw4vBFkJIWAkPHhAavCham7700fJFM2teL2x6FBV6ij/p66dIaoRbCY8BK6ccPsw0d8APw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(346002)(376002)(136003)(39860400002)(451199015)(86362001)(83380400001)(38100700002)(186003)(41300700001)(8936002)(5660300002)(316002)(8676002)(66946007)(66556008)(66476007)(4326008)(6506007)(6666004)(107886003)(26005)(1076003)(2616005)(2906002)(6512007)(478600001)(6486002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xSZ/uvmqYXNKGj55obArp0dTKvKR4b+TMI2Kb28xMK7OTB50S3HxRJZvYUl5nYubKESAyavWVJ1qYy1Xw5L6S0R7IDpWvpUFLriy/QX1/Ih9g4FYOF231tPTqta2nzbyhVVn04tl3wsGNFMsV5bRfT/FJRAYhbSrQLRO73hYml7qownrQrrJXZIbI1p/7Xt1e7lb1qCQeyGeLEyGoq9UB3LG+773WtZLRQurNQJNRSbdkpyXyi+F8Q6unqZDD5hchlmp8lIeGbbBYmfwSANhT3lsc2js9QRzsN60l/Y4n+JTLbIRClIKOyt5XxzR5gHNnGOQ1LY3tMQqlMIlx30MP0bnwUh6vy5jqQiW+NUwQlQ8nVEYNdEA5Jrhfh0UxMKVtmcyLlU3xIOTBbsn+u/WJvWulaQzBAuNK9WxuEFSpA0aTR8+k6M+zV9FBQt4DC6sKSLCvHiqsItaUKG7gTS8oNvuBjxmNFflw90Vc3jYW7T2ALUdJWiCsLnoixAgEloCcAumbSNW7u3OJKj+YQEYV06nYGos77YLtQEfNFvYOg5Hy1cnmH+hzHrZ1c/urd2TSAVGvQe/nQyJAgHjGIlh0snwYl8DwT2sSU0yesmC0ec29/atQfiFej5+rCIwnDpCd283agSO0wWyFqSuM1kg1bfvHqEYUG7q2pZ2e3w9zF0JibEKg5OwGlGjAiKg50wzbIAJQDOeR7T5/P7CtlplHtIZIL5zWWjNaaHZDMZpkQqfIplJTTDjXnOZU7bmOhNK/n62gwKlrd8U+nkyte56ZKZVRCsEy6YuvC6tB3gRLV2ME6UOM8Pf4r/AwxmhhLdVTTn06aybXSxN2eNvDOzm11HvFen6Z5ST7M50pTyo5PcRX6vqkPIZ5pxARbH8QDjkARQveZbQWidKFKK1QyrTzj/q5/Uj1B6nmm40MkTSYuhoe9IJbrl6KZYUtpCgvRQaZ50pLdFhxF8JrqNeDXMc3plIqdYDcAp/Jh5jhZ8X7eRuF2PZBl73vvk9UDIUz2JM97dX23A1M4BgkkoE7XkSSn2HjBmDYYJDe3N1Qx1azT+fBGgOTcqrZZYgfDRUGJaGGFWhjy9N/VnouuT41DyyfxGtg0iNn3p3kH4aUEznQ3a1UF3GECNFz/lqSYUJsHM0GtSWfKAG+Ta4uyxcacI8sS8Of9bMG2uYUN+aVsWke96geuRWa9l5QNNCdB7VkAzQBCK08UMq9X7XFd44m6ck6RLvnZYr8kraRN9URj5442aUIflu/sLao7nrfN0M4+TeEz+CovOSlaMxTq4PgyuBF0adh6PYgLMMtWvG5v/x/dtvNh1MCEc2U67WW4yv5NNbxvygSnpNDR2OYg2YgxuadGV3J8TXscJVH0zoiJ5mTPGlou3kDB6u7F39qMWA00Xwe/VqbUcwl+N7ahfnoTwEdbjurLfD13VyodzMHnjroN6BLjg6Az+n8AVcV6Kv/1C0Sp9Ymi8bBRehxtWZxhJ0p4Jsmy2tcIjJD0SCDqqzilC+UyI9iJiV1nEqssBI+01uRwKE2/qkwDxeu3IW6UKWfGTiv7wpHAfRt1UZ7iaDU4Jzvyynale692uozi3bnbXyBxErGIzZ5sbK0bc4P6qymg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 215661db-7539-41f8-9f8c-08daa568339b X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:38.8458 (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: 5U0IhwIsDqa63NfiUC9oGzl0TMZmnZugcdrvUgMBGKYMAgyH8cxIf1pM34mJJHL3jFprySzjHnW/cn3Yx0b+ZWp+Ghk8GOJj10Er0AJswBM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB4834 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: 4Py5UVb0M_UyWFIa8gb7jEd3YcjAcyy6 X-Proofpoint-ORIG-GUID: 4Py5UVb0M_UyWFIa8gb7jEd3YcjAcyy6 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 bd72c38d7bfc..55d9b13b2f8e 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c @@ -121,12 +121,21 @@ static int spi_execute(struct scsi_device *sdev, const void *cmd, * The purpose of the RQF_PM flag below is to bypass the * SDEV_QUIESCE state. */ - result = scsi_execute(sdev, cmd, dir, buffer, bufflen, sense, - sshdr, DV_TIMEOUT, /* retries */ 1, - REQ_FAILFAST_DEV | - REQ_FAILFAST_TRANSPORT | - REQ_FAILFAST_DRIVER, - RQF_PM, NULL); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = dir, + .buf = buffer, + .buf_len = bufflen, + .sense = sense, + .sense_len = sizeof(sense), + .sshdr = sshdr, + .timeout = DV_TIMEOUT, + .retries = 1, + .op_flags = REQ_FAILFAST_DEV | + REQ_FAILFAST_TRANSPORT | + REQ_FAILFAST_DRIVER, + .req_flags = RQF_PM })); if (result < 0 || !scsi_sense_valid(sshdr) || sshdr->sense_key != UNIT_ATTENTION) break; From patchwork Mon Oct 3 17:52:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612153 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 600D5C433F5 for ; Mon, 3 Oct 2022 17:54:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229877AbiJCRyS (ORCPT ); Mon, 3 Oct 2022 13:54:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbiJCRyI (ORCPT ); Mon, 3 Oct 2022 13:54:08 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 565443A496 for ; Mon, 3 Oct 2022 10:53:52 -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 293GOEr2015527; Mon, 3 Oct 2022 17:53:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=oWH6Wj7AJa/BibEuHkZ3TnIznxYEqgep14KQZJ+v3x8=; b=dZvbpw/UvThYmJhf7IRJh32K64EyeG1LGpwVgNBTRT25M7KKVDUb0C+QwYW2YmVNEbrT bwKLxDv1A/O50DeLiWjWGNi2poi54cpVgEmP0jyv3SSMSoI1lUI8Xl7tu1M+YbeFL8Y4 +z3XQ55cSDr9CYlgEIl2PSguj6cilBnY0vAMI8nDoGal9wdI0vaF2nrI7hvRS7rMK3sE jfj175OrwnlrUu+FwD5DWFv9mFOyitDv8Xsx6ia/SKFiGa7J+NoIkXVX7Oe2NUYPw3gW pcshVP9Ul+sO/ul296nSUbKG6XH7elGNFg2/lb7Ka14wp8yhTXGO9Hlk3agDvph3kKZq iQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxcb2mbkx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:45 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 293Hd0xn015519; Mon, 3 Oct 2022 17:53:44 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2046.outbound.protection.outlook.com [104.47.66.46]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc03g3m0-9 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F316HMY3rVOZZJuufmcDQmjcG+qR/qLkAmPCKkS7tO2Ps+njCKd2bux+zTJCiJJI0jh5mzPiO2Qe2F7eqCziSvvNJC+RAMWan5MjKCPhY7UPk4VTLR4hkqKA14wvcTNFULJXYBD22wtVnY16m+n721eA4/us9sf5JHy5NxmY42Ei7Vwu1YH4qHij20jyEYMNKHWZLBJJMEeCJ0kE9dR5NWAYmE5T0QFfT3KCtSaVKJLRS+lzl29y1twOaX40c35IkpnVM63/JiOOZqlXl9+rKx+EsPv4BXkdvZHOP1dOD5LJ6xpwpmxZPBmsX8qvsDEs2HM7Oej8eI35VNq+f3jW+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oWH6Wj7AJa/BibEuHkZ3TnIznxYEqgep14KQZJ+v3x8=; b=gR4EJeuvBBCnl32HpAAcINWBI5FgjbL6+p/G7+NkT4LbBciiEbgmle7TGd0YZGGaQm7qpFRq14m2Y7RXemk5+N3pLXjTLKGoOVhKUlKmo4WA/M45qWTuKhywr2clsdATyaHIJRTMatEQGuA7Q+jIz2hSexzvGcjObglE/apfM789C6bgxYVI4XHdcw73juDUpCMmq2r70Q4leMqVmqxUXRl5LoYpeIBX3CaYKpXUupwBxVOSo9gQUW8LtucgWtipfGHMZou5I/Y4+a8iit26KzOqnrFbrKCltfy9czoHnou2sUV2gXhvIgTgNFW4FWYIjcrUJRwKsvnGtahLOot2/g== 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=oWH6Wj7AJa/BibEuHkZ3TnIznxYEqgep14KQZJ+v3x8=; b=Hzpfgn90kEGuH5H4MY89ufv31afkZJ4BkkE1EnJSsBSZvXEcKr5Ndz1yp4HOJZYAVzS/t97XAywm56NNPT2mrOT7jNE6KpQr9QPbgYOsnwjmZv6nbEEWBswtvo4vOTz1k06gwr+Go/m+MHpB8yV5qbJ0/cD0FA2hGK3Vs3swCZg= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BLAPR10MB4834.namprd10.prod.outlook.com (2603:10b6:208:307::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:53:40 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53: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 v3 11/35] scsi: sd: Convert to scsi_exec_req Date: Mon, 3 Oct 2022 12:52:57 -0500 Message-Id: <20221003175321.8040-12-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR16CA0029.namprd16.prod.outlook.com (2603:10b6:610:50::39) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|BLAPR10MB4834:EE_ X-MS-Office365-Filtering-Correlation-Id: 9693fadc-b678-4fb7-7e99-08daa5683461 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JnRm06dlrkaNs32GkOteAUc+X8VBstfZnkZEIumL7A/beArigsJ+5c5Ol3vB78rHKL1A+6pr5Wo3ADEj9ottWxnkmrBJtQXYvk7eiI5h64CHJwFavdjndvnkBFgFBxbHeBgpnh8B1HFVMUtK5Ig2UdtV4rWG4JCVgXEBdnoJmBfA2lqSp/O51gUPj0p3rz0M0Ne9Hc1YLuDS1KVR775bYLzyT5QfLV6gBEGOBmAbhG71nNXB71GcAgXL7N1HdbDFRYp/xjOQwG3kOzb1ev6vbiuo/6FaHdjqSi3gMDMzX0RJNXB61TD6xW9+ts0AEnhhBsKIgZp/Zcpy9EjBSD+pN5KvU8FWHINKbisKkrWo/5/iRr4NstbGb9I0Wy77Q8r7tQWPb9hTGAAFdPCmG5par8gf5mh4Yaud3FvptjDuz9SIs4S4H8NrbrZ95YazMyc3tQb25y+AGGoZqgmxC6uWXh2PrWeE42x9frhF8xTpXXsBP4zqizKQUGmGIVvpYGSIpk/JKm2v34gZcA6y8KV2ufwjmad5tMdgObTQJKG8o/O2R52q6M7DruzNO/Mnki4JxnImxtDJSOZamjuBYODZsXqMaK1JWGWG74TVhbWxxrKUB1M5i1TioZGJdKaZ1L2ApSLq8FOou+E4kYQPxNxUoajVZTFtuZbPa79nb7P8JxRfU+dzSoWTmSaSiRpX064fpOu8dGqEShcKyQogkjWSvA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(346002)(376002)(136003)(39860400002)(451199015)(86362001)(83380400001)(38100700002)(186003)(41300700001)(8936002)(5660300002)(316002)(8676002)(66946007)(66556008)(66476007)(4326008)(6506007)(6666004)(107886003)(26005)(1076003)(2616005)(2906002)(6512007)(478600001)(6486002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wP1JA/z13hMWuwCOW6ioyp50HvU9PI0GozIsxeshsmR5cDTEYz9ORRBqztbl2rTs20okWaT7ZO4t6QuMly+0V4TcZkmNalJ4OUlAqAvdpw+BUB3ys81GZjirwpR6uvFNQlIDwhOdMIXUCTV0HMlTf9R9OgVVKiG3EEidfyrWd8nogTqxP41Q0Bb3AuYVPgCpMkUhy85F6IjdxBTmUWHyA1kXpmKcOz8rSWt+OknVhIXEmp33xQv4XcmjEzwcqlHGmTP5ZPd3DvXo8aRRc8BVGNBkh3951kD9POmM1VL+E3wzchLuJvZdMoRcOIBCjhuz4GJlYrWVQwn/YmDTWo8GNGGZF0ptNEKlzVvv2iWLD6KmeJ5uo/L9t52aJIQ+CDnl9xCMX+7MC5uTQxw7kRInS5eQmN/SuJJL1GPkgrSGYoEBOVP4xvqcSnuo3yo6jF3Fnd0rKIolDh1QBkkLvRarPSL9+ha+c9fyMD1eqx9RByK0/Rs0tLrMiQP1zvtcfwBNy2XfBsL+M8y8LGdfkkQGctuog5/AyaQIR1gZLRM17bzqb9Yuuk6a8eUSGybJGGFNWXjrs/bMRgbn3ZtgUOA9rh0s7WXh80ejejxSZGmr00HBlgZGUhhbp6KQsvfqTkxNQupj11zkPRJpgX85c2d5cV5sjtYC2qCjv57rGxgmFt0nX4wQy/uDEjOUAM/ufN3f5UNwSv6u8RDDRBOxJt9yBMjaaus6ZiT69u8eT56CxzzJUIFD3a0wUBtCH5be5duup7pL9PeODIqDsoiP4PwJROHrciUV4rAnTQwWOKKbVkj1FbF1yT0GXr7tr7TX+zQFydEI7XOWsULfwtq+7DJBQ9cyYtK3/OegEoRQ8qTbUmRf0+EAa6mmAjm7N9+UnETruzHhuEUO7GVHf7nJq3wd52YcxBcC5yYF9ry9svGIXSSNm21jwORPFtiuvtN5+JOkYh3aneEeGRdDVpOeeVxBeF+BWgpyh9x9yfPoVYkUlU8mb19DTN2OPN2DKTUmCN3DYK+Hvt2F4i15zGTZTlMRnPziUuJ7PyFpm9/T5Quf/HNq21YIWFJOldD5qdRb3seLm7Y2nF5hlUgb0DsWuoVIW23M1dETP8YBPVsHfnkV1+GEFrULwOMHfilQFFWKnLLiJm2D4ASryvl0RrjxpwwfznWCPQ7Yxb1pjleRE6iCFAnWB/HwpGo1LVZGGvp7kaXTTMN44/W8gFfeM/CbCNmpBXAMhM5wB4jjdo3VrIXheVpFh0IqRrbDBQwEO03ziJ/Lr68XQpQz/N8Z3zbzG7HaPHM/TIpO1eb06AhPHnWnl2rh8/hKKZPHUF3x3j0Oth6S7L4AoFGkJlsVdFx/OajqIXzAHa4aIuXbs5z2tFmG2ONbfULqymSKdjaQ2f55azAoecV5v2mr36knZQ1W7HoMsXiG0KBIj0b1FuJBUmnwqQ4ZC6w/wteXmix/6QPD5ndw+zR+hIUh8dmGY1+JP/xg60Ob0tSqsKMZT31jZ7aIQr2paoXgoR1tjXaMMURgzrewAjvBmHFm/9Nx5R8F4qBFvx2+q7Hg3IIEKr/voyqAR0lWBZajT/MbYTEPu2OGjIkSuLrNrkq4DXB6hqmi1X2TsA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9693fadc-b678-4fb7-7e99-08daa5683461 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:40.1739 (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: hHHisdbcDInE0PgZ2Zl/UsDVvnkPLNDLGt/Ay8nUyTwa+RyZJ0QpDqNDmpANfZoNWWqIDMwsNozCINyL+mr7tX8d3fKk9iQ3i4jWLrM06nU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB4834 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: ytNQ6Tyke-W1r4bhumyeJj91e6XWfCa8 X-Proofpoint-ORIG-GUID: ytNQ6Tyke-W1r4bhumyeJj91e6XWfCa8 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 Mon Oct 3 17:52:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612150 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 3CE1BC433FE for ; Mon, 3 Oct 2022 17:55:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229679AbiJCRzC (ORCPT ); Mon, 3 Oct 2022 13:55:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229774AbiJCRyv (ORCPT ); Mon, 3 Oct 2022 13:54:51 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78A713ECF1 for ; Mon, 3 Oct 2022 10:54:04 -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 293GONAx006557; Mon, 3 Oct 2022 17:53:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=5YWPcUAeBPztCvPxkAw1ZA7DMaUL9J5GtrDVheS7bds=; b=OfET1eiTj4QsdWaqh9K+HG4Tdnex75qQxbsY7nuUlWaMZpmGOXw7beeTAot9TiaDxRRp 35r/SHe3A8zEHdSnHpElhD044t0Mn+WgIOrM96WLJ+uIypj0weK77KNndXWPPG5DdQrU sY/QyPz4DMLvwoSRKhr11z857MYcWPayNTeo78Jw6Rh/E+6nKQlxaWeDxU4OB5WmNLWD 4zvhZcA5q+gkTpEmnj5khgdQY3K+Jdgt0gCAWEFEOugtU5rkl7tZYpSfyTDWeN7xHUmK gBme/rRwPfqb1gPaokitPkID+5BLMEQPaTVQsR/ZPdM48txnTT56WjEwybpAjr+BL+es fg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxbyn48te-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:52 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 293Hd0xo015519; Mon, 3 Oct 2022 17:53:45 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2046.outbound.protection.outlook.com [104.47.66.46]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc03g3m0-10 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jec1aPia+VKNYkMhb+9B+jwj1TiCwMKXwkhJKwGOn6RFbSBRSi4+nbH7W8ar+Jr4NR2AuhJ3NgKqS//zPcGAC9x/OHAce49mca1p1UpFahYNUoh5AB/l38Jv5/Ry/zB8UyLuDdHu9h0uaZsafWaGVrPbXVn0Cfd2+65+5xTFrl0Qtj2o9F/dHgbFFUPFSrh6wws9XB5hQAGU1in5fUnrmbCoh4a04OcQJ6n0l1FA5bWik/z4jQNxtVVETvudfmuxmnXDnPJD9LIM0HZ0DyapaT7H9oDRHkfnQQ/TYEFn2fT6GYuWzguQWQX1KFpSb258bg7gGHL2vyeMeX9fLMWE/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5YWPcUAeBPztCvPxkAw1ZA7DMaUL9J5GtrDVheS7bds=; b=QOcYAo5C34TXOHc6CwdbolZi6DVdjcOWHfam3ugc3yDczv5pIUpq8dbySnIoS1SkoD331u9RZJwgoFcfa73FMfJuzBDkriMYia+Be73xJBC9+onfPmJF/SbTc9GUkH/5ek1gJrtnHqgwJC+ZsVqzuzORdBHF3LpUVEI9RnLMeWmyYDR1f/o7XK/7UWuZdTtvxpKuo1A5zvLUYi1GbT8I6gAbn01zCO/yNgAympFTvefrFKJZiCDXNIIOevIg3RBUmsruHLU8HwNEO3eDhkY+erihN7nCF8xTOdKnHXUCWiUJnVVvRZPcHfnN33TAU6cPjDxMre1EDuILBBuPbpvTPg== 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=5YWPcUAeBPztCvPxkAw1ZA7DMaUL9J5GtrDVheS7bds=; b=iM9pBRfsaQ8w6oMv4SfLvLUHreAWDVIAawQSgLsoPc1bnJsf/PacY6Gn3NJgSaQjEsfJbk7/txJWLKgjF3NhWwIvwfHnMei8ysXALkkpmLJ5jjxNgk82C5tNYkI7maN9ziNKE3nUPbG2kHoiYDKJDpsPubAYOD4/d27SII0s7t8= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BLAPR10MB4834.namprd10.prod.outlook.com (2603:10b6:208:307::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:53:41 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53:41 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v3 12/35] scsi: zbc: Convert to scsi_exec_req Date: Mon, 3 Oct 2022 12:52:58 -0500 Message-Id: <20221003175321.8040-13-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0056.namprd05.prod.outlook.com (2603:10b6:610:38::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_|BLAPR10MB4834:EE_ X-MS-Office365-Filtering-Correlation-Id: 463dbe3f-6550-4791-e6da-08daa5683530 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W7jf5y4xl6SlYZ9HiwOTXL3yXVZle9uhtRdxSXTmEjmfUpuskKBTmQue0SYlw/ySOZMxMCGUqCKnuBSJ9/BjZui1dNE2mq71QhOUsBy98Pc1Hf6iXWrZor6w/4MR69zRLM+ejlCs4CC4ITiiQwvXIb7+cle+TtHLBEBFiJokPeCLtB4BfXhH21KMZ6ZTQ9ey1kfovqE703WVKP/xMk4FG7aoxvqxfgMkQ/v3zmR/Tw7ezHcpEwS6rOnz4GKDRzC0y5HqtX/d0/PKcoZxCQvT44yqDmqHjZEhdBqFEgMAFqERX5GubIJlCxO2qqBahcO0vpDuRgR4KPRo/lV9ckBY/R5adh65PuGemnSOYJpL6aEXmJ9LGVyLGxMMxlQyRjf6rbiSA1hfsCYyD5nBLWJwVViWvGZCV6Hfs7eIQ6hbEYHEYdrAer1vNcAMVQ9MdkafyFtem8llj/ctLVsJ7MjeWa21hUDOyrpDz40ajIiD/j9h1bm7o6MG38iDGph7gWnchs9WiX89L5ah/uT8q39n6HrxN+yC/ehW2TMiAOC9PpKROcswnkfFZn3XoGYCW9wu0RenpDZXnaiX6TXdmja2cNfvmBhf9ZxmO4mx95Fq19QoDgtqhuxPty6ZlKqX4eUtPyEVsXdXCyvprSN53G6cKmjD76MAuNgjlQz7cPO9qrQ/v3zYqin3d0PW1a40h88VLFfeeZr4ADml/XKX9hvkRg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(346002)(376002)(136003)(39860400002)(451199015)(86362001)(83380400001)(38100700002)(186003)(41300700001)(8936002)(5660300002)(316002)(8676002)(66946007)(66556008)(66476007)(4326008)(6506007)(6666004)(107886003)(26005)(1076003)(2616005)(2906002)(6512007)(478600001)(6486002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gUE+re2LUxOb/9TsRfvROc4GhRG6U4mMIseV6EKRkvSvZfDt/B0EbU5lrKIIAviYcEHg35Z1NWCxKR05v+N8jl7yYeArXeLr5lfRC6mma+jNnD06tAU80i00aLZPEVk5PUPcVvpdMg4yxpvf0Sxaf5n5XWaSO1eWmNFEPxQhTAVGT3fMV6vLOdundf3+qmp7YdqHn2R+YkC+knTqnYolJz+xtsAPd3WTtgDwq7gdfzHtKx9CwFbRuhr5g4dpF7zBVIoc0aUQd1K8hfvz3X5o3pg80acKygzNk40EOG+PCOCScfMcrz9WD62bvGmh+DyY/npHUPpaHBtDfsaDN0PcdBQfrUNFictX47HSYUSvDc3rxPjVzs6q5o/KOneO5SjCXRIjDgNviMQiUW71K9rhFl1esuyT/oQ9b2vPoEz8p+WhuslfzPQLXQwP8zvXYJHraqMiejcFhZCGBEPmHlxkR4SId2ewHZyv7eR/GhO2S+4yeLxA1Pq12MViUIMtKHa1vW372/Is5MT5o2cDtNxvIIzm0YPgcV09FKlF6lKou1dQzE2/DtodRVdoWGyt1C0Zs3yY5wuwfhCCwMO846NBWYCTw5tBsFVZXPy+mq3sGPVZhWdxVXEv2UKrCQ61O37qONrnouRqkhfPVTz/6AG5UZmoiid8jVju1nhICdT2B5dFZsf9MdsHs1bXFEm9n97pTvsPCFguZmf7+DA2IWXAVEP3+IKPAyJCxxPOvh2YMX/94nhoRwtCWqY1X3Loy1EKJibmr7S8CccKZEMPJR/esRL01mY5KiYpbVJOmh7xnV1lmga79lpGQIVgQQuTVBQLbj44TV4UoydUJ6GY2EEkgcJhGHlFlOAxs/wwQU76YH6pTF8FBLbqNqTufpVTBd2Fq9KpRnzO0NqH/+M+23fuUzN7QP1HJj4ujGxx8cZ9a4YD0pNbBQTL1oP22GCKm/zrYT32VaL2rhhskHHuG21AuoG9CTYOIyk/W1maO5Bqlt+pAMDrNc4X2P26RRM7wUGqWT73u7FQMujGldpcA6yWF5wB+bAwS0VNdDht3Js1GDorqKWOVySdGz/v3qB5KXKTwaJJHG/SWtjZgnBCNUJLujxNESh/9RE54u3u1HBBz3lsF4aEOJNmzXOyKCrYLu8aVFTonlHFCX3KxRtK+ZfPRZrU5g7y4KobAJB86Np/2FlweJHRtjOMYyMthY/G+w6Gg/e1VNvyYIz+iMW1etKP5+5VxRp3lfNAQCXYAK1Efcz6TXgXCoIiaf8NmByC0s1fAwcKXhz6UNicz1V/QCk6vZWeHPpZYhExY4GFnlIgtHyrxdE4bMhMwgFIi79G6i6g0FTZUrOhDNAnWzUMk0SzoOWjZAy/9Fapf0wjV0aNlmH3NJQho64EZr5pfJQYK3HZQhOUcFqzULuY6Tp6hnnWlnLVZNAQHyRenQIuIyYJAKg/UTi4Ex2GCsnxcpSASHRkd2COfMgdP+qF2Ixj+lUcOlnbT4qTE7McGvl/VaVL+2Pa/28HEgDeQWFQZobZDtEGoT2yFRDSQ7s6mAGHHRDp96y6EGFM24Rrp3Bo/+BGafWfZpnvmPBN/6cLGFnzymALGC6LzUPfsux7LHC8YdV9hA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 463dbe3f-6550-4791-e6da-08daa5683530 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:41.4863 (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: aJ9fNyzRDFGaJDlGVEtf825e77marsIR0ZjHL5Uau2q3KMLd5bDicHTvv5gr/8QPB2fhcDSMUIT4dF1TqETLjEv5f6xKrjy3hWRsGlLF0WE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB4834 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: fqGynOLlQ5UIHoCYuaqH8_mPt_r0vCu4 X-Proofpoint-ORIG-GUID: fqGynOLlQ5UIHoCYuaqH8_mPt_r0vCu4 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 Mon Oct 3 17:52:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612506 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 EA2EEC433F5 for ; Mon, 3 Oct 2022 17:56:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229972AbiJCR4f (ORCPT ); Mon, 3 Oct 2022 13:56:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229926AbiJCRzO (ORCPT ); Mon, 3 Oct 2022 13:55:14 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D286186FE for ; Mon, 3 Oct 2022 10:54:52 -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 293GOABR029405; Mon, 3 Oct 2022 17:53: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=wy/V15K6nvwrhqR0IOFe/2l4oLhkIb2knvEN6KuPVM8=; b=ltrsbxUztK10D2mj469fQ1QxQDIAeNC3i7X5+LO7A4uOrKXq/IjbTe8ThxLiCDjbFHKG FwN0N8znLshmGA5fDQpvkl85wjpGfqEZuZfkZUbK+GYvp/hE7j7uU6Gy4V6uxS8fEPCG /jPg1FkhawY0T+wiFCogigajhX0Cqo0uarYJZ2WDlhWEsg/vHLTE2XH5XB8BAIxCm7W8 z9myPvy+EWL+3ri1IWhe2obUSbAkNDVsgBBMFLPSCX+Jd2n2rRft+r65fMPMvSlQMe6N WlKSCRTFeM6BmZVKZWZDmb5NJB9YiigQvJv9bnPnztn2hFe1fLRZKb71Zj5j3jnx4I6i hw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxd5tc91w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:46 +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 293Hd0xq015519; Mon, 3 Oct 2022 17:53:45 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2046.outbound.protection.outlook.com [104.47.66.46]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc03g3m0-11 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JylqwGlVDqvzah7bbbaQdUW5fXxhj2nh8yD9CyZINDQAmukZedymPff1zmxQN9YlUSgHHb9CCUa8rtjItTU4H49lXTJx4aBNhjlf915WktjvyYpiP6D2Fo28E+6HwoU+Cyx40BZNiAagxpH2XmWz4SX16kpwy/h/u5rzuRwlAGdRqeCXJ67RPKizxM49dARQ/udtQnxKcEv1tpFsgbI4GIK0oTzqrH70AzfG8cxrLi8+RFk5u1FYULWhPP7DRRL5q7jbuVLje3DWmO8vTMaS+AxP3v31wf6W/iJSKVZ/HY9xUZ1sd+mH/1u229Zr2U+cLO9mv0RbeT4msCFPMAvk2Q== 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=wy/V15K6nvwrhqR0IOFe/2l4oLhkIb2knvEN6KuPVM8=; b=RTMXC8qOQLlU4E1H6dywxDV+UQ+1y4py/A1WHl4aEamyPwVbRBQQPGpX5kFfQ8/cTkoBdaTskhSrz+u9JMwxXsRA3dmuDL+MK0sY/5lJzsfMRbR6zzCw+xcgAlzQXEwKnwm+cy4oES/cHJIGb76VdcFJ7ktT2HBPZSJiSsVsrLeUtAtA9biDry6lM1rDwGaB7YbiCq0KrrhdC27nC9FyDZij8jn9ICVqjw6AJVukNMNkEMfjJNu6wl+gEXd/6ckdETaYPy4LZPsObDXN0JjeTJVPIup8e7a/Y4k9VtM4BU1TRthc7me4MvcqYKpVag7yAuISWJlTuMUEItctXpaNdw== 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=wy/V15K6nvwrhqR0IOFe/2l4oLhkIb2knvEN6KuPVM8=; b=UsyJ23W7BDfTQi5be6m6DBvLieo6PTRvOVDzweBXEaFqGHmj3akrI/aaGKK/lV1AkSH4WS7ndsFEiW0fknT+/igF2jTwQQcZsPRGqJUjEjwRZFUvGD43pn/2j37y/rIepr14OL87nfnyp1Ahwo6ik9tm5GKnjzhmnmmm5ryrxvw= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BLAPR10MB4834.namprd10.prod.outlook.com (2603:10b6:208:307::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:53:43 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53: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 v3 13/35] scsi: ses: Convert to scsi_exec_req Date: Mon, 3 Oct 2022 12:52:59 -0500 Message-Id: <20221003175321.8040-14-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR07CA0015.namprd07.prod.outlook.com (2603:10b6:610:20::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_|BLAPR10MB4834:EE_ X-MS-Office365-Filtering-Correlation-Id: 871e2e32-7a2e-4504-eaba-08daa568361c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gYU5FeS2rHeaXBqyRIl5ONUVineevOd+vA+kcg5tdQOgBZ/p+v8S13C457UlDewWj3lWjA3WWj0GozXXnaLUz2S7W3zGGGgQ/Mfee4lKf0S4cl55eZqJW1aIkmsoBrcSg5MAhiEnBjJF9XUwKPzyx6/BtoeeKrf6ZrEI7Vru1A2NJYjoaoCUmpatv4T6ZfoI0sS2MZJjhv3qAe6bDzJUMff0Z93VZ6hm8FqeMUdXkI/xEcW7K1fAeyNteFF9oi4/gjoBwisqqtATVGZJ8iBsEBlFhWHaftLyHz3W5xHeb+CsbMaaAPwqvKZBOl1WDBPwtFLO75DxrA8NC0CJbkr3dV6/Adtyv9WmSF7oixkULFepTb3HH6XwJfPvLfAz+z3FehlPwrm/np8+9UcUU9+U/RskODXwWmZcj0udLFgd/csLIBTuvIQ9OMgGixnfChhAsF4KRK4lSWeq7PPqvrpiwE0FS7bUBRktonuq5u7pX+4Xez/CqUn2fF1+oByeJFhqQLOVapJqeun2C/HOsoT/JNsmNZ3mpkV2jr/cvjDygLCmbgEEbyxuhMeL2neml5Y9UAB3jEZFPBT/Ly/l0SB7AxFsdq97STotjw1pI3virk0lHrdjYsN593YuysqfJktV1OBbO51Ld2M8xGW5lj8rHh8qvxzi99Un4sVx+VhwzUIZ9YJx89ytuHZmsN2B+P84+qijWkAmGrXR7Jp66kW0IA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(346002)(376002)(136003)(39860400002)(451199015)(86362001)(83380400001)(38100700002)(186003)(41300700001)(8936002)(5660300002)(316002)(8676002)(66946007)(66556008)(66476007)(4326008)(6506007)(6666004)(107886003)(26005)(1076003)(2616005)(2906002)(6512007)(478600001)(6486002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ym2JSfQ0ltGa0vy6dfOnsYM8RpDvqJe7qn50Gqwaxu8Z5SMA/N4zHYF6X72Uc+ip4Bvy/lO4fA5ei4WVnTLgVltyGsGOY8L1jduudq9d+dqbfsAGJ8ZCZgwPJJm1nA3ufWVwU/7vp2R2/fafoqynCZkTpKp3J+P0CGzl+mfE1s2OCygLroTUSsijfBt2ActPmCBD7LsJFzkr2gJnVnpNm0Y7iMUzKFXRP7O4Lyzv4schS+NrF4XHAh3zFaYN6ze003OiC42iVqN/sLfbuK9/yyCmVMBOSrOUyhB/n9ivtRdKE3h4TSL96X+LrZH2kBf9ZQlO5Y/nkIEhAz98j24goEHCnHU52IT4Uy3ossY6Z/51Vy6eD5qS6rawAznvHPosGu2AYIW8FD5ZXM0Ef+G3v2t5bGmaePjWkbEu7HlSdAkESsu1wyrP3lF9/8HhosliahJjQWJpTL83jSvAmdOdxK40U5erXSEexaMs6hMMnLu0IWH/RS5lBx2XUuWgtH+1rhDbEHPw6KvHxbt3y2bpfBt4gA7e2Xu8oKoQFAe112XS9fVWNNcwXT1PKIB+IYN3dgGo2Ef8+5D5MlYoyZnRqwS/gJtqOjX+rFi3Nh76a1Bu3DhwUNdGUeMfv8ARyBa+7CUF8+B+R6x5/MPVLPIRqlgzzLetdTBn2zjirfGH0pWP/U/fldeMOUc+ovdXqIRbL7pQiEOpIO0qfruTngiGo57VA7IPQ/rHYIhX7DE16nzqEZW1RTJVL+8+DmGZKVgdfALe6KKgZP0BxLh4A1G0J9LwZR4BAg+BS7QlhgpudkwIjBBVS9RHsTXH9LgNtlKSFeoMhmFncLbS+28cCfoyZbatb1LPD194IeylaIT/1wCfL5lb01MD76hPr38/oTVP8Ir4IrtkzjSirhvyYzZJmqxdRySv+rWZ5EURogJiVREq9TebBZXGtzxiqvbzgGu1kkN/uVxcWInWPkbqdhsG4C2tZrNf8aVFP8k2KfmKNXIPb1BDudOyWshvvY4oK4SYpbapUWgoWDYOfyxg1US68FpWyrD6+pIn752Tea5GY94zvxoFapWhTqWxEw33CfEcW9P1n7oV0ovAjS02noOzsaKQJvEGseisj5OzLJvcRMB13rIPQt3MMr/Bh4iY1n0RD8qSIiqEOlARIHEFt3Uh3Xp2lLt1ULfo9IceQ/BfllmAncFUVLXc25pvDYZoglRJpqcaMlE3oh8dsfmxTXtL+s1PAFDK0FW2AP+vIbVm7kvb0YWcfmOyFrWflSUvJXfM/gvPVCV4YypahOkVMTbC3Uw7JM/1zBW9SqtmeB7dC+ObyirflAaRC0oTPYTrSuGuMXKNxFs0NuBmlZmwLsw5RbNJhYd2AO3/m4atr9ygqj3QLSGsWIqiEpQ8KkEKAvldW+GRguyxgt5psVAM3xFdOQUOV30miE9MVy8587FnRGePjX9jgFDeoNve1guyNho8BREBKs/VYw7g/jGXAi0yWCPjLGZ/oIdhu6FQRPBcm2PEhCnyU57t5/hCvUDsycsLuAN6Ai/mlN9dfy8M11hU+C4kdXfVSq3f6Hjk1ryzHdVR3FSKPYo4hRtBvs25dEaKQr0ERvfft/nOeSjqgnrYhA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 871e2e32-7a2e-4504-eaba-08daa568361c X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:43.0486 (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: hi6Bp4AzNN9wJYK9WK+o+DptVKYg9nYquN3BOphAK0mdwe/sI0vQiXCaEYITQ4LToy5aK2tLd8ktUHlTpR7jXj2JWMUyAHlnba4FB7Z2k2Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB4834 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-ORIG-GUID: y-xLdlIYBM_-0OOgj6QmmwlbUPAu7azF X-Proofpoint-GUID: y-xLdlIYBM_-0OOgj6QmmwlbUPAu7azF 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 --- 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 Mon Oct 3 17:53:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612514 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 00D83C433FE for ; Mon, 3 Oct 2022 17:54:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229899AbiJCRyU (ORCPT ); Mon, 3 Oct 2022 13:54:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229630AbiJCRyI (ORCPT ); Mon, 3 Oct 2022 13:54:08 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE1643C8DD for ; Mon, 3 Oct 2022 10:53:53 -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 293GO9WH029401; Mon, 3 Oct 2022 17:53:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=vSdNeyNoLlC1eSdgClcalmCV24FH2zgLAPhKvFETZ7k=; b=1kFs31QkP4bZqgWxZLiJQ9juvLFjw5Tir9yw55ekrybdjVYg6D9wIzla4pVJAYOPa1Kd pSWyX7tZk7AUHPV9XelTT070e7pPWIfeZtMRzRcobLFBizXT+ZE+GqndfQKUO4uQAZai bKnFYhrWl5lHsfa+MxaaxafIHJWQdslBHKPgEqedqJBz4OD70Y/ypPRbxiwOq6vUZvMR BMs1yIhRFxWcejUnbRA/sBGjItTP4bQKYpKNxytsStbn9lGMVzh/OHLSjv0mFx6qSZAQ AAjQePcQNO5iuHLyVdCkow86MetrlXnwaJgWy2fV10jwdlcDnwrG7+OuJNMSD2HYSOQG nQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxd5tc91x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:46 +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 293Hd0xr015519; Mon, 3 Oct 2022 17:53:46 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2046.outbound.protection.outlook.com [104.47.66.46]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc03g3m0-12 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PjSec3GAi1s67kpqGnjliO9lpSShFZ3di3HIfJ6HFbraNpTnztjYWfr6osyQmANF//CjR6QrYB6KOpBraAdTzY/P0ISMZSILWFVo5C97QqUwMja9fETMAzISbMgcgr364EeeT2V0KVHiV7tf4UNfz46CMJXFv68zujb+8rC63ayBxDmPC09PEH/bMd67f5O7VDefF7yzpltWtDBeekp05UcPhTVNCAVOJM/IcNIl8qs/cwjahU9ATU9voDvs8GPcc6rOHPncA3+0CmfMG/fuHcswLz0nUUWs5dg3avhqzUooeqWTEQ60BjBBECcPMPV6sxb69kFSRyr18/z3Ocpdqw== 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=vSdNeyNoLlC1eSdgClcalmCV24FH2zgLAPhKvFETZ7k=; b=d6KqYHCBIxyW9EYkmO+wRF0RjnJV1V3178crHgBj14ncggNpFqBS5ZUjjXBOdnVfVyuExXhXHEJ81/OC8m1xMgPQkBEbxu2iLADA+gQ1/KOzrIXnYb0gDF7yHeoelVdrdnMNzngWHHhQPA4vE+4yq9AP3snCgL+LHoiLFzv62/iYXtc2+1hafARC+uOix0cJIeXzecKcFkdo+2xThkSMMq1gtTe3YUZ8C+Jy5TY8v2hG+rAeweObVWhoTlzUOgdu0aCF8oIsXFsbeTotNBba9e75TGjrjdJiih4XNZTPT1fxkVh6kV31UI4zx7+F6Qx17qK5janiUDYrZB0zTEQU7w== 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=vSdNeyNoLlC1eSdgClcalmCV24FH2zgLAPhKvFETZ7k=; b=E0Leg8zcScSImZlMDrD6bnej+01J7A6Ao/5T2GI+z3s8t5mPyn7ATaVWY2NjMqraEUSG8M74GqlDYnYSbHi6MFTawuxn3NlCRcKqKsrVtTukDmM0uz2NC4Jr3zYepgrqjrP9j9uHchOGKonI9p/CLn36xOpQLV+gYlaJlWcGltc= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BLAPR10MB4834.namprd10.prod.outlook.com (2603:10b6:208:307::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:53:44 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53:44 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v3 14/35] scsi: sr: Convert to scsi_exec_req Date: Mon, 3 Oct 2022 12:53:00 -0500 Message-Id: <20221003175321.8040-15-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0220.namprd03.prod.outlook.com (2603:10b6:610:e7::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_|BLAPR10MB4834:EE_ X-MS-Office365-Filtering-Correlation-Id: 0bf9d191-b1e9-4f93-ec86-08daa5683727 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O3qyKYq9v/dITjY6wEjvafiVJNeu3Hu9sxUGSupKztFmEFCaQetR1VdL250oc+e5bZqne/r8/jwnm5UywfFzQlr/ypAKowDgPhaFUgBT2p7mP3XF8ymemgUqbksQtYbDLnAAS3NeV71D347s1MpRWdtLcmBhAylchyIOlgmPzbphOeW9TsJDthnXjg1ntObpl6gEXYh6H8XyjazEVyawPHFHUjZcYROWx4uGSxDB86YZCLZ3TvRNvcBs3H0cFxH0fsWXag/yvUmy8EmLSMLX5z9ClbQ+IE6XwJiUH2Zdw7MSWgCvDc3T4l+2YGUo+9bzwxhcYV2iEjocm+OnRqfb/sX+GnbnpsTqpo9noyONcocTc7ORhZ0o7VOZn7IV7ob1LEXl9Jz4utDdYoFgdOyPR4IwrvLn2xFEsTZEV+zC6wjojBl3Qs2Gb0WhDCeFFHDB9FXMaUNLIJUcS89kO5US9GaurlMEQPzD/t414QF4fza0FnuwD5GQWRhb/ANN2/mUI+OjlEoOjbDFP+4BjTNyprGXFaFxRXkzPd/1Hb2qrIMVRbo/QjU/3SqwQYf4uBUwf6zA8xTULPNQpV41tenp7t/LXNXgfhhIyExQmQEkQPcNKPi6spNEHqY0qyy7X3inHEd2tSMm0zJLKWM7U+goEAWjzuZF43F7ls75qwjkQ9b47JgiuTpSUJK0fCqePaNNZUVXIJBXrhdvzT+Y/Yhdvw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(346002)(376002)(136003)(39860400002)(451199015)(86362001)(83380400001)(38100700002)(186003)(41300700001)(8936002)(5660300002)(316002)(8676002)(66946007)(66556008)(66476007)(4326008)(6506007)(6666004)(107886003)(26005)(1076003)(2616005)(2906002)(6512007)(478600001)(6486002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DGR0K7Jm2YoQ1AJDJs9Od2+j1z2je5H3pKvXKYqvELAXJwVq/R7lc4tl9uWbmwTnPfVV2AKuigfj1f3cSduGEiFCcaXTQUQ0uWu8ZuPujB3LvpUhYrCFJsk5E1f007G8WVe/H0JsuVMP2xpJsezrACFi7JEhByXjzpPkzghbDWQq2/fJ5ixtTwtE7XH0Ruir0Z0RZcZ6YCoWlgdv0p/vkhKWjNqvRSYSrax69FZ//Xk5JWcepT8E3/5uZmdu0D9uhGEDIt9XVaKChYe4SX1+Z3yHjHkiEodG/yVNkASinHb7P6wsUCBskyCsLsVzeSh3/e63SYc0bXcD802AwffT0KE7+pHYGJ1wwXpCWlIqUY49f5yCxlkf/8zyKjJRJ1TY59RJrZ/ZsCdqmrqxPuK30EUT1bSxpaz3PaVZ2GyZcwX3hjNl63c2LDDndRL6nCCXawjuaZM4aDaEybeNHhSBjppRpxeHDgmGLiFfgIhxIRvdbOTnlwHdHLC/CIQSf8mQfH4wIOSRhhf+9apJCU3tELzkld1eBWcJTUqRJqyze1I1Q9atI0pzzv4RuR09JTf5lcWcKL6+BCYjri/yVBQY9Cz3FMm2zWmdUJlUOYi9xaeQi+Qff1fAZljsnE2E+wibUy5518hFK+RLGIvFprlOK/hHsAMBU0M4yav0RCZHUW0HpMl0FKN25bOB6v9dsHAqCixoLr386uPnAkHx2SUBnQFAZ2F4L5GRuQZEJWcS3cDJJZ5+y9bN04Ph6q1CRdiNpp2pGBqHDjx+H1+xrxGKZEN2MIsapVuEpKcCv+SVINWKwG9p5UTupJz/Bjb3HjQycXZp+Urcdd6t0mYc4cntYF28HLOLQjzLZfQMnDYUSsWznZxGYwIGWtvJgK/Kqz8Jqy6oZueownxybhd9fetwY+DNBAeOsKnrj9IE9o6dxhOtdZ1I2E/zjdCCrGQujIh/aCCEwDeXjlobiEa5gu0+4q4gWIbF+GtdfBpMWl9gYrLotQfUv4uGHVUEjr6NWgDLblr9XwCjEOSQl19Me5Ln3qgY/MNf75kNte08rAKVTn04a6nGthyGKd/Y9BKrKmBIuY2XBLwKInUjddu7GM+Xvm/Ay+WW/ooDY0QKXXALtnEggyU2Gb/fuKHq1SpdkjgXNnb7BvGsV4F9IExkl1NB5H6izdYbw77vAGcEdO7SGuLMbNmrxJo6AxwPu8xTbcHm1xaqF/Q5mh+v4ocYCyZfO6ks8UBgg9D5SuK+Pi5NV/XjqQWkFBPg5O47xxC1FmIBvTfINGII62ZardLS3bijPsWYO/VaHVn/yo71J7+uHIkAiGIYgF8ErPXLw+Cm0W5+cJt7HHqWhAhZtDrmH25wLEjy6afeiVdPZfRBPZNC1njAVusXPkaRGKGFQU0rwimpucZdirqtqgg1T7LgCqaaOWmBSdX4/7Mu/jyli7Lhgp5Zmqy4qhW745CU+ZnngPk7J+CGzO2wMv577IQkJX+9HaNiHlCpKwNY4IBpSbz00uy9JYWr2H+GbnRYpEdWbMdeRlREclZA2ZyV+svrif6c8aZ70y+1KyM9pWpOmd/ZGLgDuTuGHVM7y4fddlWuh/ZJy75o+pOusYz/Gc4YpAIFjg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0bf9d191-b1e9-4f93-ec86-08daa5683727 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:44.7672 (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: Lhg/bGCNp6YP7XOgoooBhulUi0KLp/Tp+/jazwRiifRcXIJ3ZsXAIpRVaDi6k6yMs6FabWp+sEszxHqI9jUSnOlNg9cAi1aOHgh9tNCRKO4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB4834 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-ORIG-GUID: Gl7usXkmt4a6jk7o-NyhnDi4WQSLdalT X-Proofpoint-GUID: Gl7usXkmt4a6jk7o-NyhnDi4WQSLdalT 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 Mon Oct 3 17:53:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612142 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 BE211C433F5 for ; Mon, 3 Oct 2022 17:57:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229981AbiJCR5i (ORCPT ); Mon, 3 Oct 2022 13:57:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229853AbiJCR5K (ORCPT ); Mon, 3 Oct 2022 13:57:10 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 267FF40BE7 for ; Mon, 3 Oct 2022 10:56:16 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 293GOXex015770; Mon, 3 Oct 2022 17:54:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=0MquH/hLotwW8bSxlvioKZqxFxeXdZESvigAFok0neA=; b=PMRiNZ0utMIX1VLRbw9OL1XqWjhgPSmOAKxfs8d9ILksavh7IoEcQgDMfBz9/qdYd/zI rQnNSuaS7ZvdfsFiUh8pjIqH1JrlFZLr3jXEFGlqmNR5Dxb9JBr4jBS/FiXPmSfzGAHv eW7y+OvqpNQ7bAdqkmWbGGQqdV2RdR+w32gw9QuoBC/DvP0oWJyKGONQWu4vMW0n4tdi rIJzeeADDQgu/YMd9ZY7uQaHDKX2sQz570BI7AHWGYfs2HgJdb3JHWZuTITeTyLQjUio ompLuB1dUs/38ldNW5eXNT9I/uI+Bz8Sb4FiN1BQLyWgUVAiVGXPjjONR/BUeRWywYPJ ow== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxdea4cwt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:03 +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 293FU5Qw028008; Mon, 3 Oct 2022 17:54:01 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2045.outbound.protection.outlook.com [104.47.66.45]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc09gda0-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VCO4/VYbef1bEysB18S+zNyDzGyO5CdWhKc0xbPLBye9zeq0FxnMHWGD0W2mDOvcF14eHm9zIx/kGgA27juYXDzJpR3YbxkPBnem3Y0uil1oVz1q4iLK65I2I00IRqQ+K3E6opvnj8zuQ+HoQHi+14GuC3yqK6w04SpwGmpjx5PSZp9kph58En3wbOJyEN7XhCKNO6oMq7nr7O451HQDpiqpre4Je7Zg82cJZKDqMtTWKtZ4lxQb5Dn6Fki+djFsvo45ksXtK4XalN08p8wdVC7oU1QsX0kxHvXXw9C2HH1WN26rqo0ZVvu2ZnAs2y6Audt1nJq3Lwxrq1ICDSZUZw== 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=0MquH/hLotwW8bSxlvioKZqxFxeXdZESvigAFok0neA=; b=QFcdgWjbWFILswcqqCCLHReYEhqzcEbC//0EKvsWlR5qcsPv2XDL6+fPtVFtmlp+7AWFbk/hGl+PMBCk6k5nomo0YaJmj0vfq93cyyD3CFYEvSmlw/arFpDGkAIZ1gKBV7ITFflGLuq3S/uowdzqWFeFcqgEgL2Ef4E31zq2IMcEm/8oPlZiNvzoiGxkzGFN/4qDgYb9nZoAUX+qoCJ5rZY1MsG7ovweBE9bhS8bYJ3wwyAQ6JgpndzXb6Y+m9uV10YBIIvHR+obZNGCCiING1brTEqFYUYs3LgsDwvYUYzP8tYBA0RdPMrrc7EaxE2iIvTNwCKlpC5XkvUuPlC17g== 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=0MquH/hLotwW8bSxlvioKZqxFxeXdZESvigAFok0neA=; b=ZOwG/wZmzvNj1DQbbvxz+FL5Hofc17SiqT45DvR0F/OTID+5WbGfYIaCgsMd6BDCYgMIiEzXV/QgMepbLfBglKRKraFm7bJdo14TRCo8NIaKuO+6J+Imrref3W6KyfV8qJJnJSyp83MSGI3QAwbPvioxc0oMlz+lguELXZUuHUw= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BLAPR10MB4834.namprd10.prod.outlook.com (2603:10b6:208:307::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:53:46 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53:46 +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 v3 15/35] scsi: virtio_scsi: Convert to scsi_exec_req Date: Mon, 3 Oct 2022 12:53:01 -0500 Message-Id: <20221003175321.8040-16-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR11CA0019.namprd11.prod.outlook.com (2603:10b6:610:54::29) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|BLAPR10MB4834:EE_ X-MS-Office365-Filtering-Correlation-Id: 27c6655f-5049-4767-f283-08daa56837f4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KR6XCIeFCssWEFtetDyWC/EgC2hp0zZ/+2CpW5AX7oYhJ3DY5VnNyn+4zk+zRLIoiMWL0eIBOeSdveUybd//DEH7RDVh902N82CUmn67MosTTeJI+i5EFkIj9ZVFVJEy9ODfEnCfcGt5pkes5f0zIoSAnkZGP4J5vuT3m65vy4E3vxKkHnj1jMbKvCRULAHEhIqR26aifmFo6v5XXLIpP88cgEdppVqAoJaT9/xXLYeWlLIs4262Q2DjRigG/diKV2T7/5LXxRsTlpcOULE9dras2RyQvfHUydTScMofIuesK71VaMK/uVmySnYMheDbMv45+fi390CofJCbYbEodc+gqHDOZXB81terldBYRzD24wteg9XrZ46+yucjNENLDPAROjB6af1eIbzNOpfAXoksWS+FDXmWLkwPcfef11q9D0gErzEVjdlnl7Q1n5D4ZnSnUty2KlcyR12mb5VufciInZ8M2DuptZ4n8III6O8mwHd9AQpX2Erwkt/8NlyUVAt0C9hzW/qoLnXoktSXFDNU0CcrTaVakLeyvpHeF9Zha3jv+lHR/zxDSKdh+djBnpi+qL8oD7ioAb+UKRcC8YBZNVes2kiDzJpgy9lqJ0/AAKnf/dX80GemA3pxWc6sn5WDjPh/9jahtJ32wGWy5x4LOcVErs2n7SqSIXagsbMOQKq0EnNkuQN63iAxTRJ6Z11zOpcJZytKRdr8lS6qJQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(346002)(376002)(136003)(39860400002)(451199015)(86362001)(83380400001)(38100700002)(186003)(41300700001)(8936002)(5660300002)(316002)(8676002)(66946007)(66556008)(66476007)(4326008)(6506007)(6666004)(107886003)(26005)(1076003)(2616005)(2906002)(6512007)(478600001)(6486002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: k7FdIvShg3Fk68g07WPx25iUV9kxDV4kIqB52N6z4oEhzi613sKsLBU9/gZJrMkBJ4ldM97DSZ2ArsPpQusA82e5eSgZvoHkKNww+3G5xkbZkd2uCE4/6HZxHnepqPGqvF+MEr9jP9FUkWLzeLdSmgfpEapAkGQSuJ6rUozhWHkzsKcmXGpVQMLlhCLIOAALXfYhkOeJfUhPwsq8+aZ3yZiWZHdIGUJPdE1dLmgXFEIalSO2k+xb4rKRM7YH22z7djoKDxXY9Vek9aLwGdzgeCfg2HWomW8aAGofHQDxcTilM93nMcScgZhEOwI8YhICXJKSL2wZOeEYIn4NYS3bB+7/fPKqR2AII15NtjK/AzNEPvjwflHCZENHA6Rr+/Kg8DsG1O3w+X9TtAOLGOBtJaGRzWjGQgirIUdzzdYEyD8vSJuMQE0qs8vf5u+DQzWWG9SllUfjElpQhPjLYLoBKS/C44I5Umy223m7B4NIUM8BMEK1mL97veb5bzFt2grzeh86bgTFPgSozeAvVgzejG0TLVqdf432OJzZocWjinEV4f4J6JP5aI3+pLEr2EIcP+9p8sJUOg2PCoffxYTiCgVrSBPq52gQd1DmsUPdPJW2m8eS9yEhQy2DWBwbCEBdE2ljuN93qShAp+4DDBRFGVBNUj0RUZ42Mgm0nhFQHZO3pMJQIEALyJ+Eipljr7kj9EeY0Wsb8TUeMvXVSoA8ihjrojaDCM4DYgULvtohfdgwPHRwduxaO58UHSLe13el9PT34K60n3arzSZocb7Q0kfaOp6By7nkG+Eu0Kz1HYbCNbiS5Xq/1kiK2fJHv3jyHTH84K3KVAPgpaCIoVIFUrgTjh4JKrStOnDRBBlMvm05IrRrD0tXPboQpqD4jLQAVEJArfF/6DA4hV5Q7Q4IYSIrmJH8AhrNmBndbOEb+OweuflGug9ZwnofXIzSYg166pubZxY/csr78HEIG+Y3WLVgR3IgQDJ7iWioFkS+L4SBt4SHHy9nWR7oB1rVC7EUf2Bhuvlf54Tn+JhDe+j+R34ddBHl66I2YGDjQfu8ttQCXLI4GpZaz/xcHa/JBUJDNzRgzVw6fzbjJ8JlZkYPlaNq+dF0hbxkfQJDJIcAlLVur3EA33pffkpZr7yhTCDWqwVYZ5i0A8cfJfpq8hPDvAsVMReRjI+L21ShrnEM1YgdH9oXkozmsPVrlKX6ry1jfBOEnJ+4dFs8l3nzObYGAGtKawtb36QqIGFEPAQ6/LG9txvwMh65vvw6y4PIf2Ygm923mrrcQ7dxzXwUmG7uHe4Lo8HFxheROSGK3bBWujVb6XcyVleYydT+qo2DhPrHuZ9PlMH75CH3KBfR45qqODQtpW+Hu8DuWJ+8+5WmFo13DwQEVURO85WN8oS0n25alrsnYq5xxYwuK/LG7AZ6P9UtNLcEZszznoYpH4w37UOi7GD1Yjnqk+y1J8OA2XXyPelGvDg0KhVwmQ44dh1s6dhQLp5FyFI8Si2CPSA3MO8REWxje5Gf8S+r/3iLohZX63TplSLEZIEA6juOqKE+dbLEWr6eLmK6/YZaX9ZsArjnL3lsDHMOH/PjIVZ6EB+Q7yLKjagKR6Zec32IT0jDfg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27c6655f-5049-4767-f283-08daa56837f4 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:46.2046 (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: esQOzfER9metShSwZ+5KDPrU15lYIF7px3C3A9gkLRtn23o/QLnD5OfNQ+H8J774L02FavFD+LuTKhIkS13+eYUIH9Um31nRBrBkZMUctKM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB4834 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: jDugkBrSaeLKxkqPQu8RorP7fxhclnwG X-Proofpoint-ORIG-GUID: jDugkBrSaeLKxkqPQu8RorP7fxhclnwG 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 00cf6743db8c..c86a3c035374 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c @@ -347,9 +347,14 @@ static void virtscsi_rescan_hotunplug(struct virtio_scsi *vscsi) memset(inq_result, 0, inq_result_len); - result = scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, - inq_result, inquiry_len, NULL, - SD_TIMEOUT, SD_MAX_RETRIES, NULL); + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = scsi_cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = inq_result, + .buf_len = inquiry_len, + .timeout = SD_TIMEOUT, + .retries = SD_MAX_RETRIES })); if (result == 0 && inq_result[0] >> 5) { /* PQ indicates the LUN is not attached */ From patchwork Mon Oct 3 17:53:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612504 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 0A81AC433FE for ; Mon, 3 Oct 2022 17:57:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229946AbiJCR5f (ORCPT ); Mon, 3 Oct 2022 13:57:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229794AbiJCR5J (ORCPT ); Mon, 3 Oct 2022 13:57:09 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2603340BD7 for ; Mon, 3 Oct 2022 10:56:16 -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 293GOCpn019377; Mon, 3 Oct 2022 17:54: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=ggUF+WZL99n1zc9R98JZCm5Ph0VvkdCJuVdmB0M1+3c=; b=Qsw4R0bNqbDmGob/N8t1Z37FPbuXOYXwaIaIoY3OTnrtUML/QRfkOGhH6kYHO2CpKZmK XDNLgY2yXTkbqDxIJPvQMjLuHyk8Ux/bArmP5Dp7nPDETkJGyqj2XeRWmbDBl2PqqX5T v95vsun5zUjU433M+mGSnGir6tSKNSTU4nyO4xKvAT7dfWYghPylWGMiz3ulSdBDApTX qVD+Uij1ivycdWgTUmev3t3OwpjaneTSiniKbAsEA+V7Uxqc43Mebtw6jq43ZGTOrCzF xXCkaRniByUu4k471yCIUQe/BrRGE61uCcwRA7CJPn3X5+XjtUOLPU1HbylVQ+/3LhrN Zw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxe3tmewq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:07 +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 293FU5R0028008; Mon, 3 Oct 2022 17:54:02 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2045.outbound.protection.outlook.com [104.47.66.45]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc09gda0-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V40sBnBttjGMAQltQQDkRv/bKRz/LGnc7HsZnSIlezb0UteY762hnDIcd5yDo3mtCSSu8OJ9rszxTVmKbXit9ZAlSTm4wluYZkoj++6HDYNiKkF/3YKisQpfE5WU40vbOrAA02RCKixaZW/cgydADdnhO7UCuC24iwbAL/n27IRnwypIB7v7RbQfaIK/uqADziD0psw4LaDHzPd7mDzm67QC2oCUtiyMNi6a03AviCOR8pNfqReP3hDdTflTAAfU0BjM5waE4KOcqiQYzFQrKvER/WKay5H3P3XovbdWymAyxp6GnJEakkb1otU1WVvSdXdrIgDRaGEewsqsb6Xn1w== 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=ggUF+WZL99n1zc9R98JZCm5Ph0VvkdCJuVdmB0M1+3c=; b=iTJWhlpqIPcTbKBx0r5Aozh9dEElvUmVzF70HEzlJAhv/dUP5oZ140PMF5qAA+yCMAt4NbaUF6hWYS/eEj/DapsxFeEzuPWgcx1aZzZz/hRm3BI51HVyJsShcbSbQJtNuLt2lkOJsHAdod1xLzm64R5leTWjuiDN2/SEvl+rEjVY5xmbjnW2Ai2t748glo47heyRVaC1GXdEWYBMaRqk9ufIuXmk+tIK1BA1tRhZs9Fhgqp99X9FBVbrxeo7kASEvnOUIrOvnk4hYXa6hzf9aLZgvdT84+oXjC3139vvRKTSBZFtjpeuEkRd/cU/79ZPeNy/Kz5BGsNnV8iuasjw5A== 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=ggUF+WZL99n1zc9R98JZCm5Ph0VvkdCJuVdmB0M1+3c=; b=puVRPgDnEhdgCJveBHmIyuLlpVvbDKWi2otsjkcSs6DB9DtXt0BkFCDrjr1uDDEd75m+j5T29GvV04XEVKf/b6Gdjvki8m//uV3Uflw4KZI2OyfAMKEJBR8c/l+PK1WXQXHOYtisPPTw2X3cmgXrncQOyDkoHcaC3xX5WAYGAmQ= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BLAPR10MB4834.namprd10.prod.outlook.com (2603:10b6:208:307::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:53:47 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53:47 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v3 16/35] scsi: target_core_pscsi: Convert to scsi_exec_req Date: Mon, 3 Oct 2022 12:53:02 -0500 Message-Id: <20221003175321.8040-17-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0052.namprd05.prod.outlook.com (2603:10b6:610:38::29) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|BLAPR10MB4834:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c38a9ee-97d7-4c96-6d30-08daa56838d7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: laqPJz96DQLpbCjurA9VQV4B7W/nnOQ2Em4Zd4CjZGvgSRyT3/cm/Ink/LjRU2h9Vw6s5lMuJQ0atyJQgaDxqDdP3bxZGFhysS5EtOPYT5VfKyFzPsK7mHTF/0j4l87rwaESwB/XqDjRnIpSpbja7bMyq7I+YeC5TrEdkJufbjPMlyaohpDJQuriJI3ySljQOZh5Rqfb6Jm3tPleR1gerCFm+iElVnMn5cqIgVM9Kj3YdgAxSKDDMmbpcuVOKE3yXBmuCPvcK/uzCCSotjQkBNZQ5+7AuyQEgUUojFxzmOU+txpPjzreHxmzK607/yQMAPSy6R9Jz/Ook5o3eySeYVH2RdPULHv1dD99oUThd/jJVETyD7+vuO+lhule5Iij7vohpxMnDhJmCg+I/ntK9hRpjLAOGKOsWGEXfe0CIKMspVn2noOjHLSrcrWbd02EWZ+hlcxVN6NW2+bCzdhFV5qH81WAFFyMyJPRDhWvCDC9N0hhpD+30HxEe2q5g9iO+rIchmrDWGGLX1JkD0mV3fNjkZmQ5A49JkCdGP+3br4dF5AkFDe1e4wC0aTrd9wlSVj4Ur9ZtN3Sd4m792MgHy02sWJDQM7q0p936RnvEf7bQTsAbSTZDkKzK+qVZYqQ9Dv3cq9NG02RYGAoJfKujO2/iaX/AuktsWIg3TLxnlztlCgYAmaLKXf7POQ/DqWylUHe0OSUJ41gJmX58QTXGA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(366004)(346002)(376002)(136003)(39860400002)(451199015)(86362001)(83380400001)(38100700002)(186003)(41300700001)(8936002)(5660300002)(316002)(8676002)(66946007)(66556008)(66476007)(4326008)(6506007)(6666004)(107886003)(26005)(1076003)(2616005)(2906002)(6512007)(478600001)(6486002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NZNAwGTcpMAQQdeFXMLwtHuvjmT05EfLWSnUtt63wFlho+PUVXuifOCw5fajei2r24xOBRFnGlZDmW3RhfYSLPGMCZgwwo2f+knLe9jUMf/DV74mRipMK8jajl0sgNY5MBMxEK04J6vvGFYQWuWNE9KQzDi6BJF5mMssA7TFH6PHhUiRcZUaDvoTLhDqjb8oi3WeQ5tEBjWcgktv0pZshwlDJezp9E55mYIJ7x+0N4Yjf+fU+UjL6DRnA8AYxy1397ieThq7q80aU2dfDP4NIPq+AbKx2f0NHBHk8hHCmQqplfVhWbJrbHhEERmAimfpwGEdxIFx2QW+bGARaXEuIhb2iCasWzkSoFXLHRXuD1mj/FYx69r9q2k8M62remsnBm0CcAVjHwSbucC0rH8CZoYKu1OLFHRpjAsKWoM0qQ164HAEFvVgBd4L/X2Xxah1npCeNCM2y2hJghMZD+f3kCxxqked3eLYuXU4wJBSCK/OJ7z4NmbDffqo1Z7JMhIRgwLPCnae3p6D7as/CNg/a/k0ZrfJi7+1y8trKGY8+QmieTn8jeE2bFB+CEh0cLSyc55JBPkaUMurldDOjWDAr9pRx+/PDERz3E2iq8NYfu6RnaKnhWELG/pi2YCGtUbURiq3KsUN4BJmyBfBBgsnsPqIzGBCFUI2DSLW19ubQQ9Pc2wiMiufTDRqJs2DVRNiCWGqXc1mLz0LAHU1q9k3TXcNX25AttYDk21uzYzw7r88YjxNnjySQkMIkwAsZ+qF1JRLc4lUMhU7EWwzVJlOLWRK2aTk+DvJrcwaAqSUfdFmztWAnQWHIoOVHi+h0UoEl7sxsbb1DYX5gg6/e+4nhBVZCZEbPHguhUrl8LQodQ2f4y8A6PUQtGrBPotebDOlRQ0YFmYtxztBPJCHe03704deGtLQODNSwMZ3skf1jrikMT7SuC/chxo8MqmyCFc7R6ng/J2/be+hQQutTxl6XJacwl8ktikH+4IbcLb+ekvEJhmWwhjatukbdEsjCbcbTu1QdK2RDhsFMERXLPhg0NKPB8CAn26WyXKhLnE0nTj8mw1CnIrtrkLeyns3FtWnDb/eD1KzPu7I3Dn1FeLPhi2PKMP9qPgrBSEoKi2KlnI7SYxafDz3UaLgHj8c+X93WeFBm9xpa7oiJ0ExRP9i9Gl2ssvwCe+oBoIIKP8NS6iRdjBl5BECp+eY8/ht7YcGGlH7HBD7Xbc9Ef4wHUi+VTx/Z3XnRyu80i3r+2N/2HqM94V+iDLH1VNtJPTxqdq2pfOaKcgSwjlA5OL2odZ6Z8FIsmRnU75MpNHdUac0W7BwVUmwnctU+RYMYDK/OZAZObqMBiKsOebrIjPt88Xq1ilKqR2RZb/IvpAonTm5hfzxc5VWIfrM5AY7YZPBJQftFvbdr4moPy0zr0QGwanPkjphn/Ax960OvAMdMNKuvCg896krQi3Z6tXAfT4DpllcHogWfijZCrU5qt+LgCSVuBVDDUHL8eb0U1bYhYccPsPAJb8n34RVBawqj9si0ZAtpU8IVxy3+ulIOHWCjI3fYJ98ybSNTeVr113/QFUicbPDuS8q5qvp9qo/f9oZ076ytcUBE69w09qZA3gTfljp9w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c38a9ee-97d7-4c96-6d30-08daa56838d7 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:47.6420 (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: sK6u5si2zUfcDuxueTlcIvOhkwfEmQ3rkA30x6EBqx3LnxLs542KjABtw9tTl/PBFWmNWvHkJCjMIqoOq2bBF26/qRp5AJLEA1PKJ7vPBS4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB4834 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-ORIG-GUID: Kr4QRZN2nNs9fq42sGsOvs7SaTZeUAM6 X-Proofpoint-GUID: Kr4QRZN2nNs9fq42sGsOvs7SaTZeUAM6 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 e6a967ddc08c..83c00343155e 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -144,8 +144,14 @@ static void pscsi_tape_read_blocksize(struct se_device *dev, cdb[0] = MODE_SENSE; cdb[4] = 0x0c; /* 12 bytes */ - ret = scsi_execute_req(sdev, cdb, DMA_FROM_DEVICE, buf, 12, NULL, - HZ, 1, NULL); + ret = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cdb, + .data_dir = DMA_FROM_DEVICE, + .buf = buf, + .buf_len = 12, + .timeout = HZ, + .retries = 1 })); if (ret) goto out_free; @@ -195,8 +201,14 @@ pscsi_get_inquiry_vpd_serial(struct scsi_device *sdev, struct t10_wwn *wwn) cdb[2] = 0x80; /* Unit Serial Number */ put_unaligned_be16(INQUIRY_VPD_SERIAL_LEN, &cdb[3]); - ret = scsi_execute_req(sdev, cdb, DMA_FROM_DEVICE, buf, - INQUIRY_VPD_SERIAL_LEN, NULL, HZ, 1, NULL); + ret = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cdb, + .data_dir = DMA_FROM_DEVICE, + .buf = buf, + .buf_len = INQUIRY_VPD_SERIAL_LEN, + .timeout = HZ, + .retries = 1 })); if (ret) goto out_free; @@ -230,9 +242,14 @@ pscsi_get_inquiry_vpd_device_ident(struct scsi_device *sdev, cdb[2] = 0x83; /* Device Identifier */ put_unaligned_be16(INQUIRY_VPD_DEVICE_IDENTIFIER_LEN, &cdb[3]); - ret = scsi_execute_req(sdev, cdb, DMA_FROM_DEVICE, buf, - INQUIRY_VPD_DEVICE_IDENTIFIER_LEN, - NULL, HZ, 1, NULL); + ret = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cdb, + .data_dir = DMA_FROM_DEVICE, + .buf = buf, + .buf_len = INQUIRY_VPD_DEVICE_IDENTIFIER_LEN, + .timeout = HZ, + .retries = 1 })); if (ret) goto out; From patchwork Mon Oct 3 17:53:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612151 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 21760C433F5 for ; Mon, 3 Oct 2022 17:54:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229630AbiJCRy5 (ORCPT ); Mon, 3 Oct 2022 13:54:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229897AbiJCRyP (ORCPT ); Mon, 3 Oct 2022 13:54:15 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABDBD3F1F6 for ; Mon, 3 Oct 2022 10:54:01 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 293GOYgI015780; Mon, 3 Oct 2022 17:53:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=JMMWtd9DwyGfO1igmZaTVNwQ0aJIzfeNWlYS/fG9Gkw=; b=Hxg4Ofxmye7j9Em6uV+tkiizzhMpMBqBIohLqct8Nnlmc5jJYWx8en9QsmDfQwnmQ2r7 dKXFho2KpajKcZZZ4KMkAAwMhiUtwS7rqItmEFKlvom3Oynqj5zByNFNzPziGr5+TocU ENThEgyhs7Y0c8nQs1fCXKXAhXF//SjozGfdcXGdbVM7z0aixoAopLLUEpwU9UWfifrh OVZLN1VYpgbtrQxN4TFAhBHSUn28gnjY9GlawytX/4VgcoXNHWWyeXBZ51pchnvamP2D Rvd1PDQa33QvwTf5D2KJvcQzCvA7oPv3Sl+WejaHSifK9wCL4h1sYRsVsoprk7uRFJfy AA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxdea4cw3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:51 +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 293HXvHg008322; Mon, 3 Oct 2022 17:53:51 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2105.outbound.protection.outlook.com [104.47.58.105]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc03q5x7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MMqL267o8Ts33O35IvyhVBr6C7CpA6GYvw4Mv4+pkpMqoyBRH43i9DZAh1DaNa4OTmi7cXE4wSK6IFDqxvOjtCWj0FvJbpWDLWhqDKD6wH8egcGegRKumEthHzoIbqPE5H4aLo2QsMm3TltUwiBqyOnvKCYeTMLGL/1yjjp2YPy9b8Q4stZ/bRYXRJKkCwk0DUFUqW/hKwjllca7jfUsxVUw/HX4TBpjYb44dHRx0AU8FH97v4nK2RNNQ54E7BYUfMclp7tJYVWpWvOZQqayW9h/oFe60b/qzzv75sbaSKvyQGXWMoM8KzRaKqmENWoydknOjtMNbN1SWke0u4lk/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=JMMWtd9DwyGfO1igmZaTVNwQ0aJIzfeNWlYS/fG9Gkw=; b=QWifzdWoQqW51oJzQydGgi8sHoYzhRM7q6JVw0nl7HC8wSXKGh6xE7ADp9wgUUDi8zPjtFbE6S1XH5Y5NEvYMo569Mx21x/b2qGDAPhyQAmy/zRnxkUAgIPGuu1Gy20fT9dmmYHh87KR9R2TrUU5l5Ny2NMczK1A2QDstCzqqL45em+PYKVWTYtP9/+8KqCulIrN/MRKSp2FGnkyHE3wsXp5ngzr999cGddwUo0BFaJYy+8qAkIwGKCWMqaxyMspe2Wt5lzZc1YfsBsbR/PVltIfw3YKGpgTcDe0BOFNAzUrn9jhuARvrPsGQsi3whQ0UV9CunP58ynoK7xpNh3D6w== 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=JMMWtd9DwyGfO1igmZaTVNwQ0aJIzfeNWlYS/fG9Gkw=; b=k0konUG5fMoEDaQ91IHzczYdDlqbWPEvl1n3GObkNNMHzsTaebGmTXNbWaoNsI2l1AUhzoIbv8a+8QbtQ2lDq8cVPQjxwl4PwhAqZdtIUR5HUMqfMUlgCtR/seMIlVG3Ofoa8FutFO4doFvCl/VBAHR9mqQifTQAusdaV8XT3fc= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6824.namprd10.prod.outlook.com (2603:10b6:8:11f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.24; Mon, 3 Oct 2022 17:53:49 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53:49 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v3 17/35] scsi: ufshcd: Convert to scsi_exec_req Date: Mon, 3 Oct 2022 12:53:03 -0500 Message-Id: <20221003175321.8040-18-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR08CA0002.namprd08.prod.outlook.com (2603:10b6:610:33::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_|DS0PR10MB6824:EE_ X-MS-Office365-Filtering-Correlation-Id: 2df87baa-31d5-4d79-fa48-08daa56839cc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wSviX/H3gqbeL9oBQ1o/BrlXdTEBPLP+x6IvB3/l/rGNT8qkE5WQO8DmzIn3+WI4UGxdUpyxZ3fUH6WaBxulMQ27gMSFq2LIFhnPqE1CTS7kXoICV70FeYzo4Ao2Q9vUMnM0hi3RLMXYCYrxOUcyQMf8LKwoRAvQvmKNecLxpnUIajnLnSAsF2nBa7HtIK25ZZwMRM3k86rW80y5jKox+c8sFKSzX8h7SsXnK3K1LVD6yZ9TCRmyCUcBVPTBh6H1tWTd3/K7cg7hQtu/gjkXfKX0JZeN5aNAj3UwaFe2hF5qO143sOD0Qthctp0cZMka4Zz/RYUd7bR1hq3g41yCWJKLa8/dBC9qzuShudFv4vKhILIXN8a9DIF0hxgbczDQIAF87nc90WhouIEz0jx9WkULVaGsNJUN23z4L6NKjR4mZA7OpW0xaohRe+L6olVo+Rw7DxR8MSk+SKjt3c+82l1nkwdq3IJJh7hKbPpp7Pqc38TWtm1NUbCN75vjxFrt7QUK5vi/suJJQoI64AXzOcQcXbxPCdZ7Gese6Qua4NcCX8xM4+JFlP/bdNTxkuHe3Sirgh3V9CQy6+yininqw+cWsW5Zh7hDeZMNUZeBP1B1vA64Nqqd7qUZAhB60n0490dtASMqAAgr3X5f/lyMoNmUJTQeXfSugt2aiY3RUlFVJ/tdjzXlQ/xAZJFa2fl7gSiDVSAgPChqFZwSLi29cQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(346002)(396003)(376002)(136003)(366004)(39860400002)(451199015)(6512007)(6486002)(1076003)(478600001)(26005)(38100700002)(66556008)(86362001)(316002)(107886003)(6506007)(83380400001)(6666004)(186003)(2616005)(8936002)(8676002)(66946007)(41300700001)(4326008)(2906002)(36756003)(5660300002)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LInCykvvp2kx9vHhfO3ZFIGeNMMoTq0DljwPCSFq2DcPkAkjtFiFQ5tkMVMd6IArESWyaZfQlQifzRmKes0ZS7CGHs8Wwz8jK0+qJ6ld5jEEp3I3YNV4Z0YR3h0Wo6u1TxNsbZikid/jY1zjeY/bW4PFJAt1TB7ys4tVW9nHV5Y6KnkfCp3YQDb1sbFpRumo4c0D8p2kPR9MxrsZo75BIvvmNQg6wBIoVq4eIq2vwVmEiQcryxKTlQlKpRD9tvBi5XKDHPKATF+p/Xq8rUpVHZ2uz3NBIOIHlhc401pX1JmM2DSHHOe/qBGO76y++AR13/60WgVW5k4j/86G177S2hBEHBkV8b3Z5riNqwf/XmnLXfR90BapmUg90vpT1i2WIywAb8W8EZS/o0u0uPtQPo6SiRBn1x/IqSas6yts0X2/dwqbc/ybT29TgIGR9AnnPRDLeY3uSTKwZuweQA5OusHezEWyYcXHjyMf7fILqbZq+qCXeDl+7LgphlbuYaqZi077Rt6TxD+AfuohFIGtUQvHDjOau8s8d4YSx1GRV/B4DNFpf8NZ1gcElVf/s/yuk1xrUgskHaBAjtu3vPN81HDNnlmhqlHCR2XFoSXeDGQ0nhodr8MtU3I+LrW6v/mkoLI5KBQFBHQ55FGDAeH1sWbTKKeAZ4n023qoeiGyaAG6MfujV3xPX5w4drsH0JJur+t620OroonHhRHJE8ItCCmYyam5PE9tjnEmTNVDLCF1ws66LwzATRqIZk2GzmjqIG4CEyowh1mgh1d7FsTFSMu0r7EC7bnunHCRodvxMAozuZxp7ohKbSczlCVMaUgV9i/r96Dm20YOOsYkjWZJg/K/H6feflqCYs1gJBKA45s8JpefSXURmPuLAIcMtqDxBcPqKS4jqLyWF2MBr9Gw6JrgGJr4MQ/KSX8K5dKSQS7/nJJFcgksV1fc75cTHUUjwkrPBnnIGSyukBGQee5yB/jrnnupor7++xXG5yEWWUDweDih3Rwm0TKL4GcRERslkSeclhdq9YMZ6WucElv7shlD2gYXNGg2sneri+FlJ5hpuVwI1iHYMjmKKToaYhDUY0v4jPHlhkcycMVTPAIWkvz6kGHs18do5iz19NdiDfKnxmQOgljuIrn0dDYBSZXoIL/NNWt8/c690ImOVcRuEC5Alk1IjM24iMrbZyLDQWvE6aykz1K0ptCs60XO4KJAmPsSd6iAR65Cp9pZKYCV5S8vD3msggJ6z1A68Ng5BIJsWoRwD7oW7iVjVCsG4Tv6zEZiHlbR2UIiTA/4YUzHffPZydZQ93SD39u5Xl00p0lnvJlLBmT1VKKXPOFhfoyzxQQQh6BQ4qAr6tUgCHLDkANFfBlQR+kIUl/RNumYVyt06H9/4EmicH43SH95Z8dzj5sjJsItry7XsFc6tyXZ/aFWFZTXBJvMn3hxnxrhRVzDEv+DcW6d0xoMwVV3df2i6B4nKaZsYg2ne/U84O16hfLMbX/mbosWAt53i8nzYvQFmmLFh8MDiIkvvQvMMUZhnmunRI5UEgttK+X8XPG98gPtjfVPRaTCw88XW69MujpE42q9jYu7vH7fI2dywNHGd6exvgEk6Z+lxPCrsfa+sw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2df87baa-31d5-4d79-fa48-08daa56839cc X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:49.2356 (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: kCjMN8J+aOobT54pFtignRXkdqVvI0tKeygdnqwlDwep+pvuPd/Rkewlz4JgD4VcIy3yOiKlFf80afPq2rJeUHXe1jNW9TRMyXkWcnwx+yY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6824 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: gPVlRs8gZ8g2LnKd_xeHJIxPnQVsFHTG X-Proofpoint-ORIG-GUID: gPVlRs8gZ8g2LnKd_xeHJIxPnQVsFHTG 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 Reviewed-by: Bart Van Assche --- drivers/ufs/core/ufshcd.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index a202d7d5240d..fdea6809ec5c 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -8781,8 +8781,13 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba, remaining = deadline - jiffies; if (remaining <= 0) break; - ret = scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, &sshdr, - remaining / HZ, 0, 0, RQF_PM, NULL); + ret = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdp, + .cmd = cmd, + .data_dir = DMA_NONE, + .sshdr = &sshdr, + .timeout = remaining / HZ, + .req_flags = RQF_PM })); if (!scsi_status_is_check_condition(ret) || !scsi_sense_valid(&sshdr) || sshdr.sense_key != UNIT_ATTENTION) From patchwork Mon Oct 3 17:53:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612512 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 F39D7C433F5 for ; Mon, 3 Oct 2022 17:55:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229890AbiJCRzA (ORCPT ); Mon, 3 Oct 2022 13:55:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229917AbiJCRy3 (ORCPT ); Mon, 3 Oct 2022 13:54:29 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 933DE3A491 for ; Mon, 3 Oct 2022 10:54:02 -0700 (PDT) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 293GONB3006557; Mon, 3 Oct 2022 17:53:54 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=A6ZhTzLsw8G4Yi/nEZu8nSsBfMpQmeRCnCLGTZb3kXM=; b=Nw+SHmGNFJI3dgWscppjpX5xE/OOHN7uusFb59CzfkcitzdqRF7JRZmqeNtD71Vtgl8S SxMz47LJXqdzbh8weadMfI4Qv9CCJHit2wMsOUeqHPQ6W2mGGSRj2Kma18EFWtxl8mUj uwCsNjb+eQjcYng+O1p3xr5wzgba3/H4KUfzy8sVeQ3dS8NOYZHIjWIHX0k1IBW51ZgT AN6ftUoha7pS7jEpqhgg/lcHW/RwprdFZws7zo4OC8pRC5AgEXx3eSF08AZqIh4pv7eq P7QvOtf9yfiUbifeqslOUK4nHD48NDPAVQluaPvfDTWJLjAE6ywWZh+4dIbApxVBVfr5 OQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxbyn48tr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:54 +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 293FPa5s014093; Mon, 3 Oct 2022 17:53:53 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2102.outbound.protection.outlook.com [104.47.58.102]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc037ydf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dA0YwRpGzt2JImPzSRzmNDkAETikS9VydR5R01rC8W8NiOrdR+na3NmLL/BlrZH0TCfMeJW3bau/bVzjeXsz32UY8ZMWNi87VvIi2PYzyIytDty7zAlJnXVwBY4Z0yY5I0Abae6mEqRQHsjQZnkYdbLTtSLNM8vcSaycjZSY8LGsRqe1txwvth8RzuEJ063tKWqMkdfI/5/OWHNuSnmyKtrKEPyX0R3ew9UlavguD+G/kqCx7t4Ox5CYke6Z5ADM3EEXuEBDYxMAXMy/TPyBqFwXhw8UWjVoQNvEdSGfKObkX3ZbltTC8rLagVH9kNMWKJLP/zKO6M0x43JlzaMfrg== 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=A6ZhTzLsw8G4Yi/nEZu8nSsBfMpQmeRCnCLGTZb3kXM=; b=W25pvnyq3u23K0EX6BuFAmmNmZBuw83/jGSLHnLrgHIsIisInxxMc+xPuc86Lqxnb2edpg9zI380uWWkMltxnaenHFdgyGM/Zm2dUeja2Yr/zyLA1Sw+Kml3jq9CypVc+fMmsqeWV2djrs1Gn0sIkD6HUFBD88itP2hC9eBF2FRTR/KozcFRD88xYM7gPh/f7om0vDwuJvS2e2gmM/Rldkzh3YiC9pioZ1xUy/J5zXYq0JcNPVxVzA4CIllhBc3tJNiBkCKeK92pjITbPTucPwYRBXaLPlmtR4YEsXcbJJgEv1FgXgR3YeMlbva8DdBwl/5MuFRhW5vvCOnVap75+Q== 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=A6ZhTzLsw8G4Yi/nEZu8nSsBfMpQmeRCnCLGTZb3kXM=; b=CAJC3HtAkKuJJboQI1TeL70hQJgz7FUkShgWgBzuyMp6mke1vCPtA6eA8PK75LhoSuNNJYg1N9dOlIcQV2BjUVZKraT9EFcB+TEvAxY5oJFzyD4PeOgn3lToLFk5XqUeH82Ua7HrR7xd6oMYRy1UwRPK6Qk7vdvSQgfDSgHZGWk= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6824.namprd10.prod.outlook.com (2603:10b6:8:11f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.24; Mon, 3 Oct 2022 17:53:50 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53:50 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v3 18/35] scsi: cxlflash: Convert to scsi_exec_req Date: Mon, 3 Oct 2022 12:53:04 -0500 Message-Id: <20221003175321.8040-19-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR18CA0035.namprd18.prod.outlook.com (2603:10b6:610:55::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_|DS0PR10MB6824:EE_ X-MS-Office365-Filtering-Correlation-Id: 53641ad4-d936-4167-b059-08daa5683aaa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wCKFHjxBedGpQc0275eojFTES9DKCKW2V6SSVGTwhkx6sAvgTPDiAooCB9Zr6T6yn9OEGEh8CpQNfQObhEivJqM0bRJAFp0DwvH47X1AAI2nkJWq2hIMCQWs14aDqfgK9Ha7e415Dk7q1K3SbUjMS4in+Z/Z57RVsPRmovxgLg0YWuZ+CVv+zMXny6H+cg5vvD1hFo4T4x4uxNEhGDxRayHXuw9Cb/kSxc8e0Akh9m+m8+OKIqSU5L6nRGkmfBFqCe/Qp819iEHHPnwbLXuup517Zo/35+/AnjBmcPbqheRDIWTnuRi9rJAQ/Peg9lmwjCq7J+CCmD5l7tqFlzNOFZT6h+bgnpypZgdzXH+GFg2u3pXf0eEJUwGJxv3noqws5iTi88Z4JH7VG/FJttNhG7DcREPfZteumwYa7wZq6lBoyxLso927x+11qP/AJbpjEs4O9ESaR0JO267bOl2r5Uq4vfPWBKW0Tsxlag0O6w+BZfv/chyNsEi8jYi/17PA3SojpAkLKgQlDRwbV8Nbb/oICLC3QDkm9fQGmfbKvtsa+rLK0rKhu14Vr5OecjuCGe2Gb98jwWX6uLnaI+htr6un4A6Tc4dncj/LboDtjeasiOwtVt3BZ6bZVNNbigFCbttU58GMlHgF5Ga24hRJOnxJLU3/+0l8uzGtFNtPLoUYM3Y4rdZCeehqKj2ugd3HLVMgcgIvIX8MUj8cxmYTCw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(346002)(396003)(376002)(136003)(366004)(39860400002)(451199015)(6512007)(6486002)(1076003)(478600001)(26005)(38100700002)(66556008)(86362001)(316002)(107886003)(6506007)(83380400001)(6666004)(186003)(2616005)(8936002)(8676002)(66946007)(41300700001)(4326008)(2906002)(36756003)(5660300002)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: P5Z5goAWKmxDlYqbXMBA/T+yaWfNCamGOhS/7WMD2qIwb0GThVQ6bz1WDixbY31JKhf7renOja7PAHTzhe/IjIt1W//sU04ugtVpnVrLLW92kTo5wy0wZQjNfLHoZuDm+tdS8kowprThzJv/iqULl7ueqtj8cRRjySa6M8D1LXaG9A9iDSKZmDkeiN/wjPNDyZfzpXeUDL0hEH6jfH7yGCzMC5wb5H3l7Rl64gnctVhe20LLan1JCI3VunlOcbGVjdw2s78IZNFr79+ukZ+SjGWGBbCgQ4aixGD9kWDzl32Bm/6KmWcgTNbuCd7Ea9NfjLK7ZWpD4j4CPM+X+UEWArzTnyvnDhmjGhmvYliXhBh/HcTs0+oKkvJMY09u4IUYbcwtItbS17kI7ZlEf0QPcmD4VGh0Rf9K7PDPZmPDx/lm4bZsnqn4uoZypCAClwWGXxxctuIR6/3Cz5HR5tjjsVT2D2kthwKUT5igcZihVhkk5MAeeg+yml0Xz9tIz51GbcngsoNDtLfNPC1xpqXpS7YrzChV/wGQ68YE0TED4DAjrBbJcGREI6mNUwwpfDddSnz9DoHEh5gi/8N2aQTjar0/+HOErDxpImF5Ynhol2yUSZq24I4jH08J6bKnqOLZRD9/458eVwsuYCXDM97954movXRlr7fpn56+LTOlB+b4QZ8JIfnAO5HY7eDHs3LsfH9y+dgziuC1KRWTMvcPKxE+e0COwzOuxGf0pAv7yxuH3PFXmkriTXHUr3LkR4I9yoNhWkshZmQt5di5uHa90UolFWyWyhO4wSIZnm+3xWTyVSaiYl1N2DUIx1As+esqX2/cgGlSjD7DUtGwCEuThvi6pfVIfrCdeL1BLf6cxV9JB/4P1A1Q4s5JujfwSCigGeGzH0B+H6j2RlzYNo9onH7rOSD0mll8a1Sv/VmBJJ9Q+tOM3RRkztHSIu6fSaBuE46ykrSI3JnKUtGSegp30ZHc8CGOb51dRhd+MebUeFMcj6zPKku8BhSBaA8oY9d+Pv7dEfdONFCRtxq9YAf1HheIr1T4TEXzv62j5qO6X1kczPFevIDTviy2cJyGGpmU7AJsI/d13aOkJwEP0h5PvdjlsSfnyiEGmraV2o9OwYXieeFVcV637xAFEWXDdNjExe8Zmhtmc7gxVfx52PKF2xzA3NrXtXuhJl/MAWF5SsF5IjUBV4syskmm5EitHYl/pTrt8R84x8iHVkzNYVuPb555AsQ945Qq6Ts4CI4nizwPELosVx/ZqNpz4a6FRIkifKsXGENsT7GJ8EUr4JEZN0FGU1hx2+INEOP/F5ecjBkOKRPBXj4JU0RKiSwXQJhd3ddmRAS2hswwRwESYdx3xAPe4PMHki6PzphIw++tQr0utUOG2b6oIlN2uokGVv7t2db+dCuKQRAsdzDtQ/ftiT/33Vnyu/NqQX8LxoP/VCrHoe5MPnwF2J9QRu+ZWkYRkcmlfdMiWOc5DNzBTsl0gKYv7AyMkxavYyZA1hIGRz+iAQ94uheG6xsNEyPVoMz5PETr91cdIjVfyP7urBagfVJ65FANNUhhMXWEsfPBNd9FeQLTbmC+zVoSXVpJhkslKYhBT60m+WbQ3yve/l+Qrw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 53641ad4-d936-4167-b059-08daa5683aaa X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:50.6730 (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: iJ9L9qsj9KfJpLxjQSZFYbryR50O+/t3R7Adnwun20OzY2dWmZ41X5vtySm9GBljgxjs+NkskVhfEJ+a8efLFAKUhpKquLEoWoLUKXdAdjY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6824 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 spamscore=0 suspectscore=0 bulkscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: 73-IAO9fxbzeZfFA80WyEQA28xyz6BLl X-Proofpoint-ORIG-GUID: 73-IAO9fxbzeZfFA80WyEQA28xyz6BLl 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 --- 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 Mon Oct 3 17:53:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612144 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 41533C433F5 for ; Mon, 3 Oct 2022 17:57:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229983AbiJCR53 (ORCPT ); Mon, 3 Oct 2022 13:57:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229900AbiJCR5I (ORCPT ); Mon, 3 Oct 2022 13:57:08 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A3A93E77C for ; Mon, 3 Oct 2022 10:56:09 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 293GOXes015770; Mon, 3 Oct 2022 17:53: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=W8LPxGOI81rOGt6qgnUTWKWB9FUN2Sc4p5s3xAAL0/Y=; b=I4ysvszgzm0i9GA7OeDGaq4fHST1ax7E6AXeojtfwR5pmvI3Bd0LY30s0KQmLtOES3xg uWYLwaospfanCMkvVmDU6X9xggaSa0tswtRhuBkcwkuuQlR5nlo7lLH6uoZMVJAVipag XqPHEPlAT9nIslVNl/MCgE0RnFivYrL2GCz5mIl0GP3edGRwL93zrcd1MsXqONUB6AT6 fqmk4w+pa6XA95i9b6QQxmhFZhxMg1WWAsgxXJvg7WA+Gp3KHcsjqDyVzWDp5UYskR8f Y+ZRxEk99LcWpT54TvvRfCuS9hMckBr8QaK3x5fONjboIPYOvI6pXqze4clelDx5nYVc /w== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxdea4cw5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:56 +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 293HoXFN015597; Mon, 3 Oct 2022 17:53:54 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2107.outbound.protection.outlook.com [104.47.58.107]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc03g3se-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SNvsTKV74hySkBKl9OUyKEMDCfaFX3eRFY5JmbSAXACZEjbEm0AQNRvIhchGk2A8WT5PETkaLigevr/orXX1t6f68YtYMgsaJLkGyGtXbs2BzbY6d+wDyRKaw57YZQOD3eXbg6pbNytcikRRIAHF0RHPOAxPjqMyjJdnIbFcE0W/eij9NjbkPqcEDRKwtVrQtHW/U40WJ57DPCYk8W79JsKm8Ift+tnm2h7EenAgaWZl09Zt53hdxwvKb4CrSnto71avTB85a+hsSsA0DTSS7J+WA/Sk7vFE8cLMVvnvXaWU2uJW/7uROa9Tt3UIvseXzKaUtH15iQx9+F9Z9il0fQ== 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=W8LPxGOI81rOGt6qgnUTWKWB9FUN2Sc4p5s3xAAL0/Y=; b=ZY+ae3jKB3lpkiwXGpMa6VBLGhdZDkhwUSghLMOzfUvd4cDZgJzZ1c2hHgUX2rec+cH8ye05zFLg01ZLRj9Ds+gTjeuIEuBHwyQdsw5mURXoaXSDQaIgkNqX7FELqhC7bbuAbYhZIok8QD/KyzrkttAC3nZXH9DhMNdbJB/fyqlZQX2HLRLLH8IRVEtJLY6Xl2z2O8hOA17kxcwCTHLyXz46sUit1xDgmGS5fv4ch9iGO25gGY+eOkaBf55oeUS1kTop8+4JZYg30nOjxEhKjohq0nYJrMw6jsXthTbyGL3w3DS3gHvXZeh0IXJbKGIGi0hppyd9Ws4ps5eSK9cslg== 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=W8LPxGOI81rOGt6qgnUTWKWB9FUN2Sc4p5s3xAAL0/Y=; b=mfdfrJvfr4gf/gzo5TU4YpqT5cN259bM+hYn8xZTVs/D/5N9ppwUYZuT43r53l+HcgshVqQiMZzE41VevuwBQpae8cF/vpajTVSAyijVD8L8caJI78JIsGrMboUvUZIMUzKpKT/N1SuvY3k0vlav3Qee49eVsftBfuhwqo7Wdkk= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6824.namprd10.prod.outlook.com (2603:10b6:8:11f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.24; Mon, 3 Oct 2022 17:53:52 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53: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 v3 19/35] scsi: Remove scsi_execute functions Date: Mon, 3 Oct 2022 12:53:05 -0500 Message-Id: <20221003175321.8040-20-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR16CA0003.namprd16.prod.outlook.com (2603:10b6:610:50::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_|DS0PR10MB6824:EE_ X-MS-Office365-Filtering-Correlation-Id: 8529741a-8638-48d1-74b0-08daa5683bd9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GmZw9qbpF3FoaQU7OLbB2p1DdcYSpgoIWLJX/5W4TJJihoXPjalDIDti7jNZTQ0oy2cglcFBQRBHuOHfDmuO4us4OxRflJscPegnRt6Y5nz6C9a+Go4L05b3LHNGBXCFGYmEf5lJzpUo+CnvEGFmi4ze5OB3K7VZYdrxiKRmmxFNwmAzqJRkfIq/VeNrIqnK3BvqONsVVm9OGW93tf1vExqRggmsm753/yDQwF3aCBimzJzFUaAn6itKD5TLCkXje0LRgx9Etf8gIPOFjdu2z3STbJNylSwicDPDCZd4VpJ+PMcQTZ9Mlr05eGi4NgMcHBFQJAgayv+9kfSxYvkCOdOA9hPDl9p/ulNjTmjpUi/csoOYuXlPsOzC63hPl23F9RC+pnX89exJNW3/I1GqLG/YqfzXhSM0SuIYOClHNqFRq/T1gqc6KrWWouZR9y9Jcp09EPNaDPUiKU+FwaCt6GjFx1MkFLc4V01B0xiD7+RwQc6b1tnmm8rkJrvXBDWQ7XjgWxBDj61YEl+M98z6/mpRHHF6MA9u1B3pEXPjE9U85uTAvc5VHYIwKYGGVxW7vLbxJk5TlGyDr6aETv8rdnsn+DVg6AqxV0KnIEggPApXrr7UQlRVNkj8mt3kvDTPepJ5kgLtUudMKuks2MKkyiiA6gTGdoaFoWqYnYIYVQ/JBS82CRYKnFEEig+MUZzkT+SFLaJBP1haW64sMDmzOw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(346002)(396003)(376002)(136003)(366004)(39860400002)(451199015)(6512007)(6486002)(1076003)(478600001)(26005)(38100700002)(66556008)(86362001)(316002)(107886003)(6506007)(83380400001)(6666004)(186003)(2616005)(8936002)(8676002)(66946007)(41300700001)(4326008)(2906002)(36756003)(5660300002)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3u6C2RZFVml3OkkU07npeqWKrqXU4OnQDD5FwJIjAxZF5R8EYYGSMCDjcflWm7CBx6qiQE8wWFuJZ3F3Aw7MbGj2FPWG4zDlz0P7N+K25qVPa+CvVK2Cm3ruZ+mOIf81DfbLUoNeWpH4EyCGxDSDRSTSUSb+6deIpxBNHdw+hBp5stCwparXrxT/k4NOy9MOHkPo+XVZVBJld7StCwVJImTrgEOfDU3Mm6j90pCkZTKs+GlOpTlsuY46p82rxxEx6MFNpQJ8TKxYn4sgDXyMzzv8xTwo4Cgq6wp4rgKLRwDL4gHpaO4HD4VPZYZXx8Lgd8qJQ/4gGmIT+ivMxYCp/y1Kx72TXaSD3u/fqY2a61hQlLGpxVl2lZFe3wLYC6vsiXqXt3XJLv4nZhmcPX0DTHamPcXtdgsxdq1Tphuj3Ayx1CggLtdqseTjZRDWVfmIFu5yD0yhRkGaPUh61DDBwF1BoTkhgjHFhkJQZtWYWKmvP9N0D9B16Mfqc/aEshDjRMcIitMZuiPJG2jx+X3HFyV9eEIwEAZxyS9gkSkWnSHdR49kV/WdI7voLcFJ2kbAtuVrWtyxptnTf7wiR74Kz/6UUh+3x5vSQDQtD3iEhByjlfukD+PDKQuN1G2CiWfGEu6EW3ReDcdhtKr8CwmiBtD0BWOZ2UvjwA39gbLQydsnsBkSbSxAv/X1yPgMojaIKTYsmxL225+8YsOB7w+ZSGA9UUfJ8/prptotBnWG0MGK9yzUbOakQ7NQg1a/24dfw6E2m13amQlzMv9hLC0y49Ue4o9Y0gHVeUNWRhP5jog6SSyCaNs0ban97NLfAlTmqzesEVlbqAWryM/riVXEJPAxmWu6mnqgDAUfcwG9tHkkBuw9xQfO7mf3yXPD9sajtzGzq+A2nKxiXiP3BggJLp8uc6IcoDOK2AoizNw9R6mXJ8jD3gCrcQgh9NTSOC9xeT6C27uWjm94e1l8KV3+R+H8pyi/PAeJP8oTNejvWMGFVNC3vxiI/LyufEpWi3ABKJZc7qxKuaPcRTQYNOyxLKtyRMt59/QyBkYFbq+5QeCDjYTo+aZPPsF6DcrzOXpDLROJc63aWEwK2HXl2LOqn+X87FSpCFT20UMOGNCnP1Q8pT90Fy95m9eGFBV7CC/6rJUXdgF9bD8HZy2eCT4a9YjifrKMBUpojZSu9W7oZ3OE8DPwcjTVhMP4tFT6PXYcgzMGvS0aFbPXCjdGqfZB7tFCssnKgvY8RbSUGkIjDu3hpAcaqply0OsOfMaM0jyn33PpDnOnWVogta/33dd1bFq3YRnmZwSP+GtuQjZUR/iDuhiReWnngunZ33SyuNmXMQMy9XPB5XtyQzDJZE1m3Kla6Ekb61QjE0Fqg59DEG4HwNn/UdmS2byGksr3ZCacg/n+ASe/vVvVWNPStHvkFQHmt/J1PmoxQ4U2XARqCw9lot7LEC3kajJ4aIRF7Rr2RqzMG0B+qqxQHG1ObeiqPCDQcWPxdm7k4pgGtVBOwF8c7XHQx72znmu7OuGIrwbar1+n36isOn+Jfb4rEftLGQDdP1BWYsLWdGSirrhOXGJ39E1rlbGLxm0aV4XHVYUMzIm2RrlwL4CcADlQtsRMwQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8529741a-8638-48d1-74b0-08daa5683bd9 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:52.6572 (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: zJoJf+F27LeFjqj3dSPbGgXXMBXJq+N18F7qybcqn2H7w5XR1A3qCzOPnxNcEG+HTctzaokuXrBxKrqJmje4sPBoSntYloIHSlbX5qTeBHA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6824 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: 0DWyWJh3FHZ9svdvoxMAK6Wk2q9gPx2d X-Proofpoint-ORIG-GUID: 0DWyWJh3FHZ9svdvoxMAK6Wk2q9gPx2d Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is no longer used so remove them. Signed-off-by: Mike Christie 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 6d91c14527aa..986decdeb725 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -481,45 +481,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 Mon Oct 3 17:53:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612511 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 0A862C4332F for ; Mon, 3 Oct 2022 17:55:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229671AbiJCRzF (ORCPT ); Mon, 3 Oct 2022 13:55:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229926AbiJCRyy (ORCPT ); Mon, 3 Oct 2022 13:54:54 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BD043F331 for ; Mon, 3 Oct 2022 10:54:07 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 293GOXet015770; Mon, 3 Oct 2022 17:53:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=wLNiwb+Rz0d36Znq1wimxZORUdX0+ai6fN8vPhgbdwU=; b=RxbXxjdnTcz+4BH+mDxp2Opruv3F/UQO9dUMJWOWBzjGovAlWvlz5z/yGtDxy07ugqiW ScbgE5Jz2ZCjpoENOQ5uv3ahRJYjdLwIuCydqnsmUVKfv4HIy1VP47Cg1PQseaQWgc/9 LXB+f0kvpZirgxhtYz7hKj58tzEYO36peB41kYpmM8yHdX7UpRY680Cm0Cg9T+JxVOkG hZMhNRUjW6M9n271+ZLG1G5//F8c/ZUAk/VSN53dVY3K7WqOf5lQb6d91M1SPbSoXfr2 tgbRXjH/cqDCu4kOYhwsvx7PZ1bh130AFMSSegcROf2JOvARQ8Jt2ZoLutOalRCQ/4vG /w== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxdea4cw8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:58 +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 293HSotL030286; Mon, 3 Oct 2022 17:53:56 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2040.outbound.protection.outlook.com [104.47.66.40]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc09rj2n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ijciOF8k+GPzip8QOouGy5IJSQCk2BS0+G9z//p7iYG4W77QCgPEfSOdNJKqeMfX68LAlz/9BNlF5Ldjrs1tCSVeYR/o+8cmvgEFPwVYzcMZyNBywFApyQjZOA5FBhXYUy7LwTmeMN2ynggX1TaBJU8Q+7is3wYFi4t0MYoHAlXSKNQ+03MlVhNFF3Y/zWHcMv2NoLzJMdOwv2lrQHVn3YE566mdy29doFbiQTiQDY6/kJZHJ8KUhGZVUIKPmbEt1u4MZQoiMlRACVRF8L6JpLVSbk04IxinC6cJOSpYDjjvkhgZFGdZv5WuPnP22vK6EUY1CCd5LO47F6rsUA+MDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wLNiwb+Rz0d36Znq1wimxZORUdX0+ai6fN8vPhgbdwU=; b=g8kT4qY7ooJredwBtQa2Zb/+2zd7+fxh7rt5Ic8AcbP73arf/yFqKpozZrgJvQltwV+WOqdmARUgtTQEfrp/xLLKiBmQT07qzfoGF3EQR/6w+W8cD12qRplFkirqQmvLHGCSmkSr5u9/7K/y/obO1YlaO6q6DP8fbJ2QkKKR3VVMGoyTpOBhEHdfSA5xmbSMOQ6bp7/0Nj0Qbfa1GePykeqEcFK8lxBGGi6Xs9A1dF4+BXvtptUMiNguvb/XNJHV7ZViAUK46rC+foLdihDdMvpRSAwvs64MXhHOTYHpdUBibzhfBsKFMU5cFfTZ5CI8mqSVwlMUuXpCHxwnkahqDg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wLNiwb+Rz0d36Znq1wimxZORUdX0+ai6fN8vPhgbdwU=; b=pzM5opMHMdYLvuGoygoHEzfJdYM2PQOqsG836QVmAV1TLDqCEDmmqeO/+sokhmZtxVtoq5OjZxPuEa+e7grznqr4o8R27p/+6DqWOSWUz+eh/6gvp0PJd0OWJ/o1pi+6gWoUHrKJFvsaNYu83XXnJwF2YlkUlUGUCmcqtp3BAAA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB4456.namprd10.prod.outlook.com (2603:10b6:510:43::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:53:54 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53: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 v3 20/35] scsi: Have scsi-ml retry scsi_probe_lun errors Date: Mon, 3 Oct 2022 12:53:06 -0500 Message-Id: <20221003175321.8040-21-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-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_|PH0PR10MB4456:EE_ X-MS-Office365-Filtering-Correlation-Id: b6d0a24a-40ac-4b1c-662a-08daa5683cb2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XKVldENANsPJ168j2QKBBIU549JbDis1S7nFnefu+4LT3geH163711FEpQpzjTS8juQflNrjXhrIBTRVd6Dav0TdIorSleRVarmpVI7qjeRDDpiCV/Y6YJdVBmO9bbQGPUrh4B6O+dCWdVioYFaMFRMdprz4NMxK0ImzFISCQpRoEe2HYA/BtbDJwkGnmHvfTH+FWiL3T7ZbbsyiMvKMul7TctOVyPiWr6Nd//SzrSQ7jzLTeIuHjjXMXE7uT9/CAbeI9XBx9+rEiT6sA3RQIS5cqPHtJ37A8Yz47WGN49o13THcpr0TsA3UaDj4as2bsxcSAcimJj8RMZv3lw4fkfbre7Hgg9KxvVdXqy9jF/YscsF9qEvMCwSVOJN0RtYab4N07zRjsMjkUyCJwFAbjZSHYQ4k12d9+0JDUP0QFa16LjPsjj11gZmAVugANxUikgtEqJXl+C9+Ryxman+Ni8KBrUKYbGDtQF6J5O/WyFVe2NblMWbS2nvgAPWbhOuQQmuq32FzLrNC877SIT6H5N2Gz23im400ajeokUio90uYs3ld2WETKfbzFBDsqT1BQ+8+ZhPlvITqFcnBUNEwf1v+3LkrAZWEptcxfX+bjSkLiSM2X2i5zKxQbAcZElSCJsfpHbjBEJbxJagvLnB53nVlImECvmpCanfXQDG87RTEu3WaBRCFNCQX10h3g+Sx5EMtcQDUmTghMcBWV9nBYw== 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)(396003)(346002)(39860400002)(376002)(366004)(451199015)(5660300002)(36756003)(66556008)(86362001)(4326008)(8676002)(316002)(66946007)(8936002)(41300700001)(66476007)(186003)(1076003)(2616005)(83380400001)(38100700002)(478600001)(6486002)(6512007)(6506007)(26005)(6666004)(107886003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9m+7j8iCxDK3ex6HJbWln04LFDM15xhPoSeUMkm16EV28Y55+3XMcySR7Uq9C4PmOG9XqrXdP59h7YOqxaSRTX9U/1EqkkX6Jhe9KY/+GmQ7GkQm+fnzxmZUPCzoveXgWRPHjIhUTtjQ1J6ezClh8KdQkIYcq0RJntfjwEFJ5KzPN4sUWFF/4XXsTN1NgfJs7YkdEAWAye/uhwP9TzmzPf+xlPBQQ5LqDA+sGpOpFSjc03vZuHDri07AInTL8KrCDIlV7HqvOWVgWK6KTo1Bkjd6KU9sMY5U6kfHHSEkXvKJluYx4eJejUdO8DN6cTJSp7cq2ird1Hq4eNOaFGW9eUiVTwSa3FWZ9EGBUyIKSYaTKU8Jd/FeDN8vOgLdqdOrtS7zR5907U5HdPDcCYGEdPbe73YBk0suOASh4oavCnmA34i6mm5YC3x+O6lVfkS5sg3CFr1vda8l7iLjy/INoRNFHVSn/Q1ycjQrkq9zMbIL6DpWLEOPQimpYK/N/QaSI01iGHaNJRiQD+HgwwmzBBx6ZO8la1YzkUrZNJ1fT2/fGq2MP09++TX7mIANtUsbil4BadVEQ1EUYJCpenBXpBrO2zdTq6OM2+64GgTq+rQqb1kpjqFP2lOHYeU6/FImhi+hN1mubh1peQk3gt/FiPj4pfpsW1dhtKLhML2zECwazD22Eo3OUymYXqMyjCQEUCeQb2/Jlo4nMH05Q8GXhxaU+S1xltcEs4wL/96y1rSFDVHFsMXX4VYuoh6LJlk5ThSKrMwfhg0BC0riuKvYZDS3aHtB3FhReiFckjByaF6DWgPIc19yNlgh3VQyjMbqyoLfYjzn18hiZOyVDCK0c3M1xxt71AE5Re43e0m0/bF08Lh28DOy7Git9LB5jZurzCgzPiTmKNcv5n8ZwvM5sjRhCQeUQxG9daJ9CcEZTT5x3+W3Rp/Rbgqe9upSQiTsVU1VQqyl+uOLUFEDj27o8b8XEmY6eEBXMhPBeUwMlVPKA7DdhJkorj8KeEtHM0XzNaLi3CQoDv5FZ07Qd8HJP80QsTKaGCsLVuuRx2RZivyyvzq+/crTApeyqdS4Y/rQD/lVQ+gP3Fd5vnvLryswalzEad3dQcK+2yXZa+YGqYi4eE9BNGznOmTZ5HyxWZLCCOqzOy9s0hQ6wPnioZxwqYndtXTL29WXH1OxnT5yEl3arjxgFXAKmALYmU4LasZxulY7Ym6CR7Mti1HzxGgSu7yjlHQDXiuUx+jEGP0rQ3bSrQtAG8cU+YXnECwdmoGaRn5jaqsc5mKXIbT26WlSld9Huzi933SUNiBMV3eeP4YNZk1x5iI7AennwKiYLlEHBiYHIUzguCipf6juYQ720btSlx0KhjK1bdDL3mI7Buq9sjjccEtCgGnZ2fSH5uo80B/VPdK3hr23Q2o3s+NkCXQpTvYRQ0rZpYxou+rCsNfFWFRjRnou9nqPuWqrvWH6JJiaPlGihY3Q/GhzOens2Dixgm/hkI1WJI7WIIxrYYAuc9puQ9THLEz8U9+KKcwDX5E4qOWUtz3JLaSBblkcjdJhzSKFKMN8ku9hGUAnal6N3ceZll+Vh6h+j4M9+jBNg5fAYqyLgqhjW3glycJOPQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6d0a24a-40ac-4b1c-662a-08daa5683cb2 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:54.0790 (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: xbSRI3SQuZz+JCQLRYIjffx/1xAeoBglyduWqboN8j/BVQnHNiocoKHfBxz7rG8/BaW0WJt1B54vmXh/N0kYLTHOcFv0lI//0ps14i9s9j8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4456 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: 8Im56g5jMRoXmzEGafk_XTkd7qZSzXqK X-Proofpoint-ORIG-GUID: 8Im56g5jMRoXmzEGafk_XTkd7qZSzXqK Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This has scsi_probe_lun ask scsi-ml to retry UAs instead of driving them itself. Signed-off-by: Mike Christie --- drivers/scsi/scsi_scan.c | 44 +++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 58edd5d641f8..83f33b215e4c 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -654,7 +654,28 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result, int first_inquiry_len, try_inquiry_len, next_inquiry_len; int response_len = 0; int pass, count, result; - struct scsi_sense_hdr sshdr; + /* + * not-ready to ready transition [asc/ascq=0x28/0x0] or power-on, + * reset [asc/ascq=0x29/0x0], continue. INQUIRY should not yield + * UNIT_ATTENTION but many buggy devices do so anyway. + */ + struct scsi_failure failures[] = { + { + .sense = UNIT_ATTENTION, + .asc = 0x28, + .ascq = 0, + .allowed = 3, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .sense = UNIT_ATTENTION, + .asc = 0x29, + .ascq = 0, + .allowed = 3, + .result = SAM_STAT_CHECK_CONDITION, + }, + {}, + }; *bflags = 0; @@ -686,32 +707,17 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result, .data_dir = DMA_FROM_DEVICE, .buf = inq_result, .buf_len = try_inquiry_len, - .sshdr = &sshdr, .timeout = HZ / 2 + HZ * scsi_inq_timeout, .retries = 3, - .resid = &resid })); + .resid = &resid, + .failures = failures })); SCSI_LOG_SCAN_BUS(3, sdev_printk(KERN_INFO, sdev, "scsi scan: INQUIRY %s with code 0x%x\n", result ? "failed" : "successful", result)); - if (result > 0) { - /* - * not-ready to ready transition [asc/ascq=0x28/0x0] - * or power-on, reset [asc/ascq=0x29/0x0], continue. - * INQUIRY should not yield UNIT_ATTENTION - * but many buggy devices do so anyway. - */ - if (scsi_status_is_check_condition(result) && - scsi_sense_valid(&sshdr)) { - if ((sshdr.sense_key == UNIT_ATTENTION) && - ((sshdr.asc == 0x28) || - (sshdr.asc == 0x29)) && - (sshdr.ascq == 0)) - continue; - } - } else if (result == 0) { + if (result == 0) { /* * if nothing was transferred, we try * again. It's a workaround for some USB From patchwork Mon Oct 3 17:53:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612143 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 8B1EAC433F5 for ; Mon, 3 Oct 2022 17:57:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229914AbiJCR5c (ORCPT ); Mon, 3 Oct 2022 13:57:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229981AbiJCR5I (ORCPT ); Mon, 3 Oct 2022 13:57:08 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C97143FA27 for ; Mon, 3 Oct 2022 10:56:09 -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 293GOJiB014340; Mon, 3 Oct 2022 17:53:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=b0U1oImN5LFDNG6yM4xWNPykdCqsQiSkC6ivTxDFbd4=; b=XQv3/y0gqT21cVasZSVG6w4Tv3riYi2OGhAbIYHQw91nQ4cQzwyxC87zpLx7ZPXbYHZX cO1fn0cEoIdxE0pkcI2D50Q0i68Tu5hPac5Voj2c9vqRIJTZrGbx7SytKndPtGcjsKt5 3qsAGQIT9vt0Tjr5zjieRyA+Cw0hSwVxLb9yE+LvkF3F/r2iNqMVyAkfLBygoMb/HVDx 8XTdURQ5Ng+4lT4cWkE+WTIU0ndQaZhT9bey1s/ZAMpFMEKBtrGH0E48EsZym5EGwbNi ALf0w+Fmcd/90RMlt8aKDNeQDvT1pbWKk2gf6bJ1EunDYkcYRSpgPE0IVWkjOmb/P8Uk 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 3jxc51vj32-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:58 +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 293HSotM030286; Mon, 3 Oct 2022 17:53:57 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2040.outbound.protection.outlook.com [104.47.66.40]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc09rj2n-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:53:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tl8JAtnJ+OYIp5+VvazFkDPyYUCANcOP8e0/xE2nG1uviNUkG2UUqYLCoTsUFDpq9vu9MZTcDarzXtBsuoN4lBtN0l0zSC4HOQ7wE62C4JxPWup4erVsbd6+pFznMxhRyRFxJMc3zjczMot72V3Gp4g2X92DWqj8xmA/eQK22PoExOB7HiPq1cZfAiJkQPhIYMzlhAr95yIVp3m1ef0rsrzsntxEFj9dH806U+BBrBAGvpntqtUvl17NhyaGBouDU4fDTNMuscSrZ089MiTrcaxLp2XH5uSyy9sy0kEjWeu4/6yHwCTxCADqxd21jia+Fq5Xl4YBxLwk1KT8auP2Rw== 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=b0U1oImN5LFDNG6yM4xWNPykdCqsQiSkC6ivTxDFbd4=; b=c5RiF1xUBtUWeZHgBCPdaVc/qudU7+XCNkWhOK8YShFDw+tnebhwhSun6EKdGZmqMhA9A+D/ALqzPC0NkhNtB1J8VbCfe6r0YJo7lLlrV/n2MDCqxWUWqEke381KQEY1N3bLt/pKnq5UHmf6oujtWjUHr9k/7LDZ5RQe2stZJJh7/nqN7FBP/7CZk0lzZZ/uQk6dn6A7+0QANnGmi3chh5yo8bvANpW7DsM2bTDQpF74Wog0KrxHqdRNOLCEmXsvmskZp6DtNzfR9E4sn2xmSPrMw2qXcTdxHJrD4sq7WwXtkq3x9vBwjpSd2zfKqYrC+sJTWA+7iJW1uf+gBqvL2Q== 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=b0U1oImN5LFDNG6yM4xWNPykdCqsQiSkC6ivTxDFbd4=; b=zVbm9B06krWP4sPcs8WqZ0dypckUljdLQE44DOMEyc8X4Dq4b3Vo43KiTNLm5Pbv9shSi2L7fPfnHj5+1Wj4D3nLWlIc+Y7qFi31KXtG5wRLhAwTg+8zR1+5AgRX6RHnn5QkpQMVjeJIr2GS1wuoXXVmYJlzoIQhjTYvuGyXnPc= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB4456.namprd10.prod.outlook.com (2603:10b6:510:43::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:53:55 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53: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 v3 21/35] scsi: retry INQUIRY after timeout Date: Mon, 3 Oct 2022 12:53:07 -0500 Message-Id: <20221003175321.8040-22-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0224.namprd03.prod.outlook.com (2603:10b6:610:e7::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_|PH0PR10MB4456:EE_ X-MS-Office365-Filtering-Correlation-Id: dc32acf6-c75c-4986-cc50-08daa5683da0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: msjKEYvnmAGdb6LbX51xU4bPWeeCzcSr36Q7gEZZWYUKDDe49aDhaKlG6JXDYOBOMwcu+JxSvNDCtCEUOKa0EFbAUnftjXvUvj+JxPgyuxwkQcPKYYIxa7878o/WZ6AOH2GcotONi9DwISAphnXDjhkhQ4UvDilaB0okPXPRr4Bs+QM02F6/5zaQyOCBqlEM6sNxug710K3u+xA3Z4Js64nHfIWe32i6PXbaP9Q4o7cJWu6vktbskWLweEH7WYVYbq85I4cEE5e6f1YEXWciOaKmvbhP+DaleiuJBo+2mxrowqY6rNKoEBj8Rjrladtmr7XY19khaPWsehamhuuAqEn6B51F/HAhoy4LY/lbrCO/6YT0fGhW0/uUoMEVIdMo+KSD+vmaQBFujJzctazl9fgqmuvF+LX4jHy4XJuDEE6Kyu2J5jCNGNttGrCHvG115v2mvzm7OTbrvsPrrcuwf9iQ5aJFKMSfO+l8lYLrXtxdYBE2V9E3PX6pmElEbiZVzhH141GSxYIrICcVpOVKtmDmCVEORrRZ/+fHLBtMlXp98F7leMkPk9ERORvkWo/nMPZwRFPDbgZmOd050H0uz9gPywaSdWfUFSyNpurUGZ9QJr+fX/4LBcH1PQwPp3p7fhVdaBzTiQzAIF0OI3sCHibkRTVPAY88iYTSPVGqZEttrGbNEMIcs5Bjk+DyfoyjF2NtGQ/qJmVXEwTHyrKC2w== 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)(396003)(346002)(39860400002)(376002)(366004)(451199015)(5660300002)(36756003)(4744005)(66556008)(86362001)(4326008)(8676002)(316002)(66946007)(8936002)(41300700001)(66476007)(186003)(1076003)(2616005)(38100700002)(478600001)(6486002)(6512007)(6506007)(26005)(6666004)(107886003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2A12Yit8CjH43mQJTC58v44GSAWCtWAGAXn9BS1iR4KkYgG/qTEq0enVrxZW/HGMcFPqhIhRH6IWnBiOpn6BkqgnE0ag26NIs9TgWs5xxiAq3EhSGgEJdgvQ6TrVttJNP8+6vK4HSyZbKA7k4xBeN0xF1fOHqb55PNzFCdnpbYum/M13pHSfEaSTvlwoiexKSyw4nKPn4ovA4p376nn0nBdsCmd/Zvc/shEvD3yt17sG4t5AjGjTQB7JXW9HKh3+kiHCWWW0NHPLleEyAoKxWNXzwbXjrC0e6QVZd5aiQGSR1sZz5obvc5idDy7F5J1+2pj/J23sXtFpvGzOc94x2AD9eKxdGguv+X1gltvCWc+Th7/OcZb8yp5xK7V7hiSrcwS1FdfWJIOZ3+m1wxTAFfhmOt3MZEPMjtwW0o/odRELYD7KDQmtX1ZRhgUimlh+yP6RURrdX5uzmEMgfqGGZJp5zd2mgkRR+RcIaNI5jwbhl2UDW46ETwz8lAT2tCTLHOEN8vxPBzconGuISGhXd1w2xGzJBpuM97Xyaz/IrJV1zoCWaDIwVgRxQ1L8X53djA5f6xnUgOjUK6SnTN5vkKuVo/IVOliLSU8UvmT4D2IdA+spbEpN2Mx6uXQJGbd9AzpnIvNUAQ9OSn/TR/PDP6drqEXki7qy7RUMwCyu/sinc8Nz3ZV0sr+jg7zdPbc8eMkuTnh3gvsoHZTWLMiBI0A0kZfiMUNaJwxnamfVKoJ2S5mxRx7+0UdROyz8j4wXYCdS7q3C+fiI5JIqGvRqBUZPXn4AnYnfDkKCXS8L0QidKyBAwfwGJYBR825ZzFxVg5xUTO05Pb9LtBWeCDoGgCUAaLSXXCKpt0sBpi0D5U8o+mrbct9B6xUWQNW2Rhsk6zon4jdMg3oRIfnHaixvS3YVCs28My5rpoGAoQsoUE3X/K3EYiUr53WBRyve0oCIE/Ol0ojNXo+cmw+dQEXrmQH66a2gFNvmYUKOCC7noyUsqAWKfJw5fTKDnA8llfbhEon8A+L1wia2F67SOUSz12/txYxEYyMjzbgkcfpVdS0zHrS+KBzqdw0TmK0RckpIS1CAljss3hr4n9ztSIIdYDL6YFnBf5slMHA3DNDfPG28lWE+yfMqy1BpTBa22YP1jETRdW1QifL1iBJHip2G7jGpoyDSOVXGGgiwLgSN6Uq7juZlLOS+umEq6jiM20nzEBz7d30qPrYr+7Nr58b0GhnUHCD0CyuGBj8BYAU5SRj7DYbwRNhsfVAIVEbxWY8rETUjJuXIBCby626MIgc6y/9l6oA0wmd14OjuzeJSh94NouCI5sfQhjz6Vzznp6BDu+7sVjIV61XWplkLZlY/yFUoB1gAL70uGG+58msq5r4aDQMhmb1MhNnfCP63h2+Iu7ocZZ8FmJV7Y0lgW0KI+/FZw1Ifau3i4kMOjhGNdoHQlLSeRjhIM4Y+CKjlieBSxS7LMASeYLb65QVYUldLjWckDE5ytIl7y0sjUonaTXCn42BeAY0xy75vHhJSU0E3gSGmOP91eqKn4cjE8ZRHOVpL7fcQVI6PcYu21o1BBgBkl2RE6x5admNOWeEHLEEwKBFG2aRVjlw/2eJKguDffg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc32acf6-c75c-4986-cc50-08daa5683da0 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:55.6882 (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: ht662AblJfqTu7gsO4QamcZ17qj9iVzf3H4PIpl9GxTnGkYzp97dW+7tT+gG1V2QHGGzPPRHJfTCkaOlj0B1kIp64SxW/rOqZL5VjRhGW2s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4456 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: f5GWT83mBKbLgTXEdrPC1H67bQDFvjAZ X-Proofpoint-ORIG-GUID: f5GWT83mBKbLgTXEdrPC1H67bQDFvjAZ Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Description from: Martin Wilck : The SCSI mid layer doesn't retry commands after DID_TIME_OUT (see scsi_noretry_cmd()). Packet loss in the fabric can cause spurious timeouts during SCSI device probing, causing device probing to fail. This has been observed in FCoE uplink failover tests, for example. This patch fixes the issue by retrying the INQUIRY up to 3 times (in practice, we never observed more than a single retry), Signed-off-by: Mike Christie --- drivers/scsi/scsi_scan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 83f33b215e4c..c45646da6c71 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 Mon Oct 3 17:53:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612505 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 6F3B1C433FE for ; Mon, 3 Oct 2022 17:57:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230024AbiJCR5a (ORCPT ); Mon, 3 Oct 2022 13:57:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbiJCR5J (ORCPT ); Mon, 3 Oct 2022 13:57:09 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B8543FA18 for ; Mon, 3 Oct 2022 10:56:15 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 293GOYgO015780; Mon, 3 Oct 2022 17:54: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=PNqtyKEDi1RzIVkc0eoTbA2MzGlq4+5eFFcHvyYJ+EI=; b=JA6TDnfELSw9T0VfaMxVKfOexyMq89rrNRC8k/kR9il6Hu5YfYV0Z97CUMLCPc+sOZjI wjKbGVdi7OLiRgCZMS/vAbgT6MUCwF384IXtOrjKf82Ev/gvwXft+JzL3CvriG4s1v/t x87XQsGnLTtE9OiTaYyWACiXBBy4AgV54Aneq/JSccCE0KEtEahMGlZVzPbqqpDsXUzp RXdkx6zlX7T48bzFHJ2nTV5qGpbKNN0G9KSdsArid85gg79RwAQBcNxFQ4IvYRcS6mGH J1xI2Y08Ut2ZBiXs7GVtlDrr9KoC2B0fUT8XY6QbyFbRS7FdiwQW2TX8p0ZSv8RV6OdH dA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxdea4cwn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:02 +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 293FFNfY028067; Mon, 3 Oct 2022 17:54:00 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2045.outbound.protection.outlook.com [104.47.66.45]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc09gdgf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IQGcKRXG94yJRNSMlL8dejECmRgbMmunNs2OnD2BILIkFvsYpA0LhLa4t/7KLaiSRlPYR85/z+bpa5xFLh/Bc13dH9J7Y/svCmMnRZtwY+sk/Fo/srexWgv5R5d43DNr80wVuETjsxmuhwIA2hUIBDAjz9zxSYFQ7BsKm2nD7/I/cVpmXLNQEMi4t216esLhDAD1nBxTSR1MtICK5Uz1dQF/9MHg5Qt9pPM6QhlKaoL3ZO0e44JRZhp/HxDuP7bdyllMuDeqq0owjn3z3bXO0OdgB/XF+5ty1qK4sNQCbTSKba+s6vOUM5q9e/6d1jVlDSekcFF2m6ymncirzEh+AQ== 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=PNqtyKEDi1RzIVkc0eoTbA2MzGlq4+5eFFcHvyYJ+EI=; b=O5ojM0X9drLNxqzmzJQWi+zsYJcJh0T+LEZ5PolFZqKnbvYYGwZqy4TWb1bs5OspyoouzQ3Vc3vaxby0euq64ZottfcWq0XywBjr4w5uhegC6tw2iUoplz08zI98NYoFgQ/d7NlIx6aroiLh9QOXkX1WB19BjHT16hBsvbNuT9sxqrwP3EvTXtj/09Q/od+GCLPJBcbcbJmnvwvfZHKRO2DUZfwNAcO04dpQhg7slCAHKIUQrDa8CO/mPELfJQ9oF7JlHey1MbH056rfHHmH5veynKq8cFjw7Ya3o/ZX3pApjPsDQpRbULW3xXcLlFtlYkPf3BzPlLngHgpblI0J7Q== 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=PNqtyKEDi1RzIVkc0eoTbA2MzGlq4+5eFFcHvyYJ+EI=; b=tzYda7Qs6b9KbkL8uT4uwSG7O6xBk3G99Olq5u9EWvRfc84MANvNc6OaSiGFeYSBY8d+Gb6pnE7crlsbSCdR47Y/OacviBCKO0tpxY5zWGbTdSbQ31Y+VGQbX2O3jwxLepHACCBXc8p8IM4R5SukJFpH6BN+QBHohwHYZBuU3eo= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB4456.namprd10.prod.outlook.com (2603:10b6:510:43::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:53:57 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53: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 v3 22/35] scsi: Have scsi-ml retry read_capacity_16 errors Date: Mon, 3 Oct 2022 12:53:08 -0500 Message-Id: <20221003175321.8040-23-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0048.namprd05.prod.outlook.com (2603:10b6:610:38::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_|PH0PR10MB4456:EE_ X-MS-Office365-Filtering-Correlation-Id: 78b04414-acff-4128-3285-08daa5683e8f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iIyimRNxrYFIPghgNp1xGkoYtcZqcSVAu4h1JP2HGL9nwvlc9mcuH3T8zC7N/ed8OnlUNXYAdiQbJTXeTW2plwOFKyakxqdpLw4S7GExyWVSHFWOZwlCEniB/R71IXJxt6oj0jpkN1G1dNaP8sgH6PQG3imwYk8MBkpVfr7Me+puoc9CqJM6yeM/jOm/LOGM02lMTgbiwiDTNByjG/kTJ7D6a7dn9wfXj0zrYNgrXDB+u/ZSkIdHAZz9Rvdwzw9S6p6pDFcJLQKoqA7gwBw3Q1F9D7wnEu0rCfEkH6cSgBd3ntVkE08kZr4sgvmpNmUFka0MtXqEWdoM5fvfZyG9Fwr1isXbai8UBefDvdxWG9Hx2cSLq1xv/qe89R6k85grn8xeiGmNor3lDsfbKovjtmEsaz7rIbUzArMbY8illfT/sFnIAYEn4VPExyjnxkbpi07VPDP9a1FXZAw8QoA8kRMIPE68YFYdXbMM7jQFi8lc9UQJzEjrcWlL5S0In0FiJsJl+zYXtARyiy2HHcZCouzBBwVU7gnEz//PSyfeW2N2FPEuR4VSp8J8f7K3TA6S/poPeZueHu9LhfM4WAROozo4oxXaLtDuMSfolO4r0s1Zol9T6EM4I/v0UjcIHbDYS/lG7BCZnA76QOLO5c0Sv1utXPwgmlRKKTQXHzGN+uWu6jhXw1+HA7F8IGKQsolmy+p17Uu5CJaincohM4xnsA== 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)(396003)(346002)(39860400002)(376002)(366004)(451199015)(5660300002)(36756003)(66556008)(86362001)(4326008)(8676002)(316002)(66946007)(8936002)(41300700001)(66476007)(186003)(1076003)(2616005)(83380400001)(38100700002)(478600001)(6486002)(6512007)(6506007)(26005)(6666004)(107886003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cv5wrfhw59vwsndMfhRwxhzpEOxqvB/LJo7J+wcV0B5vydA+40oEB7ymiPTBrqjmxMrS1MaBEeAAYryI7/mdgxp4m5O7LTcSMFYvVTmnnGL+fVZJE9iW2F8/ypg6NpV7Uyv9VK8g3MCSCUejeybeyBGLDjfrDWoEFLXLytF4uPH641D37HGOHLWEFm2Ma9UAH4lVkCSdDBRzsCykWV0si/9Aef0cRC4Tl1przyoPLI44I1Q3/PIMaNyjbqDViAWq39vd2U5/pkj9fcD6Zgum0/zZDEChYsqvKubXckrTyZsd7KZ5MujfkEFV8MptJiqkroEdRycC1G2lFxfLvCNp+BqPqDZ65AqaEiZSqIKuAtxAzI1J3mc3b5mLoJCSeE8ifKMRfk1jLLPpx+dTKRLg04+4jxol15ZYpLjrKLCLByi9iIKP2759TkHvYaU9iVRsUX8Lwgu0aNc3ghwG/vFn/IJXlK6Xl89CAupvGjJA8ARhbp00oMrn1LztJkOY4oTwiRO1lzozz6Phe0yrgFjJSuJSJVf8S/bVEFniLjXUUdb9X5PnRHwQw8+dSB2w2W6zXBGKTVsTFmrSxuCAr9r6b3oJoSC+TzSgpHBJov6elM+7YweGQfLbtQL7CY358rpoxyyL3C4UsYsbJMtNYFTiNXA7AywaQ8iqOyX0mk8oYEnlpDdbJHUF+g7c9aPTXmjppvHhPI69WjgwZyWQ8yPOQ5QvwVf15cnh4x5Tb9JiZOGEyrhzqaBXfpPNkR6Wsp3N+14p82qUEMafxtO1mObyXR3S/0XLklD2CxQcPYgQchSzPTux/h3EH/cNAgqjWfum+ncHcPbU/4rFnXyRmpjHhJX47snxN6qoQ1MOL9yUmEraUhDIsIG5N/QuZSsnauo0td+VB+fYjtF1lr615V4BRjIUEVHHaj/Ct2lWe6uEc629utVt3msLY0nfjEIkkNGO1/+nexBNMq45JtTPIJofCuewWvvKDnDTfC2EvsYbe8Jf89ArUJpa7sXAMcAr2yjvaeifRCR/+bGQ9yblxh1DIyNeso0/3Znmg7rtB8IuF4PP9LCBmum2IvwodZFBFTRQ0P+hiX2JtOXb24hT80rzcMuyZyZjd3O185VHK0Et/27hLcKiOQ7Ut4ovvUx5/YobC5MRgYFdJeFeWNa/9a/3EX5keCxgfVIta2h+HozaPcoequPpuXXe2zlmOBIo4NoPgJAV/gihVq4wqYX+TzvspLdGCt5SC6ObKeNg71tW4a01WuCMZiBVd1B2ix1XQasxQ/zwCnHf6YBtxPHpRlpJ9DDMkACS7ntPwDNnNFwrk2XPEk4dezInBB3gEuK8agP0yiMrsu0UCOgrEpYeUhJU/nHsJ/u5rRGBmCM+I3sEXpiVwIbwBWdMHAmcxwMd7DegVlZTn6IaZBFa4Bu+Q/XQ+WpbTzslEzvD22BWDt/CQHKXFQhcS0ZXCg0jl0ZjoIX4UrFlMgsIll77NHQr3x8SSSG6lcZQES1u5uLxyD/7Hv/Mdat5qYy2NXXUkWdBWR+QkNV5s3LSYzNnowdudJQhFa2vEEzfN7TSXPmqQqIl0pdnWh+ruBsS9bZoeLnC7gzF3M7f1OwTMnRJOBNWD/HH+A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78b04414-acff-4128-3285-08daa5683e8f X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:57.2506 (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: NE1KmiYxaN+ekInqB8MEnoOEkM9WOiUVvTUh5+VQ2ZhPFzvqBqCFm5J9j2m2ewpLLOadXSI1tV5cKRS1cQNVWOb2XYOROQqVxJz8CJoY3RA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4456 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: gJuteAfLH6zyaMNm9CqJqg3UiR5xDHoG X-Proofpoint-ORIG-GUID: gJuteAfLH6zyaMNm9CqJqg3UiR5xDHoG 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 | 82 +++++++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 37eafa968116..a35c089c3097 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2283,55 +2283,59 @@ static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp, struct scsi_sense_hdr sshdr; int sense_valid = 0; int the_result; - int retries = 3, reset_retries = READ_CAPACITY_RETRIES_ON_RESET; unsigned int alignment; unsigned long long lba; unsigned sector_size; + struct scsi_failure failures[] = { + { + .sense = UNIT_ATTENTION, + .asc = 0x29, + .ascq = 0, + /* Device reset might occur several times */ + .allowed = READ_CAPACITY_RETRIES_ON_RESET, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .result = SCMD_FAILURE_ANY, + .allowed = 3, + }, + {}, + }; if (sdp->no_read_capacity_16) return -EINVAL; - do { - memset(cmd, 0, 16); - cmd[0] = SERVICE_ACTION_IN_16; - cmd[1] = SAI_READ_CAPACITY_16; - cmd[13] = RC16_LEN; - memset(buffer, 0, RC16_LEN); + memset(cmd, 0, 16); + cmd[0] = SERVICE_ACTION_IN_16; + cmd[1] = SAI_READ_CAPACITY_16; + cmd[13] = RC16_LEN; + memset(buffer, 0, RC16_LEN); - the_result = scsi_exec_req(((struct scsi_exec_args) { - .sdev = sdp, - .cmd = cmd, - .data_dir = DMA_FROM_DEVICE, - .buf = buffer, - .buf_len = RC16_LEN, - .sshdr = &sshdr, - .timeout = SD_TIMEOUT, - .retries = sdkp->max_retries })); - - if (media_not_present(sdkp, &sshdr)) - return -ENODEV; + the_result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdp, + .cmd = cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = buffer, + .buf_len = RC16_LEN, + .sshdr = &sshdr, + .timeout = SD_TIMEOUT, + .retries = sdkp->max_retries, + .failures = failures })); - if (the_result > 0) { - sense_valid = scsi_sense_valid(&sshdr); - if (sense_valid && - sshdr.sense_key == ILLEGAL_REQUEST && - (sshdr.asc == 0x20 || sshdr.asc == 0x24) && - sshdr.ascq == 0x00) - /* Invalid Command Operation Code or - * Invalid Field in CDB, just retry - * silently with RC10 */ - return -EINVAL; - if (sense_valid && - sshdr.sense_key == UNIT_ATTENTION && - sshdr.asc == 0x29 && sshdr.ascq == 0x00) - /* Device reset might occur several times, - * give it one more chance */ - if (--reset_retries > 0) - continue; - } - retries--; + if (media_not_present(sdkp, &sshdr)) + return -ENODEV; - } while (the_result && retries); + if (the_result > 0) { + sense_valid = scsi_sense_valid(&sshdr); + if (sense_valid && sshdr.sense_key == ILLEGAL_REQUEST && + (sshdr.asc == 0x20 || sshdr.asc == 0x24) && + sshdr.ascq == 0x00) + /* + * Invalid Command Operation Code or Invalid Field in + * CDB, just retry silently with RC10 + */ + return -EINVAL; + } if (the_result) { sd_print_result(sdkp, "Read Capacity(16) failed", the_result); From patchwork Mon Oct 3 17:53:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612141 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 C47DAC433F5 for ; Mon, 3 Oct 2022 17:57:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230028AbiJCR5n (ORCPT ); Mon, 3 Oct 2022 13:57:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229897AbiJCR5K (ORCPT ); Mon, 3 Oct 2022 13:57:10 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5F255F55 for ; Mon, 3 Oct 2022 10:56:20 -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 293GOI63014329; Mon, 3 Oct 2022 17:54: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=Za8Itr0CAZag3b80qcmdCICYzTrGf4bru/pCUJ0tZMk=; b=KISlZBuiGdF7xu8Lx93QSw2i6mhKW1kmk1S9afrTpsjZPaK+0ETsJ5KawHEWPoyRML/P EiYNtctuci3j4V5VW+BLVVBJCvR9plWhXI1w1BfPefQ5D8IIPzYCcV4utSq+p/HZsdwT b+iSK3QPOr0c9vmFUMAGALQB6SEmYp72pNJSRYEQNZnu32iNADyrQkcThgnQ85TenNx0 6mO5B2x6J06MduDiUZ+nohFcmaq7GIs161BRnsAxxSLxOjPnNIfxsh7nvPfcSdGvD793 +P9gKxlwqpnHfs7D65S3WDoVYsnNfwL53T3r3/+Z0Vq6ec0He5UT8qmAf5Q8CzN9WvfY ig== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxc51vj3q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:12 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 293FFNfb028067; Mon, 3 Oct 2022 17:54:02 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2045.outbound.protection.outlook.com [104.47.66.45]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc09gdgf-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nrG/B31p4cLx1WSCgmoOS+5WvqtFdZSnHjP43B5r7jVRUkgMlB2Yi2On44pg3TBkv7eFUlmSoDNe9cPHzSFSJoDu6XQ2qRB4T16rC3AQqaLYcPYP+9P5LrfEb3zcS5LFl8Yw43FJwzhpaKe5Fa1CupIu6CYyH1yKieAZzsuv9XYmV6mWErcYkP3yt/SRz9Yd4h2tMP9zh+50dudvBEkn8zLlYoudAip0i6MyumK7S2DdICzIGQT/+aRuApkvRnXltiEthXcRUL/kB8i1EpHk0ooxvcIM6KzHTtHdK6frnR2RbWCgjynXaiAOfWOBUZgEZqCK1M3LqpChkP+54KkepQ== 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=Za8Itr0CAZag3b80qcmdCICYzTrGf4bru/pCUJ0tZMk=; b=SUsyQ8c3Hl1TswWUi8J1DD2eJl3+GIWHjLHbEj26XbdREpejVjqycsy3kkuXmU8rWvT7/YaeMRXW+qfO+4J2R+eVgJCq+iuMyoaz2qROiY+61WUilL7bUcl7EB32FdIse1KhoQcjCac9RU/kxko/3prNNz0CvThko4p2cC/jZ4rLo0uMeN5SkixvrgG2MDd6D9DV7L1M6CMVIjteSM17WLfCJGVAusgBSMBGuHygYvQSF0iPt0z4JdZE8vsuNQYGJNLeqppqoBGoR5O8qS/e/4Ckqzpqnl58rEmowfjxh6y3X7kFu0wyvhX1/gy0zVwz5GxF2CXhgsgsEfOjpxee1w== 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=Za8Itr0CAZag3b80qcmdCICYzTrGf4bru/pCUJ0tZMk=; b=a09dlnZXIQc+aMFEe6L6o/Kv9KS6Qh6VsLL6PBZv8CJekF3hRr9WUCWle9baHmdEWcmlo1dFwF3TZz9WRVD+NKmYZ1KymNJDswF0t15X6thGXDwwkZE3p52tg5KxoENXIg1dJIWyKEs/gtkgcSGPLismEB52YTdI5yFs7vUG4FA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB4456.namprd10.prod.outlook.com (2603:10b6:510:43::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:53:58 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:53: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 v3 23/35] scsi: Have scsi-ml retry sd_spinup_disk errors Date: Mon, 3 Oct 2022 12:53:09 -0500 Message-Id: <20221003175321.8040-24-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0236.namprd03.prod.outlook.com (2603:10b6:610:e7::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_|PH0PR10MB4456:EE_ X-MS-Office365-Filtering-Correlation-Id: 8cba2a1f-f3d6-49fe-9ac8-08daa5683f5e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QI2E1oJRMYRJ5Gga8KmkeH6yJtV5n9m0xWJSSxnuXY2kJ58fMkX+ZK0cOwhjeUnhtz8hQdciNZL0Jw+6n8Y+ZQvxugJnxxsPpyrV4atT4HY4TA0kpqTtogutGKRAxTwaFW7FhTilS9Z4ru/KipQD3izRzP6KzPsGzeT88wlKWjtKjp9qPt//A8NgXWUSy4qy/OlWA2T4Pwyvt3C6KGlWid6Sn+yRIp6/lv/aniBsMRjp1b74JEz21wb5ys/fM+v3GKwNafp+ff37kXyYNq/eygpItdSxtpWdYjX032klr/vJ+sqkjVJVnqDkvLydudCnqP/NVldBfaWrYPb4+Nagnm96uZqIcqy0RPSuqQVSqpgS4ex4gr1AWGvV2W+5xbKEyC3CJtOyWc1vUT5JgAEb5yvIsQC/RYhyQCAQhNBWNx2kn69z7GpzxaeFh1HMEjeXh7WzEu83D6MUislqXFX2N1gJvhg4BpIMn2Sel4hU2eZxZ9HhedhYTuot8ERmTiSTCo6ETMl0B6bfYZcx+NRGEztzRbfkSFlwGPHxHQdpwsBuuxUintuGWzwES9XEvDQn0I40tKRnUOtdaaUzKbLiBzvO+ag2RVBSaN+1TxfXhKDX6ga7yQk2Y+UT3wCRRzQXg0e256dSs2qI7lS53ElWNYnU8MwE94BmzVz/gvqATRuHP3z/wyn8NhYbC/eknw2u8fkOne7aYecB5A+jQiIN3g== 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)(396003)(346002)(39860400002)(376002)(366004)(451199015)(5660300002)(36756003)(66556008)(86362001)(4326008)(8676002)(316002)(66946007)(8936002)(41300700001)(66476007)(186003)(1076003)(2616005)(83380400001)(38100700002)(478600001)(6486002)(6512007)(6506007)(26005)(6666004)(107886003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vIORKEYnISIrbNI/UiqNdrMsjCGXEI1wTV1MjbmBRORMZ413ZteQvb+3ROo/oztJ++t9q3bR4pX0nmTcqO+jY4A+A32kcwS1kdyh8tG8DEOcoKfsrsDw1iGXd1TXcODK5EmWe4Fcfgm+WKn/eN5nlBJU69mebM+LzNtz/soE8E5PTnAMnXXryn43opo7GpA0cE7uxkdhjxh8P0EyBYiUIZVZKlSWO8wTJV6JVsVSXQ+6P1+IYgO0BUwu1JJBsUu3Qb3WptRvfnoU7W81DhhEFo9nXBtFleNqa1st8uz7LNoE+OsrdM/GhfOJfJcOLOWOlzSI+DfTuEupFFaS5Al0EJLoW0XHYtui5xbqN/PKuGDlv/NFGyvhHcrG6L+VeTu03yhXblcb8QTF6gYPmoA+b+Ltnp0yJhw21HbkWQ9B0HQp1/ZZeclYf0WguaITuq+OBikgLOx4NX+z8Do31TWcuvl/iOPeBeX5MqS0NHyLPz963r0anzpgxFmkhPS9A8hioOREyzXq4BZTZYjYzjj/lsOdrufTcfbUdhy/CFDEX6VoM47vQ5+8qG3h1w3KBVuN1CjdPwpfcmFp5frymcv5XV3f5XdQOnxokLHsLxJ8kwnydH41MDfv/707SIf9tLV9dceYNFpA/We8ZaGwKfmTXBQYdeBvzzkP/CezYwWKvmPhV8xHQeZRK4vRVyV6Y52RcHNcaEHfrEe8vB+xcGmnrJA9HgVSVNgxuDV0dtQJ7VnAGaZ7WzTwr4HDAPfwb/2J7utwF0+ogYX1IoS4HURhh2uG7pNbLt1PutIBGDBxIXz9un/R/sy9zFghglXQOFYzn8HfvhUcjFN6OCQpWyormlOh7rkMdQuBIHDEhAnFQyXju9wkQFl2Z4bDlzllBiUn3VpVxcbksz/lPWqLVULtMtvMU7Q7sUTtnMn3NdU96rGihHt0J995Pjm64z+UiVF25gIvdRAu3e+9k2dQiCFv49SktuUsNUiyAdR+ZPyTd506kva6+v8qOEGdRCayqf79MfJ5Z4qkAWgpxFCTYGMzOJ8BNf/XIcTBhEWjd0g8JDhOqk+e70CRTfl4e1ZcJ+hDGNUOizEgb0IRaG2P4j5bZJ6vQNwy56ALRcsfFkIbktOYmtv8ErlScJnHor1bP3Rg21SyVpmiKCGI25ZN5+HBncHrlBHPwTzbLdgMzcGEihmy7ROzkzsDlw10PQXXLu+2ZFpd68DuLf+v8C1649s5zExIavfuR//eRp22gqJpErJLUYqpRQ098AVPdBhpzSNVm57yqs9IVDGqvqpEcwLh1/v0cTNQon1nzbbNUTSsLLzJAKyf8MsDX97R4r49P/o8JZ/Dq+U2RqnuX+6ZwEhJif58e88Bo5aZI1PWlMKJXr2fk4UOaRhRBZOE+gcYzGRM9n0e2DG0Lytz9oFgThcV9zv1FlfEMvLgFUPORSMTGm7vgUtrRE6B1qnan4WEfpROf1uSf2BLQkFIz+UDWbg3hgFnnJYZXSmfp8hCbDKHw/3FSG1DnFVXCux2lENIWcX7OMNvslpU8TkaRDOPkdZaOyevxThU/DH31YGklR/+gKylVmZ/Tv8W//KW+x+v1evMCkJFYpuvWrfEHy1+SQFHJA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8cba2a1f-f3d6-49fe-9ac8-08daa5683f5e X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:53:58.6099 (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: ymz6H1PPOqc3ujaEBrxQwu6NjeNacJbGWX6Pc3TenS5JH8rxXBf/RvzNVS+EZx4PF/ckz4Yezxk2yAMMJTrcuPG2pkl2lZCDgtrh+89jg3g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4456 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: 8KVlFFBrdeZeN4V5JGCEPe9roWNgLxZu X-Proofpoint-ORIG-GUID: 8KVlFFBrdeZeN4V5JGCEPe9roWNgLxZu Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This simplifies sd_spinup_disk so scsi-ml retries errors for it. Note that we retried specifically on a UA and also if scsi_status_is_good returned failed which could happen for all check conditions, so in this patch we don't check for only UAs. We do not handle the outside loop's retries because we want to sleep between tried and we don't support that yet. Signed-off-by: Mike Christie --- drivers/scsi/sd.c | 68 ++++++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index a35c089c3097..912cc2623d47 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2064,50 +2064,56 @@ sd_spinup_disk(struct scsi_disk *sdkp) { unsigned char cmd[10]; unsigned long spintime_expire = 0; - int retries, spintime; + int spintime; unsigned int the_result; struct scsi_sense_hdr sshdr; int sense_valid = 0; + struct scsi_failure failures[] = { + { + .sense = SCMD_FAILURE_SENSE_ANY, + .asc = SCMD_FAILURE_ASC_ANY, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = 3, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .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; + cmd[0] = TEST_UNIT_READY; + memset((void *) &cmd[1], 0, 9); - cmd[0] = TEST_UNIT_READY; - memset((void *) &cmd[1], 0, 9); - - the_result = scsi_exec_req(((struct scsi_exec_args) { - .sdev = sdkp->device, - .cmd = cmd, - .data_dir = DMA_NONE, - .sshdr = &sshdr, - .timeout = SD_TIMEOUT, - .retries = sdkp->max_retries })); + the_result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdkp->device, + .cmd = cmd, + .data_dir = DMA_NONE, + .sshdr = &sshdr, + .timeout = SD_TIMEOUT, + .retries = sdkp->max_retries, + .failures = failures })); - /* - * If the drive has indicated to us that it - * doesn't have any media in it, don't bother - * with any more polling. - */ - if (media_not_present(sdkp, &sshdr)) { - if (media_was_present) - sd_printk(KERN_NOTICE, sdkp, "Media removed, stopped polling\n"); - return; - } + /* + * If the drive has indicated to us that it doesn't have any + * media in it, don't bother with any more polling. + */ + if (media_not_present(sdkp, &sshdr)) { + if (media_was_present) + sd_printk(KERN_NOTICE, sdkp, "Media removed, stopped polling\n"); + return; + } - if (the_result) - sense_valid = scsi_sense_valid(&sshdr); - retries++; - } while (retries < 3 && - (!scsi_status_is_good(the_result) || - (scsi_status_is_check_condition(the_result) && - sense_valid && sshdr.sense_key == UNIT_ATTENTION))); + if (the_result) + sense_valid = scsi_sense_valid(&sshdr); if (!scsi_status_is_check_condition(the_result)) { /* no sense, TUR either succeeded or failed From patchwork Mon Oct 3 17:53:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 612510 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 945ECC433F5 for ; Mon, 3 Oct 2022 17:55:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229994AbiJCRzf (ORCPT ); Mon, 3 Oct 2022 13:55:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229936AbiJCRy4 (ORCPT ); Mon, 3 Oct 2022 13:54:56 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C9B63ED77 for ; Mon, 3 Oct 2022 10:54:12 -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 293GOJcN006335; Mon, 3 Oct 2022 17:54:04 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=DcUJkC894JPVCb+CVHFeKiBEa1JZRqmNRDIXwS7s4EVjKPUXd9k6QtjyXsPVmjWuR69n Usg6Re8gZSxhpmxpTtu9jhrrRq4mz9E6Zg7al384z/R/n93WkWlhhAYQD2eF/BguuPLu yA3Uq1jEIr8x41nmqPkq0EogmXIAyde5HNymKCvc3D1J5fm/ySasdrrf+sqk0yss6Nep wvz2r9xXqfdB0loMrBwXjKKQt33562gnbC52FEt+Ab+Kx9AMEiP9aOjbBoWoMEilaozy ziMXCnCqTQ6yQEkBuiVYP6QMO5EsqY+SJd3jIjXENCc6FW/vktQDlUSPKp8k2YMOTfe/ 4Q== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxbyn48uc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:04 +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 293FFNff028067; Mon, 3 Oct 2022 17:54:03 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2045.outbound.protection.outlook.com [104.47.66.45]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc09gdgf-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LGLUuKGsx5VIk0/CJkUVbJgGr+PVvUZ+v42irUAn2HywG+x8nxcvuJvtHg1npcENcKkISEEBr2LxWkMHhYT4qrfWonhTmwrUG7kOw0ek24bHRIuWj5UmbAiq6gLx/unyS0Dxzrj70Mj8t0QPtuaPPpq7CoYJ3UTP8wg/46BwAFq0P0SBMV8xG2Cg6qoosdjan9mT776QrVHoK+BHcizUcqXy5LFWh7aTxeNgUk/6J1Fhtowi75sunaMbnu1OSY0f9nxi7RhuTZNHY5w2Jj6ddEdjUw3PO1+bfd82pajBdsM1xyGiKBvyXBRi3MYHOvVOozSp9r0y/Fm+v3nKcfI+0A== 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=UqzOTONqNGdsDJz8U0nkHE/L2CmE4/6VnuoTqQm85CYU1JNQDvN0JwkzIGXs3bedJWn+ycnbE27pI6rFk3PSFZEM/Juhg7Y9QERnRxl0w2eugDV0N6WIAyLGKzkYL4NmaD/Lor3LtuKyRSLNeOSxZHq9VuHs0otxhTjWYg17mleuOvw8qlxj/BFrNPPivn9TscnbB5I73R0RkqgWQ5y2jRvuesCA0w7w3iNKV4YHT8bwVjtTD1jNe6orYZq/RrYGNTex5HlZWH9iPJpN5tjyRWwnZHxRryS93+R2Nr0iyegdb7WOnYwdKdarFqp/za7cycC+FFbEhqgdmqVxti19eg== 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=nWMNpIiJgFBwPiZhX38A8sV16x+XLyKkklIy++XMZAEV11EHaRdyViykQH0Ag+DpdVLcy88Oon42pFkv0hbmvRXeP9Tv+OrAhqCqg3qCh1VykofMsnU5UFOLODbNgHnFaKd/YGspkDk3JQCWaSrVGNjTPjddY9Gn5yl+0AVZzMI= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB4456.namprd10.prod.outlook.com (2603:10b6:510:43::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:54:00 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:54: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 v3 24/35] scsi: hp_sw: Have scsi-ml retry scsi_exec_req errors Date: Mon, 3 Oct 2022 12:53:10 -0500 Message-Id: <20221003175321.8040-25-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR18CA0048.namprd18.prod.outlook.com (2603:10b6:610:55::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_|PH0PR10MB4456:EE_ X-MS-Office365-Filtering-Correlation-Id: 9df7e659-18bb-4aea-50e5-08daa568403c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uotQxdqeEZE6Qh52/OeJf/K1obnUSG1TJYGx8k/SC8I2KAOibfuJCfM9dwE20Hsc0JnLmI+4ywFrW9vX97xTFOlJ0ZSogCchhhE94fGkOVnjYL8+Iq6I7MrwCy9TkSU1iacb34BPxUgw3NiCYgS1f47q+D4iAMfYYq/GKTn99YLyOHX2yxWYTc0ry11HQMkRzPPLachjHoctxjmm14dAalOs6NKcgmXF87FaHfu/YcbgYmBqWFG0Pqxe8J389sPBkSCHSv/pPGHkB2XAkoDQKugCErGmoSuVXO4JMuKVJKXVSAdVpl+KNg5L8ML4Jmtu4zwdZV4CBUV6VCqO8R13wZ+c9Orz00YfdpmBIpsObOWbp83GX1pY4M3LezrS9S2UE2sdnQoRYrQ+mWqMM7BFpgxAeAH7N+oGThQsLn0cXrrrGJG8WDh1/wQkHvibsVdFUkmFYos3JY4D66RwMIhYOvdKsvIoKWUFxn5EXq1Rtf7MH/Gebjom4XVLfLE5iZiiSsBB4auDU9dt21lD0ZpuWx9tqQUny3xUmZbg3XoJ3NuW4jO3Emj7emC+XY9mXAfLvANKAiioo8DVyBoz9MAGuKWM/SWNj0fSe1DobGGuJbmBM3pIthWDpVDU2tLDCWJBdQCxfHEBhJbJz8S0elfHV4rURjNFwqn81KMBfOGSf8KO7irDOxF5pBPInphDF6wtCe498y/IYS/H8VUNF1uiIQ== 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)(396003)(346002)(39860400002)(376002)(366004)(451199015)(5660300002)(36756003)(66556008)(86362001)(4326008)(8676002)(316002)(66946007)(8936002)(41300700001)(66476007)(186003)(1076003)(2616005)(83380400001)(38100700002)(478600001)(6486002)(6512007)(6506007)(26005)(6666004)(107886003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zvS1XQahx163JZdTm+u9IRzuCXy75qVl0H8DCBm+ktmxxrz/gcUwtWXaY6MeS+b71zi/79BMvEY4hu6p5789PWUV+ITP1UzZ4e38p0st82rLmWZ4lhAQq6usnwljkR3k1gy9xeYwEO0SHWhg9I/Bq08ZxMClNhGfsD/zoDAPmZBhZdDhdibwBBAdxXT2PQHHqOvBEPnkYtUDYNO3j1H0IBAkqQiatq+LQ02B6hdOPJxZvzxFMTqoaCwTDxHL65d7mmdWzZQX7NfR4dEE1PAHjGmbFxhyfQ8NPSfSd2sMuwm9BSM9F1Chz6+RYomAxD+iwJmpbD4nLO2HD/vmBOaYgL5gnjUXl0TRBtFOPzioL2luYD4g4b9UgpOWlJ8fBJc3r9uPjJhEdsuL16Q0nPHpRaYOG8zcXQaRFpYJSwusI6I8Tooq5vyPwh30SQl3MsocYZQzRMMW3qTByXkfgI7lMYsNjPulGkDOLZ/hDfU/uoYMxf4b4wI+lv0VlIeKg4BZd1hqFbWmitq/sb5r2VO28rZutfvMgSlc6lYFZYE6+pVmr0JyMf3hp4Nmygz30o8iHmhsDyxEhVYogEozLiTprBjwRImxH9OwdRIDTpIo/KwOBHZu4PNaJYfAmWuMiQ5ZrMs1DcM8NNoz7WavBCgavgSSwYYabQPSrHSURcmQafyqNuITyoZ1cgXMq60WwQBNmOWD0PAMOFnOGvOfidh6lfcXmYh/dmvJvAHseE/eRL6Kze1UAi4sdRWHtwZKje/zV2GBCLha6YIciFyJo2c4B0id3FvMcNrV0v0eLeVgRy8/MCJ/2X4lDNSUk9RKZWzW0TDkzQItd2eChmznrdEIswHq+KJWHCU4qaWtMjw/OrA62SwPSZ4JoolqsNpoRqwiPiRblZ+EiMVX2LUk+pEKI5rad8OMB+jTJ2kv+GA4ePxiIzCDEGvd5DlQYrH/O9wisJuccUT88LMmKo5Jpo1aLOjOyWNNwmQjg72AcMqfgKDAygJO5VE2PFNDx4mWYbci+IOgwNFtVZCoQmt9wvD3GVUm7zsNQAqDYMnQsGmvC840RsR7OWwtGJqHEA1ftdFhUr98R1ITsqE5O1zx09YIsQX2gBgKuVy+bfyc62e+GHwGhSQtJsLJnqJmif2V1swUD/B3vWdwy4pEdUeC+GqxAGPWINj6NM45EnbSMKTb+33o7kVi6GQ+stSE+B5V4m3Q9AJ63WqCdagHnKus6i4u+9upXrkgdHZR8B5S41H7y5FKde7hFa6sA7TeusrjDMC9Mj/w2YbTl94CGjeQKzyj50Wns1hsQQtdQg0h6ZMBBCWPTDeipU8tnZ2DXA7C0KVO85HGsc1/dUlpNB9jkq5YmwgCNlxRTIXXTnw8c7+5iFQa4kJUKA2BZFxhMGBAF19x8MXObS3dsZIAO4bor46BR6iy86tVlcvZOcjEyLdYsxRfCOMfDShsJlDSk8zS2oHQCOO3rBkAYOlygh9aWgR6MA2se6FFymoUsxxqFdmrSHx9+RKkzoSrJtMsuqefyirifvqvujUJWCb2Z64H0S7K03Y/jU3ixeurtEkfcLwNKKBu6j3EN1j1PA0NTrsUDilxRr3zHSI8YlAkyhekp7aghw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9df7e659-18bb-4aea-50e5-08daa568403c X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:54:00.0629 (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: O9+cWSghUPAwUmvIk7MBlrMuz1zGg1sr8SgkIyzvRM+7DjEXBhy5yMeRzQYLrKrbSCXG/2yTEivKQppEGiPzHJV4Ze/LbS4ySN0myRM6fMo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4456 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: 6l0jOLThCOynyVziSVQxwZyKgTceoRJK X-Proofpoint-ORIG-GUID: 6l0jOLThCOynyVziSVQxwZyKgTceoRJK 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 Mon Oct 3 17:53: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: 612149 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 5A896C433F5 for ; Mon, 3 Oct 2022 17:55:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229986AbiJCRze (ORCPT ); Mon, 3 Oct 2022 13:55:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229938AbiJCRy4 (ORCPT ); Mon, 3 Oct 2022 13:54:56 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 553983ED6B for ; Mon, 3 Oct 2022 10:54:12 -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 293GOC60029461; Mon, 3 Oct 2022 17:54:05 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=VtRcYBFZUUIeKby70+sDSRp+b5VKvRELF0tCrX8i3VC87ff54tyjikiON5bGfEr2QKeh WNzdbKllApm6ncT1u3IrhB2rksgXG/JK0QOhH1rpRWAU8PgtkQbzDSzE6H3WtwzKOkhV akZH+PnkL6jvzkuWC9OkOvTOohHyMN/7+RNaIGK4jAxwfjt8YLM3buJLOYPTouQ76izx jD4Qi6GTjjkuOGrkbLTiOzLCpVbPjJRBrsUVBLpw6WOfAonLqMWLS14e6qIzzguGelU6 npjiycT9g/VnpfWF1VlMQb/ZWSpF9JFNiflprI9fJCqqUaNmk9rextURjv4Lo+sOD5ld fg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxd5tc936-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:04 +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 293FFNfg028067; Mon, 3 Oct 2022 17:54:04 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2045.outbound.protection.outlook.com [104.47.66.45]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc09gdgf-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mHYr9dI+FtRwISco5XwMzHKei5VwH6jmz4UhxIqeIekaZbFIen+0UWdjVBu43zE5hJkmkLuDpt6uUPvlzQVakbClhuN9evllYHp5ek2uYTVHqgWAd086sdJe6EnRwN+OaK+IGZtaL2/sD+VrBbyAR8AeaoG4f9ZF6t8jiB7jDuvcsfrktaoCvM7rKxp2nj/wgqXRMHNDn3LMavxp1mfdzAEjpxS/9vWLSJ3TRZx4+LeSEqLYHsiWsHKEcuAbRync+q1e3q2BkRbvaa0EDC21LsHSIhmcIQJ1pUTKIoOew2lTGg7wPtnT6S9ettGvlHtu4ujoYWH4kIJZcV6NbobB6w== 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=cnlhHcagVOW81+qZ77Z/Xic+pCPsF8cqC3DTMI/dy5i5Vx8q1g5O4GNdBTlePcv/9gI55Oyw7zNvIcuvdPXVHnRDEpo6BJKW3LFConcUBweTAsft+qfcPxrTGgbu1+qugecIgc7iTV6/dYXAE7Y4u6J0o0oe89o09pplhBswjDfxOYQPl3Y14yNGnIti0VGgNm5oK2UzgW8QKcfcPG1EdN1ZTX8KeGjv6y8oEjE7LfqHlDS934+GceIJG/NwJY8qlhTaZAoI2HVJLqevP6cInrG/pBdMDbbLnGgD6CkdVw2ocuu0Me8ZLW/bo0elPH50yeXOU/TE4jUlzqJDs+6GIw== 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=Egt/+WUORgWeK6qukEfKdQIRvkGvRTyq4/qfzpawuAK6pt1/n2Ns/WqAWSG2fFoUcS+ncmWH2vBToAvSk1v0WmkC3w/hghaI3gHByFjh+69vdORIrH4KT0NRizxerTfrZouUig4Otwwc1KbmbloEMmCEFaWj+jFVo/PUtrKTEmI= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB4456.namprd10.prod.outlook.com (2603:10b6:510:43::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:54:01 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:54:01 +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 v3 25/35] scsi: rdac: Have scsi-ml retry send_mode_select errors Date: Mon, 3 Oct 2022 12:53:11 -0500 Message-Id: <20221003175321.8040-26-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR11CA0003.namprd11.prod.outlook.com (2603:10b6:610:54::13) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH0PR10MB4456:EE_ X-MS-Office365-Filtering-Correlation-Id: 79a2e020-dfa1-429f-1b6f-08daa568410e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3EmEeeg1QOZOh0lO+44TYqTtqwzUBxxfvuPSSBIG5ddZemmepmK//RgC8AdBqhkFXM34h4VfAw4pYA0UBphPA2V4LljK23pl40i7QZ506NKBW0jG1op4MmFiyTSt9ZCrDzTsCU4macxvcTQkrDeBM0Pgw7IpJKMauLLDvfK4eCQX83f5EnZhAjtKYz3HK3YsMiyl3ODv3XeMOemjmOjuXeBTM3ej+nNMBvuaezX8OvuVcM9hHOybnLMfeU9XTYW0khHdLWG7tXYE9Wh/7bv46AJybQJblEW351sVi3UQhPrXwC3/tYNau+ZTEKSWchZjBkvzElwYSzTDlZRlz0ECeqCDlZMu3jJJGGCx1pZJoFJ9Wj4C8zenTvBjf56fLmhM/pPNqnyh1WKVM0wjaJfoxNNeYMDIuPK0uaty9pjjwsXfhx678xurCF+r8Rq6vlY5isP/oiLInWMmEEJUu1vKdz+wpjBzBbs07JHj8JoW5yZAcbN6TEhzKvJSoXNw4bEN9Q4HG10M6OVJPmPi2FZb7D+lhVNa3HIMLqcyE7KIIwqRmqjxPRTN4tj+GorfwJBIXyI0X6WNpwmZfXv0OhZ4cEuaa+eQel99EuewGy9wL3Kizv0QtO598HQ7VSyjoTxqc0YBsAYLrnzkzeIFu6Kt3mbTXl2Upx98dsFeHSDQD2LdjnpZ8hZUZ51YD/L9pFBI27AIXXWf1ii3qiHKtEDYkg== 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)(396003)(346002)(39860400002)(376002)(366004)(451199015)(5660300002)(36756003)(66556008)(86362001)(4326008)(8676002)(316002)(66946007)(8936002)(41300700001)(66476007)(186003)(1076003)(2616005)(83380400001)(38100700002)(478600001)(6486002)(6512007)(6506007)(26005)(6666004)(107886003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8npwfcWmt5Pc2ZF5EbeSIKYgvE4V6VTW2wNdK+KnUCK8QvLaXJ2nZ0y6m1ftDsz88PRC0joz+qw+3hAtCAzyqtjvxSm5lr7dfxG8ZCV/BK8mWXZZVaMojhUDCUuTNPU04kvXtNJY9H18iKXMSY00jj8iFVcS1MPN8ihJ8EStGTFufEt2tQWGGK+oISVFqEE5W1bWSp4KZaCt/DBz4BwluATovlf45wVsHnNtXqlUj5D7bAE2Bk49Y33Ivy1y4+ZVl7R/Sah322UZd8lsQNSGjMBfwWbfDn4oCLBBosWAKK7da/9UUdh3khaLy9d4009pfGJVGfQfJCMKFvK1E6SgAfzrwsMMmGhqQ3VdyDAsycczXEn8JeUyGgBXsb9IN1ad2lOVbbDmDSJ4JhY+nLldB/Tz+zRoTv29CAvMQtqKhrKTCZDCWQdP6m1Ih/3ZskgB0n83e3rxQ6zCzVclA+j7l5IJb2NwfFJsMNPW/d1sYJny52ANynF9nGXsVmOAFgm/yQENeCNhnAMX0yCa88ASpJBb3Eb91g7ECw0bA1AkLi9UI00YnKFeWydY7DQn6JUpAJs1izgbzvv9IiqOwY1N0nP4jN+I8Wq76tDnO7hOeHQvHq/bNNpkAdU7AIMop6eHtQ1MFDI8ZckgkwfGa9xSXS5d018iHxyVuBdbOjEwPM3V04iVe0FlzOis9YzisYC3gcAq6qMaZgN0c7em6cLcjrM7i+k08L2m8JgB4sacHqSqdUUqrzCtDrdnew2671wnYsdHl0c/tlIat9vk79YLV//JooWHTVeT3vQglMeSLbYxh6GRYZCBYjz+8SHjAc5Chg/XC+NonVNkbx3VVe17hRn/CSMMwzdNlHXEx4JxnqHq/+yrNodIuc97ffdOf/9HTvJYTd5Yqfoy1VUuVzmaD7hcfznITCYyH72vyDRrvEj+3qVeMprCVxzP1If2aMGiZLyN71EpE1uce8jr5TY7u4qCz+a6WESUKSU8VQ0g0uDo9xm/EVD9tBaBiCQTa1MglR2RvlEbyXJEx7MDWLDDS1oKASU4V9jsQQ5F+bfyTnYyBK483KZ55vpQs8R8ZJsI5OUNXNvGOpcayu5Ny7neUuYKqtVJo6scS4mAU7veBdtnIBijlHIfKmNbhgp3UxmO637/w+ErelUzleP7+f6m+VCtfN5R/jld1Y8R51tQj73n3bBAhj1OH6tekEibT55B/zcDjjpB2sZtCUcn0XR7BiSIh4HACIlupIU2FzpyJoP7PCSMHhi1Nm0uur1uLWRdyXeNKN1OCAFhOjVp1AunAn25KMXIyqwz5CoxwYE16NNVnJswNuE198EZMnHxd1+KhNnCbWogyZefe8epqi1DvB1ortwqDNd9Rr7saj6PLpwDa9bJJlAFrX5yaTxF/pWmzR36JxiIPVK8g4ZdP9O4VTdz3EKVTaakcopUN3ji4KCnaZN5OV8rSVvOnlb/qiUWBIngQfvb4e5H8yXE+3URvgb4QCIuFgBgz1XCsgBQy4jQpVX3qOaMRsvFO8KT0VYz9Zn4RE6Z1FSqS2CSdCbf+1fDLYiUA1V/qXj06+Tf8mfRADekJlHXCjBZM52hIv9SnpgbDoK282HJ5egAD8ZoOw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79a2e020-dfa1-429f-1b6f-08daa568410e X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:54:01.4221 (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: l6q7tyKX1N6xDfN8KvGdwL/LzpsvUwkAjZER2sPDoyfbh4vWLxFcLMImbvchR7EYqJ56TRRBfLPbZpm1JiC8wXeVQZBtAtqEGwCdMg4dWhs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4456 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-ORIG-GUID: yVr5EdNLG27jDHChsdajDHbOg9mcPkch X-Proofpoint-GUID: yVr5EdNLG27jDHChsdajDHbOg9mcPkch 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 Mon Oct 3 17:53: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: 612509 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 AD7A2C4332F for ; Mon, 3 Oct 2022 17:55:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229936AbiJCRzl (ORCPT ); Mon, 3 Oct 2022 13:55:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229942AbiJCRy4 (ORCPT ); Mon, 3 Oct 2022 13:54:56 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 964513F1DC for ; Mon, 3 Oct 2022 10:54:13 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 293GODGY015434; Mon, 3 Oct 2022 17:54:05 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=XHorkvCAFdxIIzvrb0khpju5p5HUsW1CYxx2TKvcL+U=; b=0b7nXAvoa7i5IZ93+xxNwhWZaHv3viLu/JmDbx2qjAO8gFkNZC5yr1w1o3+Y1qlSBS0k WT22ap6jp/isPUBq/6oYi6p/qT4NNLczEBx1ZFzg0YdHDvt2tUqxRdQutjs1xzOvqMD5 D8qj1+aM3FryTamU1vPDRJfX7sVY5a2bhG6qJKxl4l/K8ZO2qTaQuhXN0pzcI0/tSw0h oTSZi0Nt7DZRc7c6uk45JSN7zctqGDigHzASBLDo3HkCGnNGsPhjUZyt9+FZecrZhisk AN8y858vRo69iqrfq0nl95bFcQmlrAw2BIz2+YDF5w5Ixon91FA5LkaBGwB8NmNr5PwH Tg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxcb2mbn5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:04 +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 293FFNfh028067; Mon, 3 Oct 2022 17:54:04 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2045.outbound.protection.outlook.com [104.47.66.45]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc09gdgf-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GoRW6Mk6bn7lg67Wq8VP/HqrE8lF1dN7HdZxZdztafjrMd3gYRKW+yXH0VeM3OfnZ3bYnfxEsAZDaawJT7ZEWicNrB/poPTeJ9WqCAeX0aAXu5WISkUtqGIZPCbbf1C7dYzGX8QWeuWV60kePZlDOA5wyQ0sLJq/9Ot4iyruYTeijdLC5O7AxQ7XrMiD7t8ZQrkbSFJYXPDMk2Oyl3dRhO2HtlNnl9t6/P9ImAy4mS/gArdzXPBdi5q3j33NQQeueUu1BMVGmBItgKJkF6bSVaXQQKoxKCiNu5LwV/cF5oT9ECoCERoSKK0Mn2Xr9+fbozMIOvOwFAOZ0jtLlNNsGw== 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=XHorkvCAFdxIIzvrb0khpju5p5HUsW1CYxx2TKvcL+U=; b=nIEJyYQYiJ2tbuqlZLxRXPVik8/6xIzyxPfnaNpPF9PdBkblECwau9UBog0BBR93k+OnedPLGR0iSMquiiqm4TcGqVZdzE0A8M5/6264byJGyMMbigbF2Gz/6uhTDEE3wnGzERswvfAggfkQI8Lvtn8ODPmXCeqbDa1vpmOY5aFHTAitKlafNdNayOduGEC2HA7pU+IotpAcftAqoDtdFQYIeQIqsa+eCEp0NYAVmEnfgqvQ5qgBWqbF8XQkEXpnp1qB9D+Wl1nvxikhC2NzoxfUf/iQrQIg/HxHNp5cB2kB4c5XvrkEmwAy+Z5woRDzkh8myi6QzWkWYRC35FkZyA== 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=XHorkvCAFdxIIzvrb0khpju5p5HUsW1CYxx2TKvcL+U=; b=EUWv8ccLyaVgsn69rMvIq7mGbftdcYAD3MzcB250RU1cKqqET/N7KDJmJKuaY+gcL0a0gbRYr0wyrnkBzm6848ZM1dJ9SB/MHgHSqz741f0prXh8Wk7MY33YuZDxPRRaHt938FGaXtYPgiK7zSm5Lj7vc50tENquaR9J+iXYvEs= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB4456.namprd10.prod.outlook.com (2603:10b6:510:43::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:54:03 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:54: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 v3 26/35] scsi: spi: Have scsi-ml retry spi_execute errors Date: Mon, 3 Oct 2022 12:53:12 -0500 Message-Id: <20221003175321.8040-27-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0226.namprd03.prod.outlook.com (2603:10b6:610:e7::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_|PH0PR10MB4456:EE_ X-MS-Office365-Filtering-Correlation-Id: 6d8953a2-c6bb-436c-484f-08daa56841e2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kUtBBIcNP1+NJsSoCX1wo5JqfduozYMUQSKH+tqsAe4jjgWw0JeTVF3EiYOIcHSSFjaaGb4Tw0W8Rh/7rLpe0a+blmRO8EF66uj0wLsxeyMZbnqI+R7LmBqEZgBTmdHVgJFs8gBgKDjdokRL40k7FQbqO0Gozv18ur5TNhbdmq8yoCK4PcUwZqBmSb5eXD6fyl5B2o4mGIs+vJdZhgqVZQfkn/6eyGr9VoT9nKMOjR1pbASYvJrfs45v+ilhSgO3gsHFOhR49YDbkT7HNNV+wj2OKIEggmanRU0/QeQwVT+dl9Ijq2wzMxuisS872uIW1KnNF3Yd2dUa03kX3OIMWxtp808RGgsa27CUHvvO9w2DtkjaQIfHuaJUbZA9q9HUQMpkfN99qgp3BlVquSCCbTIxI70G9nESikn+28R8MRIvFfmKlffQXIP9CDnr81ORfY2Gwr69bvITsf3Zt9TyhK89CyLQiYdYcLvlkcRNgx6FOG7Cw1SVzwACaUPip6noK5c+62mQNUWSZYtMadCmTSH2/KjIvBXRvX7lxCDmdYgb2tWf69lhsXHn0PWPo5o5vqfnr+k9mT/9qOlQeewikA7ARi2fsBqf7N2sFXolr8V6mRImNR+XKYcfx4kxED8Srw5NuDUmq4ussjGyryihd0QgFPa3CBjfthuKGw92vpJ7zC7HPsoClXtZBewTrUwYp/5twzFNrotyz6xuJzMhIg== 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)(396003)(346002)(39860400002)(376002)(366004)(451199015)(5660300002)(36756003)(66556008)(86362001)(4326008)(8676002)(316002)(66946007)(8936002)(41300700001)(66476007)(186003)(1076003)(2616005)(83380400001)(38100700002)(478600001)(6486002)(6512007)(6506007)(26005)(6666004)(107886003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Zb37tNgiW+3iJuo77+6MI05abT/DwWwgD9CRHOKll2eGiJ58pjcN1zSdFY3sUe/kzsQ0ahBP7b5iookGyHcAdB6lFU5UrjQQDWDl6v2giETRYzhU2uAuVCp/cwvsrk3fMnnKhNQkxOubX490aZbXgsuE7r4OOyaD3cy7kQrKe9szkJyO4xH/gddJDsMiJ37/+hBgEit1fnjr+hSmEMxE5dlBcbOuycpAE5y4XWX6W1b3aydEW+xglfpDv2O/CHyxrh/pFaIr0VwgEb6s7hXKOs3WomrQd9slaNZhbdvE7tIIzorfsEo0dF8o0S5whzlC7npfZav1LEJK9HMGozw/fwm2cHnUrkFGTA8UJtHeEQCYFkDb0Lle/Yo7gmGN37K4WettsNjggyGpxIrDg1HKOCrlzg4nepa+hHF9lCwm38rCB3gTYT84L5FqzFjz8k9bFNi+0gbVGZ5vpjZcGc9T9EZNy69wqPWDEOqGshRdihvveBfRlLH7dIevA0udhAsM21uEkr6qqnCoagcImUpBw6ZT03XSSut/wnutYSl29A4Io8mnMFNYvCVorcg+4SEOi7ZfagPXlZrcGNQLQsGgMhPvjgPjIbECGN3j6JCBAitkshiZ4TWnrxd+uSS0Twzy8ydI1oqlMsA7M7K+rL1y+1Kc+edhSo8MFxSvTAjG8Qf7IG6Acy9UGft7MJfjmQmHraczqg6x0kBOzz205t4ngFh9DG4Lk1ysbMAYd5GqRokENju03E7v2AOqn3y8rK4jSrwRs0Qa50291ybS3Cf4ftSl2bFMJeHPf63l3631wuXzGhjYwTbQTpQHJY9m18+ychnTFhqbKGUJzOvckHK4QlobdpaugdMjYvlydk+4lfmb7vCVttVINMxjDqLVN4tK4iTl1ckN0IsFLLa4WE9fPs34eoSo7f2Eh8aUtzxgiCTNxXwuNGap1/EvRpjHhX5prjdgaZ9vfCNB7as/qwKlIPvuaO4oEByc/LnE0XHbYqEMtuovHLmBnZAhlJAvbKxNdpSduy0vWwLJ8S7eR9VfF4LQ91SWw5ZTh/zFJcSvpTyS6VSEz2vbHoAVqHmdJiExhzCRJ71rSpIwMUE0vi4zhwl8TTgJCRoX/l4VaBxcF0lH5kY/ka/BytcvbrrMJFF3VhP4dsi5w7ShKIxH1w9TNO0tt9mpBu/zxaz+H44vCGfFoF1iiHvs0q3/sqADnuUbl087dBQP5GhI4icCXeevnNlMizT0H2Pl5RR5hP9HBbghZMbbMscjxdNvYR4q0qgntPejFC5lBBzJBh/9MPe07rmY/GOFEZbulZIHGSNb2TeIJTJdOfbi1dBFydXL4QfQb5Dv4u04suE59WjSaop9jsSUB96xas+Sf1YgVOlRMICKiQgATJnAuv10jAkWWeL6Sc7N/V9cTvsiWILKmLO326vaSGGw2sbd4BmLrfq5qECq/p8r1umhntVPeGgnNnMca8KaU8JrmgvK3NZtG8WG5a912wmk47ssoiOMjMAlzBOD7bAp16XASeuG6jjWFTy1FJdrmr5D0bULeokMCYuAatz54LBMiYUIbG+WgnOb+DYcvbN9wAgfFeP04hC3So1btFRp6jYAtwxBiAXXF+HLBA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6d8953a2-c6bb-436c-484f-08daa56841e2 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:54:02.7970 (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: 5Bh5Vb7HowZjQqijV4T/1O8wunzoE0xd5ptWVICi36GOMpdtjEIMImpc1+qNbByXnpknY6BeceXbxBuLNo4JJbfhE7wowJ+7zohoqvQKpNk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4456 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: vQqZRHOLa3VsPVTzZWuY_8d963UgfnVZ X-Proofpoint-ORIG-GUID: vQqZRHOLa3VsPVTzZWuY_8d963UgfnVZ 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 55d9b13b2f8e..ec5b0f562cf2 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c @@ -109,38 +109,42 @@ static int spi_execute(struct scsi_device *sdev, const void *cmd, void *buffer, unsigned bufflen, struct scsi_sense_hdr *sshdr) { - int i, result; unsigned char sense[SCSI_SENSE_BUFFERSIZE]; struct scsi_sense_hdr sshdr_tmp; + struct scsi_failure failures[] = { + { + .sense = UNIT_ATTENTION, + .asc = SCMD_FAILURE_ASC_ANY, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = DV_RETRIES, + .result = SAM_STAT_CHECK_CONDITION, + }, + {}, + }; if (!sshdr) sshdr = &sshdr_tmp; - for(i = 0; i < DV_RETRIES; i++) { - /* - * The purpose of the RQF_PM flag below is to bypass the - * SDEV_QUIESCE state. - */ - result = scsi_exec_req(((struct scsi_exec_args) { - .sdev = sdev, - .cmd = cmd, - .data_dir = dir, - .buf = buffer, - .buf_len = bufflen, - .sense = sense, - .sense_len = sizeof(sense), - .sshdr = sshdr, - .timeout = DV_TIMEOUT, - .retries = 1, - .op_flags = REQ_FAILFAST_DEV | - REQ_FAILFAST_TRANSPORT | - REQ_FAILFAST_DRIVER, - .req_flags = RQF_PM })); - if (result < 0 || !scsi_sense_valid(sshdr) || - sshdr->sense_key != UNIT_ATTENTION) - break; - } - return result; + /* + * The purpose of the RQF_PM flag below is to bypass the + * SDEV_QUIESCE state. + */ + return scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = cmd, + .data_dir = dir, + .buf = buffer, + .buf_len = bufflen, + .sense = sense, + .sense_len = sizeof(sense), + .sshdr = sshdr, + .timeout = DV_TIMEOUT, + .retries = 1, + .op_flags = REQ_FAILFAST_DEV | + REQ_FAILFAST_TRANSPORT | + REQ_FAILFAST_DRIVER, + .req_flags = RQF_PM, + .failures = failures })); } static struct { From patchwork Mon Oct 3 17:53: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: 612507 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 42E0CC433FE for ; Mon, 3 Oct 2022 17:56:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229669AbiJCR4P (ORCPT ); Mon, 3 Oct 2022 13:56:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229958AbiJCRy7 (ORCPT ); Mon, 3 Oct 2022 13:54:59 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA16439BB2 for ; Mon, 3 Oct 2022 10:54:31 -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 293GODGZ015434; Mon, 3 Oct 2022 17:54: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=+erRwpOLMPQQv7YO8DMH1pPa3L7TonE7JxMmFSfj3eY=; b=kFQuLSDtJLQxBBd6BlHd4fqaQqojxuTcggYMl1W0reRmS1mF3C3Qler+ZKAWOsq9VxOa uloD36gh58lkHfWLnH+o0r2fLyZFDx0jGx6w+sSqyQ4rGmNDa01mnowZC72/428vDFSj md3jBDWF6ngg0ekIsdCIA5S/Evksv2iiJ10xhwK2hc/6IFUVwUJL7WrHBn1wy+zAsfCb FDUggN238GVt7tPa9KYenV8ArJeIyENutvYlLViVtLhCobOo2MUCjfh+htD2e65XnILk eby4y9l2EPxqIl0/zwQtGYCO8jbF887NSY22ZzoD73vxuxYaEwVeAY0jdbvsBukW4lyb 1A== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxcb2mbn9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:07 +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 293FV7Yd008246; Mon, 3 Oct 2022 17:54:06 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2043.outbound.protection.outlook.com [104.47.66.43]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc03q64k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vc3iCvGAegfgG6mj3uZ3x4drkes2fby/iQRYKHjxTB9UHe08AqleBZRzES4FC86VDlJ9K7wOGh+JUnXMLpAYfxzxuNbhcvYCosku5IF54efFVkMPpcCmHVRN2cmo1oOK6AfZHQttBl4luTJL0uhfRtw/zk2IMBCOGvihhR5V92mLGM3lthg1suWvyrxOhNwiRtgAyzgJcoCz6hIN751PC3mC1if+XxhCIr4PLWPFBBoTpiVLdo9otTd3O/Jn3CeZtFjbIBZyywQ5o4ZeMoFavJkjSYg6IHzBcl+VTC7qwzUlEXeSHbh1wGWnNGrWsu8c81Xaf493SPPgrpE3LqNS9g== 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=+erRwpOLMPQQv7YO8DMH1pPa3L7TonE7JxMmFSfj3eY=; b=MgZhI0e8bw2n75AgWVRw4pGxRKaoEW2CaXPoEMg5BcY6DXPKM8hD+Y5e1hKYev3GW6XHbRgGZOkPZQU31+YwQKqDJN+kMcGrXia4qYGSrqZ9jgjshnn/7QYGWIhDYrTmFL8Z89HMF+wVr+V/LqT2OPxZQFgz6dkpSSs/zlTZ4yHvmtqBTewS57KrDPI6j++ZqKC+Do/kfRDS4ApYU/LPlBzflxydrKeB3qTzYuPgdzMwoBIyejMNelTkwoKERxU3QeDt0x5n973nIfVD0joGE4DtiNVfDocOjWw3DBYkKgNbMYeYW1TDa1/8SnxoSMmakuI/m5XeQsRQI8UYfJTkdw== 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=+erRwpOLMPQQv7YO8DMH1pPa3L7TonE7JxMmFSfj3eY=; b=NYST91/U3A/N0uen7VO36w8kkQZPREKAZ7EnYcGc3VWoULdKsZbbyi9wd1BzD7ZJdd9iM+Iq32uBbk/T2tmPMZi0qXHsRmDC2B9p+e5wq8HROLNV53XzHDnfqsiAqR9mlJ9tq87aNvgD2IuC645dQ/tNwn7wVKoO7yMMfy6cISA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB4456.namprd10.prod.outlook.com (2603:10b6:510:43::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:54:04 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:54:04 +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 v3 27/35] scsi: sd: Have scsi-ml retry sd_sync_cache errors Date: Mon, 3 Oct 2022 12:53:13 -0500 Message-Id: <20221003175321.8040-28-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR03CA0021.namprd03.prod.outlook.com (2603:10b6:610:59::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_|PH0PR10MB4456:EE_ X-MS-Office365-Filtering-Correlation-Id: 616656fe-13e0-4ab6-fe62-08daa56842bf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7rrrx9frRW2qLmKzRexDE8ql7ZIuIUsh4S5sF47MPkAhkTBkcAa7YtiHLOCPIyGq4QPj9o4zExfPUly0wtnmFSTQzeTSRGHxr0VwIX8vE2hLTISChhPvhcTREDYotGdWVBxLMjAZwODKFM5/c6TtOY9dHRNlzVUrSaipgDqjwi+/jk8Hgw/gTz980Kxe/TzjQRgQUqYYNiFg6lK3TzvUsSjAj0ytbzXAf23Jo7P/aGrj3zi/aeRl8NC0pQpipoda4lNHCSJELI4MV66TfZ4QUWLcvq0/ilFYdX65g8v44zNA4Pzc+Ylt0xWiP+WJrt/o6u6gpBlPrZ24ODU345Bb7BKqHqYYkWzryKE/Ff+JO190U+ry5X/7UuWJ2jST3JhEvu7JyM3r/8J/wnuI2VG3kJ5Ft5EAKj62VM12uTa6dbHUY/1D8TP26I4Zk69ouNJKA0Rj8F25sCJhEg7/AXFf6oJbnnZIfETjWdW6WJTZ/dcgnYgMiIrnUfYci19wwAZMcO/18ZAqYZJoAseVNcdLLKZE5483gPEw0248nNeO6+rrM1evRvsQoSXLflGcyG6GAQrENVbcJGp9g4RMj5oMLiZW2pEuSAw9IiC9uKsPH9Z0qJVjHz/WCf4rdkMekHYZ3Md3UogYpgfoKoW4fGu9j8/A6NkTtd/Ao5pq+Zv+3JKnBZzAb4L+NXErDcrTQHFj3PSRkt8hnsHf4haG0McksA== 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)(396003)(346002)(39860400002)(376002)(366004)(451199015)(5660300002)(36756003)(66556008)(86362001)(4326008)(8676002)(316002)(66946007)(8936002)(41300700001)(66476007)(186003)(1076003)(2616005)(83380400001)(38100700002)(478600001)(6486002)(6512007)(6506007)(26005)(6666004)(107886003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: A/ewWvTWPz70P+R4AH1QuDb4gUCkL+Sa/tw4QOniSO9jF+fDApGK7KN1h9sI2/Cxf0ojo6uRfl4/zZns4QUjtNBprH+w8CEM0LrDK07uVMg6fSzHMMPFyMInZHcaLaKaCSfbTKo2l3Lazp/xI4MUXAWuC8bO7ncPwAK6jIoA4q2xMrN8sw0sTvLWa8v0B9AEmbsLpPJ8dYgJ0RXKwmVX6UkJMbFphk29xkckBtR2ZOoUBkGERZ5D3fpQ37iAHaLqr6FTnKfwulC9iB6zk11FxffvR6zMutEctk/ZoyOacgRrKTFLs7F3CMqjSk4NZENwjjQ/qFzSC0Vok6kQlqx/KO64ArpIh1r4RG0Ufe927YuMIXqV1BBwdXVEPAn4gSSk71MgUUM35farTuNIlbOip0IvW7mm9ot60RTzI9dsTenZclbDl9MCe+hhAmtS5BNlG7pEVmHMmSb8DC90hivVv2ICrHoOOwsFA5G3Nr1lCZM8zsPbW8qDTqaFqenPShNNXL+E9Oepe1VhIM/mBGQ7cxi583zAWnLwpB79zm2kvhMXWGy4zg7GxZFjExnbDubGC5C8mMK2syjvUD+V9GB3eD+JLkTPuHltnRp65YmbIaxLnK94qai0WrWi9g350H60yopjinUrxDbuDthh5ev7TgvidxMhOjlhbwzdnNiZcIHMOTOIseuoXUKR5+pXoR7TpwAfo2AG41E1pRv76PJHLTawBdIwItlkl1M1VitC7zuhK/AR0o5YQIYAb3zqzaN0/5bGNm2fYVXiWb6lLsSHxLiTZxXtbA2IJ7BaBPS7N2jqa5QmcKA3dpsMwR4BwjqYh9xhrJSTlVbmOg13o4JV+lgIUECrU4n36jBpyd8rLKiKceGM094ld5gNfW5U/Z2vMCwRmoFViBhSSmdS71FX0TZ5ls++v38uYFEBZ1qrIWdvjaZZVaoztQPoQvknR6bKpwHvPs+g3onWISG/znHxK5qbHNWoBI5b/uBU7zfZuC75eP1/WFoqpTtgWQOa2OpJ2H8BKZUt2UCypbUfvVmN27iq+VKaaAUwWM1sRr5xtHS63YCu3JZSv7fLz2IWnljDrDA2dH36A4vJQHrGv4eTdSHfXbv+hMjwUmnUEFUgrGn2noO3Kc6dNGy3FNGh+ERLFhU/21ANSpo4oTG24QZlVIPu6DYtlz3kqa88Z2T9IjHzY15eVzKq9SOlEqK7IqQfI0kU3hOhL0Qs8RlBBtxa1nK31TzMEjC8kMuLKiEQ0/T8XE7q9x24CldRr9dfPxJSIdhZO6d0dIlvuxbgxrfHRefi60381Ee0PnulE4MAPMNf1CewBvWw8lfk94GCxwwqrSWDzP5XHXMknUbzNzRPvoYUu5VXB8ykNjO3Xflq74oS3vNNKiR+MZfBv5+5vT1dVjK2n9P1u/ePbxHePmgqbjwlviiNdXkcf/G+0uSUYoI1g6yd/QuJCbWrTnb/u9LtKgCQs7EljyHOiCLr4vXAJHJFtzeZ3vMGxUaxtgWuvoGVVhpX/z+PjU1Bmq3VikdPwK//htb8pu45uwqQAEL2M//3iXEhcpr6Yw7+xvGpEEzoYn42jxbtjUJehiwO5CUbaYLfjBX0ZwBC11u+LTw19A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 616656fe-13e0-4ab6-fe62-08daa56842bf X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:54:04.2188 (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: EH7JVzAlihEgjZYL6CjqXsbQ/VN+71WlmY22viCye76iLp+HClaUyxpLSOtdHeIctlxOngPFPn38D4cODMhwsta72yIheBtAaJCfdHnwr7Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4456 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: GMyvlEbee1aqece6Y4J7hm9Q-yYIqMz9 X-Proofpoint-ORIG-GUID: GMyvlEbee1aqece6Y4J7hm9Q-yYIqMz9 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 912cc2623d47..a6b6c769dee9 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -1580,11 +1580,19 @@ static unsigned int sd_check_events(struct gendisk *disk, unsigned int clearing) static int sd_sync_cache(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr) { - int retries, res; struct scsi_device *sdp = sdkp->device; const int timeout = sdp->request_queue->rq_timeout * SD_FLUSH_TIMEOUT_MULTIPLIER; struct scsi_sense_hdr my_sshdr; + struct scsi_failure failures[] = { + { + .allowed = 3, + .result = SCMD_FAILURE_ANY, + }, + {}, + }; + unsigned char cmd[10] = { SYNCHRONIZE_CACHE }; + int res; if (!scsi_device_online(sdp)) return -ENODEV; @@ -1593,26 +1601,18 @@ static int sd_sync_cache(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr) if (!sshdr) sshdr = &my_sshdr; - for (retries = 3; retries > 0; --retries) { - unsigned char cmd[10] = { 0 }; - - cmd[0] = SYNCHRONIZE_CACHE; - /* - * Leave the rest of the command zero to indicate - * flush everything. - */ - res = scsi_exec_req(((struct scsi_exec_args) { - .sdev = sdp, - .cmd = cmd, - .data_dir = DMA_NONE, - .sshdr = sshdr, - .timeout = timeout, - .retries = sdkp->max_retries, - .req_flags = RQF_PM })); - if (res == 0) - break; - } - + /* + * Leave the rest of the command zero to indicate flush everything. + */ + res = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdp, + .cmd = cmd, + .data_dir = DMA_NONE, + .sshdr = sshdr, + .timeout = timeout, + .retries = sdkp->max_retries, + .req_flags = RQF_PM, + .failures = failures })); if (res) { sd_print_result(sdkp, "Synchronize Cache(10) failed", res); From patchwork Mon Oct 3 17:53: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: 612148 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 B91CFC433F5 for ; Mon, 3 Oct 2022 17:55:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229901AbiJCRzj (ORCPT ); Mon, 3 Oct 2022 13:55:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229941AbiJCRy4 (ORCPT ); Mon, 3 Oct 2022 13:54:56 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F3533F30E for ; Mon, 3 Oct 2022 10:54:16 -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 293GOC62029461; Mon, 3 Oct 2022 17:54: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=5VBOIbxCmCDCbH7p7/9/NxCP7ayVegHA6gbJGxtXhXA=; b=slKCx03cm5J8ReId3fYf4lpk0FmXNBoFBsPexcXxQAFtDWv6NJo9gM3bFtNlcqvkSNBT e58vmPSijBpAwJ98q/Wen9q1Kq2t1+/abwszcslHEq6u5mcbdvBDvKMpHiVhXbMXRchz onx6bI7Svg389XjvcISko984ONHz/VkHE95yTttgNfvW4YZOw8oeGWibmSIDh4CK/sCf xALePpNW3zn1KgunZiY76bBHCUYEnQ1N2nwC0+8e35iqvrMFM59QPoUzLLYtnE6CsyTL ObyEqLXdBn8/J9R2gm0OK5PbkGU+LfgaC2aIqxGVnv3M23YqW2OzQ8aphFkRXLFVMrgp Zw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxd5tc939-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:09 +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 293FOpPp008261; Mon, 3 Oct 2022 17:54:08 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2049.outbound.protection.outlook.com [104.47.66.49]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc03q65n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iDt1mRV7apm5W5+HR3Jby0omkN4ZJgDvtrda+7qcb/tMwVkHzthadGRPmw42B+aHGlmAYZQdj6MAZWDiKWSakEvcegjHhmGOkMNHLGI2NIMUO61KpaR8FbygIlEA2G4qYaYjOZ/WUVoNBOriaxLVLdtXIl9PGzxaA+u5jmWu+hW4ZC79t65Tuuj1VT8PDEN3JQwKH69adiyIr7j4NH1t2VtOQuu0g8fykF+CoqeqIInxK3v9HweGaw1PSKfYo1MTza7SlSeKrNz+0Jmha2B6RqsuJHmmmdb9Pfq+OifxzNVfRKkF/AZoGxoZYM2TLiKeMHncO7JsdTQu7LyZrN+6xA== 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=K19vVUNiOUfTxonnvCuOATMjFwA3qV1V37V8VjliHU7wHQCdffqrQAZbE17eZ7coLPvf7eJjxMDO3g8O6/0TN7ZnIBI2gmTxCRQ3fzFclUUffw30vWLRu+LGF1sh1+GJE3lXaeYOqCJRPq3XvZx90Shg9qzQ8V5CgWsgF75UsEji0kDgWVmi019o39LX27oxinP0xseqPjpTzoPsuYdK6Vols6xIPR+WxRW3+IDZ4CK2ZKQfBKTOgGZLKR5pUAak/8pbVX76D0752wxyBTkHvc3/YrDbCk+UKgkYv1Pu9Eveua2upZxAL5aHIJ+veyG+b5+v9OCC8r17ZUlorPf1lg== 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=OjRxYjD8iPP34e70F/wB4mmozVd+ZdO9GLh0dGlkd3xQEqEedqDjaid1yl0rOpj4QXt4ylpcJMMUlLIEtn2xE12Vx68L1KX04kOegVzlZt409dNNdlgp8O1vTgboIdX9X35zYmIgo1gb2EMutVXz3IuwD0YPzfAXlG0G5kf4ULQ= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB4456.namprd10.prod.outlook.com (2603:10b6:510:43::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:54:06 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:54: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 v3 28/35] scsi: ch: Have scsi-ml retry ch_do_scsi errors Date: Mon, 3 Oct 2022 12:53:14 -0500 Message-Id: <20221003175321.8040-29-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR18CA0050.namprd18.prod.outlook.com (2603:10b6:610:55::30) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH0PR10MB4456:EE_ X-MS-Office365-Filtering-Correlation-Id: 4b897228-b1da-4c52-b260-08daa56843bc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QcoRYQdKmujcdfAX8exH0yV1jLU8sJiPiwj5KxYI30ABdelZyBxmcT8F5SEjTOq9Vhroo9xbKLmxk+SjxR/8t2eR8OLE//tAleH4UTVGLZYFGuQcPJg+YKWKE1BAGOqmJSqkS1bzCbXgJZZF8iY2Jpy39IT2KBVD+0zlkwhKziqCPeKtsfEJBu50ovqQzDl/ad7hYgvm2eX7Spe9Q3koo4Me4OtH0T/CD2fsTgk36D67XKl6mrqGGBzJAEnB66lLHs01VfETtqae2YScccxmgc8PTpmkL281T+4AW0qz+4iNcM743+G7mOgwu5Su4KyZyGahnncZB5AoKhsuEQaDAtwec7JaFbac5FHVLYHF13fccQBGRhHghbq6QKz1yVkAlfEm9NR+NyP1kYLbiDe9E/zhE9AQdqF8fLgUAJy9XXb+p++efY4W7aV0ZE+V/lK2zDad3AueXh2Av6NK2P5wDRHZY9HAOUMtHxcwsDr9P3qJXHVhpZM9gAtEm2J7BKmafngFaByek0CHhuX3WCLiOfz6aVzeVecdZhFjrdXuV7T6YCHPF2MC1ObhzaAZPhsTs2hoGzADa/bHChRuc36fgCf+1Rqqt1zhrVrdfRgLySdLkX5iZTflEnoTwLb7NHFVFuvpZs2oZ1wfpnu9QvVR5ip1Opz/mEM+qrONb6ogSK475BckZaT6P66dhHQlWzqaRpEwb+dVZhtShi2zKvqPvA== 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)(396003)(346002)(39860400002)(376002)(366004)(451199015)(5660300002)(36756003)(66556008)(86362001)(4326008)(8676002)(316002)(66946007)(8936002)(41300700001)(66476007)(186003)(1076003)(2616005)(83380400001)(38100700002)(478600001)(6486002)(6512007)(6506007)(26005)(6666004)(107886003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ADYP6zSvPdvgkyu/eNsZnWnZW1oowd7P079e7j/tURzp8QwwrN200mfdSecld++QH4WceTdNGPKrxIVL/hYsHwQYZrPHd2gYRDuuDiPhcG9MWraSRGeVcbbnw4jzk7Dp2Zdfa5a/OF5GLoEgL0ToBDAo4coUIQolGHeHPHGS2zOQNqxBk21GobTj+jwRifvUp6CSsbAguH/UAWM9rvif3Oz446j+6QLzmMTWozM/Phzu2+e+bJEVLHEwTP7VLhtF150HPb++GH3WtLQqdoMlyAb6cjDBczu+I2ZmM0DLJNW7wEARj96w0xu+KQIeuIBlnXgArfWET3Imq37KcT1smZQp/MHSfjtPOG4NYZ2KXLW7eMnjWBM7vgWKp+VaTbZgD0bkn2XFE9wpEA5bF/XiBjmHU6hEHpBuPCOqqT57XKhbvvx5xXpWExGcK7pEcpukz92K1/jGGJUA7OfLDsFfRdIwlWKGy6PQhh6z02t2enj7SXxs6JcTDRoPZSWzsgaQTKGTtQmK9b+x8bEjemRuy93KHEtwV0JwRuTCTTd9/UdtUbg/SquN+qpwS84rrn5qQUSkVL1uxu48DFzjAEA7rA9sSL9jS0xw1du2OrL9AmoOKaVau/73iZO1FtxflceL54XPp0l8s54ptreSV9sFU/KFsx0jXIlFet9Ri91b2oqIW63UDolteUwiyXW6GiLVMowTmfUXKyDdfYwSrGMncnf1r5R/PZElBAPhkn4vV5ZuPiECiCXr9IQHPexA+ISsmDx41mKfZqQU8IEj2TARKtVbsH8tgbDvFfl6PcmEgdL5vHM5qyjgx54S0Bhv+L+DyevsS0mWwg9zgTcbz3IFs7fhQqNLEMzicJeYINYlZuTgrwodgfp4nUT5DHzxkkJU8ix1Ges+KY87Qnut+Ocog9XKJRsKfa/hO/utUpShwM7PRu2VXYL/Z/NdDMhj/nDFLhQSIdRXTI4+VjZeCuJX44qRaIHV13n7lCYS16S8AMv5J6EF38XPgt6Y/NFDYiEZDE1gsdIkz8NwCXdPINaJaj7oOAf0P9L2hJkbdO79NvirTuxaLgD/rKEFOMfZqh/HMBOgyCYIMLg4U8OZAc0daSaIBc61YTCnmNHGvp8cYfxpCv458Ujpf+l+oZBFNVdBeNlGXl2TClzPKykMnHGzX2Z8/6fXZtKvbwbl19h4vLWTU9tECYpVGvd82VRBOgZYm/iTZNlaMIpAMwpSIRU6AUGpK1OIRC73LpTXIPYFm4v1oAh5wTyKrHpwsSFFyZsozg3XOTH8jP3uxuwvwIuhv3oJjsnzCDuxMHCkhA4K+rhHZHc6ZjzHrTbndlIhAUULXUk4Ay0Z6CFjAi0FEL5Mf0CaOVwFtnKfyj4Xx8vttIwvodtdLVSof4ny8MKWMJM3G55MdXwQkDBDice8Hp5/5Kq7OBncXMZOwwcQAtDhJRw8CptnqHiAw7Yi/g5RTtH7/prrDXOSQcFJ2o+GKl41oVPVJj3StTjAppsr/61LeT9eBTWjk/8yIZt2gvoDUXfdaT13obu+Lz278uKx0ONBf0NcS7mEsbNiwwlUpLYPfuYlrwOfreayBtzVzSHamkZknRd1AIXg7S64aK25OCW+ug== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4b897228-b1da-4c52-b260-08daa56843bc X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:54:05.9061 (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: +MhQeaV0RVE9kLfUy+p2JWmaWxmzVFO4cz/hi0d5FbyfL3IxJ1SL5i2KqEiJyJ59FIproKLD19JEyARLHYmLRFSIEcro09i99Q6a4wJNXTQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4456 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-ORIG-GUID: UbpB0rmIvofUf1TUry_mlXq6lJlqUiLe X-Proofpoint-GUID: UbpB0rmIvofUf1TUry_mlXq6lJlqUiLe 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 Mon Oct 3 17:53: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: 612502 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 A6B2DC433F5 for ; Mon, 3 Oct 2022 17:57:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230034AbiJCR5u (ORCPT ); Mon, 3 Oct 2022 13:57:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229990AbiJCR5O (ORCPT ); Mon, 3 Oct 2022 13:57:14 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA998B82 for ; Mon, 3 Oct 2022 10:56:24 -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 293GOI69014329; Mon, 3 Oct 2022 17:54:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=LnBXgQTAP0cFbwPIFO58PWG3HtwpcODZWYDe8EZR0jM=; b=ev5cts+TXhufR/1sZG1d4caWEEArZWH/1yM92TLYNlJoqLffTRtzRhBMOjwOolTdv2HT b2Ie8bcu2OQqT2vg7wYOuBqC1ZWkz3oX48LgwaGzz2CLn3eqtqimF3PCFMduvJS3a3kp moZgHPFCDabWAtkIHcmtHvvltj77mQJi11NMxEwBJsGRqclF5hhYuPUN6hEOS3EbiWRx 1Ux0SNSl1JaqeBgRpxmObFchoEAw0TjaExX0cm25z9EvUrFb1qj19WkApEav17ewXz8A 6N4wkT2QQUVtN7mqzjuOuON7vJb/dl7wg02SZm9zOBDsgol8H0ZnGXrs1Pk5BNmlOdlK /w== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxc51vj44-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:17 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 293HbkH2028118; Mon, 3 Oct 2022 17:54:09 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc09gdnc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GztEI40xbUcTpnrqvxzWwk4qPovgPuTNFJXiwRjroKc0dd6IDYBmJMezct+vUB7gnJ9LpKlxTdUd2mpwrqUOxFnF8DGNVS7soEJoMpiEqJithKY0aESaeiswP5MNfSD3PqfYLxVi+Tn/7QxXu8WG2v2DLH5lFO0KZBP2xWFBmZdvPtn128VidE6TEbV7ZUaLxBBazLQm79Kz4TXTl0z6jrfQszzS/Gdhr9tEiw+6xCPCd5Us4GZ2IELbJuLPxMaSOqxzUGmTJwwSaKpKjxFTlVsIITKZwc/AQ3DLkRT5qXJcb00EFTpQPcjduKhoSck9gdnjvBbcun16Nxz/+c/isA== 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=LnBXgQTAP0cFbwPIFO58PWG3HtwpcODZWYDe8EZR0jM=; b=DHgO4vEOavpsDxLUoeUbckNMosU+Dc2jWQHXL2wlcr1WV+QKpIPowOJvvGeFMUc13A/TOO0L0RZ5M9wj6MzNbEgnt/Lzx5UrmO0KpRF7hezGt/Bmc4rTp+MNi3jB8qX+hmqz9Nswfh8S/w8HDtFXD2r57cPWlZidOac1na9xi1YLJxbrLxV01fPflQexjz8sueUisoX3AXeBxvSb4cwS+mG0vLK0A8ZeodTOaohREBMvI/L+DOwXN0b7zI6XSTO4J1Xos8LjXYGhnRVwtXnyXBkxI+vIzsBcWkKwivir4yoYjo/qb2fWR+M3w+34vkVGyxzrNTXyZsqsuP8bdvJ0mw== 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=LnBXgQTAP0cFbwPIFO58PWG3HtwpcODZWYDe8EZR0jM=; b=zTb8o/isoJEVK/w6oioPdINJD2LtBEC8Bhy+Fcv7eC/L1t15nGhAboNdH/LQUor+6vf6epGTU3jBJ0Zq596SRwnpSXTOqNch6TTYNNSm+ycwmcXo0+rnahYsOQ6Y8fdTcOS/KpqpTFCzUexD2Qls2Q5Z0J1JiLpVxVaeLMddAC0= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB4456.namprd10.prod.outlook.com (2603:10b6:510:43::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:54:07 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:54:07 +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 v3 29/35] scsi: Have scsi-ml retry scsi_mode_sense errors Date: Mon, 3 Oct 2022 12:53:15 -0500 Message-Id: <20221003175321.8040-30-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR07CA0009.namprd07.prod.outlook.com (2603:10b6:610:20::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_|PH0PR10MB4456:EE_ X-MS-Office365-Filtering-Correlation-Id: 870f32cb-6643-4b3a-f1a7-08daa56844a3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MfB/QTbrX5r2mF/xFGjIfHDgqhPt891GN5Z0oWOs27vmqICcR4w/fH8MeSesv2J/emvmHLQyegM7v8Ivosy/Rw2xXbcwE/VZZoZXaU+k17VqNGNS3y8e6zYaOxomb8xuj98STtBQz1jH22iAbeNwhlvGiK2IME+BmOhUoznVtmeXmcGf27HYsxRuskc78bLr76NSoBbKmyPxBR/sNVnJArgijOw+hxwqBQYXtSxlo4IOc5OBgYroHNNlFAATWSyyh2D8TT/DTgyGxC8Od+Cje9ehqWKUCHisCCO8W8ITrIjCKYkBMoBzh+afi/B9r1bNWQf+SjY1mTtL8eg9hgKEawyknJ5tn+bWeHwHjDZLZazJNrGtmd+81VPv4chTyn7dnOvdcb5WDS++HGy6668KWQZvvprTapCrtKMwMCuDCxKQ85a5DgOLY3F7lDh6ZagehdGulBTU44W2ZsQucfsdRXy6XzUW2IPwpGjXqDviprbzemyMv+BeLeLHpbPMcyrq37QqCZyCF0piO7U19Cj6n3AhKvKrERJs3Mu5PqmpyE4puFF7WfJg6tin9sTIo92TadnsbSQIsR9xCfkRnvQwnDhuc/p3b8JdTKFSyz0snoBa9C8oz6UXqlb1pZdPupmPJNjxJyubPuC1xET6kAbnxnQVcTGyc8blwxmsA7UYPqAMKPhy4xGIt78j7a3bNE7SBCJKfLnAHXUjaw4yqAX2aQ== 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)(396003)(346002)(39860400002)(376002)(366004)(451199015)(5660300002)(36756003)(66556008)(86362001)(4326008)(8676002)(316002)(66946007)(8936002)(41300700001)(66476007)(186003)(1076003)(2616005)(83380400001)(38100700002)(478600001)(6486002)(6512007)(6506007)(26005)(6666004)(107886003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Y8TZwzMRRdFO/pnWWignxLjy9IL6KGH+ZIFrx1c4WNMD53tF4fZYX/0/YMCuYTR3izeyB6RV5hRhkDHsrlnCVhSPhScbqaytOnc7QC+rqmqHE2SJNPwD4BporTVn2x8E+VqryW4MBJo8ZNph10Q+QV8YlK1+uRslefeKzrF2b5BmSVRehPo0lcd/aIAvNOzZXBKYoiBPti2zrJGsxwkuKN2Xvvwi0qMjTiVHf6Soq1zA0pxTLwDj4wt2as2rY1lcrwNLqZmKxeWjcdDKM/YQFL3CSp1dnJQPQ7KuEFCV6VzyCMx8h+tYs9Ac2QMDI63x51UbupBpk2E/05Z6TQ1NfxrTJ98DWj/el5qqeh9mlYDTzm6/tEhP0i9gcjZuHn25xLjPEl3CAP6WCne1eylBSU7Gyq3O+r4Jab5DTD2gmdRaFyYpctmrSfafywS4zlr+rMy4EIo2eZjDGZZRShAVVOPxAua2vIWqIbACIFPFpUb8xxoFBxSCoLL8+Vj8eOL0MNbUnQ6wUdfRzrUmJg41vSDRC0bHVcCcFf2lCyhtDkG0hjPQ6TkPIPqz3PCPrcidT2PAtJH7Dcfufvm/Y63Vimluna3WMgWkOurwsxVfOYJxu18S6eWHkGeftKWNeGhBsGW+hpad6CpGHZ0FDjdVq6lD5c9MUbEwaNp0embH0f3mm+1YccaqyI8010kwNDhIUlmlU7hS1rbSO/FwgPW31vxWzCvCQdOAko7MstyfwPl7pgjXoQtWHsYDfHV6lu/uXxXK0sLPeVUH8+wMil7E0m1qr4EtEYH1fU0mJ7XziFbS81W32klx7dVaqScdtgbsOY4+FNpP5NUVOndhmL2W/kKfMiMYrcZZMbc3gO94tjrctjecGKDF2XRA/ORaOZS3IU5plCLfr0348fla6c28V68pLXuRUFwhX1xDzvFxhPWnzVvu1CToeh46WXPv6EM40n3k3RVjTCNn4lVP/yYt7XBeTfHWUoSNs4NuyYQ7Vf8lgQI804ALonb6fQzMcrv2oZwfBAKkIwHnpZiokY0yiuCO54q1dLXsMsKlIHgQFYfIH2En4oBC+AMTF5fbEZO8pcnCF3seogocWZdk9w50mA4j8JfO+2N19qJltL/sNvQLVUmQFM9MvVqr/6YYrECt6tCdNnjwoAQB3O+6L0mtuUb80/Ea0Nzls99WxD8juFFl8xkRvxm4IiYRuAWh++nfxc9YZRFtjaBpNgOL4XAO9W89xOqiiqDqL/nkeX3OcpGo7a849ZZT2FGfTkuF0zWptnDG4gTSeuiDQ9Eg99mldT2z/sHtdIBwdZZy7JIjlI8QTd+qSTNMgo9R8hQ2hNBQsAtwt9NYEAzvLpMqU/v5qZ/WNr2qDIHzRVXMqREVY9ZhUNY1Z85Jx4bqY+fb+iQntTMSOsm1kXyeOMpEsp1tUQ9KrqyOC96ruKHZ7LjTwO2KS4KH3V7yzZRrOEMPuKsLDhp8yYwhX4RoLUS4Pd6h7viCYhSXXBKt2zafKnUZ23wnBjRyQfyzjP3pHP5L9jLo7tjk521+UAYBacYysYZdg/O1tuUn1pUTbdEBhq9CWctRHA1qUuAPm6LBG0Tnm2i72jWNcOTOpGvTO8OC4CKyPw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 870f32cb-6643-4b3a-f1a7-08daa56844a3 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:54:07.4373 (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: tirfGkt/+09XM5iJ1qMLzPObmdDBCH2T1Fd9aChpyfHdLfeD211SWGnocq2u/7XOV0o84uKJynXbs6gR74REPbSf/Qnom/xX2UYOHGkgyS8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4456 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: ewwQpK48vcqujbAT1wHuqmpdU45NF_gS X-Proofpoint-ORIG-GUID: ewwQpK48vcqujbAT1wHuqmpdU45NF_gS 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 2f36b65fe0f1..c2a899e3d158 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 Mon Oct 3 17:53: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: 612503 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 05A48C433FE for ; Mon, 3 Oct 2022 17:57:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230026AbiJCR5m (ORCPT ); Mon, 3 Oct 2022 13:57:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229904AbiJCR5L (ORCPT ); Mon, 3 Oct 2022 13:57:11 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59D4E13DE0 for ; Mon, 3 Oct 2022 10:56:22 -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 293GODh0019383; Mon, 3 Oct 2022 17:54: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=VtrK4YnTjLKA60qRL7+bKQOiYwfbqmy6zcwQYEfEMf8=; b=2YSjjlJK7tHWbQvsWeS+x+Bxwc8PYyln5B1foRFSBW7D+etwYey186HF66+HaHh5mTf2 8e6qjg48nbl0m3oilnIbpus+ngAedJnkw+RNuLAcp+G6CqKj49grFFiPgtxqh0P3EP5q kZ5H5ObZVUeuOPKiC13v5gBJKINAgMR0XAWHq1fkDTducMmm2hht+nri2iZrOUII4D1y 43QMNzAewGzSLLMjsfIr1jmUdJtXAVJXDFdXQrtpZCtiGlmy8F03U8tqBE4fx+q4vzji nVf4jNDNDRiF++wElSvTxFw4LgR00SpAhdeA6kCKxJyawJJGqelGrIO7LzJJk2Q7ayM3 HA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxe3tmex3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:11 +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 293HbkH4028118; Mon, 3 Oct 2022 17:54:10 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc09gdnc-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d+1/f8UEDFyNTilVKroinN/nP7UxXDrWDaIuP/7pmY2utU1A6ogeu6qzmow+VRBlx396yQv/vHiE0E2OHuSu0V1lchvUNjqSlgsVKAd4OI0OfnTSP+39Ix70wDnNJDN7gCj3GbhIXymLV2qz/D+mXjhfOjC+LNPQL46/zK4tsaHixxpWSVStuUNun1WC9S8QZbTJ7M6dmXYbD3aSVMkUzNeYK2FC1ZRglgNMGUHCqizYtwhyJbGoGtiXXmQwGMaezhicpufN2MBcrUYggSSL4iMByxaumuoUwKNcUWsD2IbEssKa/7/UQr54fJ+6MnMiyxBe9dPYBLbj9AXQcZ5F4g== 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=VtrK4YnTjLKA60qRL7+bKQOiYwfbqmy6zcwQYEfEMf8=; b=UYdjmNcDQBkm8EMAfT0L4r1YXXRZ9hYgJ5RgQOepNuds+lpd7S03o/1JZ9zz3gnOY2IDNhfdm92WdPyHOmpUpQMW0Tw9z3LP+270Q+5kItrpiuQnLRq34FkjZQ8+QkCZXUX0a6vZNBTCb2rupiBVNmX2d3FFJGHwikhT5vT4Rv7Q1QpVyqvslmD8NeThxGO1/m3wo6RRTBV7YM5IchzPosxLKNWxyMKL0h0JxjB5XYn2wjGFblNnScl640VMxXy1VjzO8FgrP5HIn7LBpaDYoH0I1cT2xbZFbses7dQ1n/h4YSkyeMdtYmPhpUrGc9IzleTTMwEstDts94nVE4jIcg== 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=VtrK4YnTjLKA60qRL7+bKQOiYwfbqmy6zcwQYEfEMf8=; b=jZPlBuSyy9or1Lk7jKRV8GvV6nTu9nmmrKCoeqrC0Acj3bxQMeUAJH7N2Yh2C4GdGL4GDDX3+6pf0kvpMKERysW2ZMEpju/D3fMXVDV5QTKiUscTt+1ljaPaSh+3sQTzTiA/WS/M2gpd6F3k69G2N9fcYHIWFF9V6jTrfwPaetY= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB4456.namprd10.prod.outlook.com (2603:10b6:510:43::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:54:09 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:54: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 v3 30/35] scsi: Have scsi-ml retry scsi_report_lun_scan errors Date: Mon, 3 Oct 2022 12:53:16 -0500 Message-Id: <20221003175321.8040-31-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR03CA0015.namprd03.prod.outlook.com (2603:10b6:610:59::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_|PH0PR10MB4456:EE_ X-MS-Office365-Filtering-Correlation-Id: ad3eb29e-394c-47cf-456d-08daa568457f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G09bvYT/gJspnNLVFWKyTrwXAVao4AEbHbTVKQ7R32JYShq2HXNMtO+38chJtXtOFFCreK2/hwNdjH7FCn6RcfRLGete4ZOTSR6kFNYCwhUIkrApgqQRH7oKmxM5+68eez/sMfjPEG9TOhxNHOi4QCastiaEZ0hdbSYzOj6louyB1zDP5q3215Sgue2mejXU5n9tWxEbP6QyUlxdWD1c4XXPMPDt6rEmjFB6mPEnBqlDrwfKYMX4+ietp5B8E+/ieFAyqjW525nkHOdAj3Bcrm5DSzrLXAkcrdG2/rj1S3Bv/9ggfpRwFmX2bl1LMbWu1D73pP6lyd2ZTlhIJ3nnso29/uwi1BoEched2VFJHK2cYig9lZf7ZKAiX4YwfXChQnP1PkG8mFK68KyUCMQekJwbeZqA6FhOhfar2UtyyEGwz2xuWHbZqmj4WXjKSkvFMXV59gTUSfCZEOfqKDJuHkV7MB2jwjw7q2+v+BEwMKlmB0QYuOtoJwfxKnSDU0RJBAhpSwc3no4sZoDmH52HbmbzxzEe2rFaW+y3p2v4Tl4+LFHcdfkuKryV+WTG6KfKMLAhGwzSlm8pU9VIE015xOLRYu/rQ4fq1WwT2WaU3ZOpsnofK9TO8w424zT+0ViksWQXbue1D4Fo/G5wcaeawRZBwhXgw3XUYbYUu81sYa2hW6kWmUo2fLhGefmOOtx29dWZjIkknOeRVTpcrQdV5A== 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)(396003)(346002)(39860400002)(376002)(366004)(451199015)(5660300002)(36756003)(66556008)(86362001)(4326008)(8676002)(316002)(66946007)(8936002)(41300700001)(66476007)(186003)(1076003)(2616005)(83380400001)(38100700002)(478600001)(6486002)(6512007)(6506007)(26005)(6666004)(107886003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FSFxMZH/0minRF+fJjhklSQRGhRGaYY2tywAYNZApbWj8X0MoDTpIHUaGvPDZZWOzD1hTgQNLFCdc2Bkj55lvq0x11fJC+p2YLeKGaeVtWRCNXhuyjthJ6EClDm0e0ZU4RHybYtCpsWxkq5NkTOK254tlZpniO96Skwy5FLgmwAnuH8HENEcboGU4dSXHf7tYuif9Lip6ADxgdEdkmnysWTMYR87StLqWnC30X9juYrRRT3k0Nj5SkXqxOZ0iR5Ygm4vFTV8pTY8sWp4rLVtHaNnQg4YDjsZ6qyoCkrJNyZPj1qH6lHuJBns98Ul9nupU6OaMwsBCo7ndYGAi325YJpEdVDC3ZbTg0DO58LHAPMi+Ut9lfe3utwJ65mtfnoAyuXm4Km2BfV6QnuJRRXkmkYNSvD4BhF5k7+UtLbnQXbXZ+tP5GUCLFCxaAfVsS63EHh3BMYv1nIRaijvUNFaBxPvBviSHhW8kRTItEXUWjh8vFaqI9qld+0ZVK0WJq+UUxLtpUGuRsPOXdSWUmis9nzFiyYXeM/G54ZPyBhyBqPO1mPoTiROTeNCwZRT6kknIXI1cCNp8UkzdtZcqWXE5ZwnCM7V829+o2QHwQlADIwXywByFR5U14qg3z1YOlrIn/gmWiJ5DtfWHyDJ/jWgnOS7oqL5G2qoAHj141Sem/y9sIgOWe8qP63BzN0s+kcZggd9ps/ob6v6edGTllzEmKb20L1ZBVGAR99c64eDPjBEjyGdAEL/lnTMxhsmDJEOIAW6BQr+xs7Z0pi/MSmhWL6ZnKzaVAJUa8ysVccnSSCj47of/VQhmiBNCOOheTag/zYz/1SrjcBxvjDmjiYY/Wk8Tk1E5K0gwbZahWjy0aKEjtS52OpP6CxZotpKO9dL0PPpXdrhzIi77GwVyLRhOLF84EsbF5EkFscN8LBjMmG7gmfSwam5qaMBhhTSFmi2DHck3D5JRL3fKwYDUkMpmteboNz9Q2/5pMx4qc2dTSkDq/A99+p/R7btNBNjcIcxUD5CtJfvJzK/L06tYh4zdzmMZiGxTyLvyIdK38VqKw9aK1ZeyAsq2MnbpqojQoYBJ0F04JNgxybL9u7NbwfwhOjOX+UajEh9IVBIKP/zxs6hf7LS49qLolEjTY1FCQADXsmZ06F/8nUF8wY4LcIxajl7exTFT8TZa+n5W2+cbqj00JDj3P0RHL3I+rA937d2EGN4wjTvTHQwIQBkawz4PDZpjEycdbOtsQhOZ6dHStFT0wqeUOrxTqoBy3i3fvCU8hzSF9W0YjmXkpFL1HaRYTDKqAPNUE7ATTwe1RM5s/ju/rHzIKmKh26OIn11M7MUxfyf550aZ6BnF0qmxTengEWkK/UepJPWtbwu9w5B57SFYpHqp3QzpMjLbVG89kytdxx9bk3AmdtON7qkwARJqkfqZTJhBXhf1MsedGvDeOsswi9i68UZaMWKhTZtDMZrYwQkv7qxb4COP8fV5G7chLqQ+ZUh62SvKjnZcIaLw1CCHKWsiriRFY/GVgnQ263YeHHQYvtcUcpcfhbJI5jiCgSljemg3G2SsEkmTgNLgpb9HKo6OMPA+Q5zazwZvn8xz3OPc5UJhlHZyYPm0Gxw0A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ad3eb29e-394c-47cf-456d-08daa568457f X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:54:08.8434 (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: soH2oATi7hHqlAv2SGDyJnCtsNcDfHOLA85IRdvRReQpE/X9P8HHe+CBQRd+zkGL+MWx8VJRvGBnPVYx/otJLm+ppaJ2xFG0/vSHId5du8s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4456 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-ORIG-GUID: H4vlWIitLiSLueqywa9OePljzftEh0nl X-Proofpoint-GUID: H4vlWIitLiSLueqywa9OePljzftEh0nl 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 | 54 +++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index c45646da6c71..e3693aa95543 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -1420,13 +1420,21 @@ static int scsi_report_lun_scan(struct scsi_target *starget, blist_flags_t bflag unsigned int length; u64 lun; unsigned int num_luns; - unsigned int retries; int result; struct scsi_lun *lunp, *lun_data; - struct scsi_sense_hdr sshdr; struct scsi_device *sdev; struct Scsi_Host *shost = dev_to_shost(&starget->dev); int ret = 0; + struct scsi_failure failures[] = { + { + .sense = UNIT_ATTENTION, + .asc = SCMD_FAILURE_ASC_ANY, + .ascq = SCMD_FAILURE_ASCQ_ANY, + .allowed = 3, + .result = SAM_STAT_CHECK_CONDITION, + }, + {}, + }; /* * Only support SCSI-3 and up devices if BLIST_NOREPORTLUN is not set. @@ -1495,34 +1503,22 @@ static int scsi_report_lun_scan(struct scsi_target *starget, blist_flags_t bflag * should come through as a check condition, and will not generate * a retry. */ - for (retries = 0; retries < 3; retries++) { - SCSI_LOG_SCAN_BUS(3, sdev_printk (KERN_INFO, sdev, - "scsi scan: Sending REPORT LUNS to (try %d)\n", - retries)); - - result = scsi_exec_req(((struct scsi_exec_args) { - .sdev = sdev, - .cmd = scsi_cmd, - .data_dir = DMA_FROM_DEVICE, - .buf = lun_data, - .buf_len = length, - .sshdr = &sshdr, - .timeout = SCSI_REPORT_LUNS_TIMEOUT, - .retries = 3 })); - - SCSI_LOG_SCAN_BUS(3, sdev_printk (KERN_INFO, sdev, - "scsi scan: REPORT LUNS" - " %s (try %d) result 0x%x\n", - result ? "failed" : "successful", - retries, result)); - if (result == 0) - break; - else if (scsi_sense_valid(&sshdr)) { - if (sshdr.sense_key != UNIT_ATTENTION) - break; - } - } + SCSI_LOG_SCAN_BUS(3, sdev_printk (KERN_INFO, sdev, + "scsi scan: Sending REPORT LUNS\n")); + + result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdev, + .cmd = scsi_cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = lun_data, + .buf_len = length, + .timeout = SCSI_REPORT_LUNS_TIMEOUT, + .retries = 3, + .failures = failures })); + SCSI_LOG_SCAN_BUS(3, sdev_printk (KERN_INFO, sdev, + "scsi scan: REPORT LUNS %s result 0x%x\n", + result ? "failed" : "successful", result)); if (result) { /* * The device probably does not support a REPORT LUN command From patchwork Mon Oct 3 17:53: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: 612146 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 D74C1C433FE for ; Mon, 3 Oct 2022 17:56:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229956AbiJCR4M (ORCPT ); Mon, 3 Oct 2022 13:56:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229950AbiJCRy7 (ORCPT ); Mon, 3 Oct 2022 13:54:59 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 225303F1FC for ; Mon, 3 Oct 2022 10:54:25 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 293GOErC015527; Mon, 3 Oct 2022 17:54:13 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=XcP6EsDX9P9l2B0FS0Qa+71/lCOO72Qq1go3QHLrICk=; b=dlO03BbbX914dGvawMjsuJaJ2uYVO6aq7G/HRmU9V/+AHwGJ/lio9t+lKRLUPg/NO/tq UkyurfRgV/bodiwH5zAc7fLQm/t4VRaR7KCmwEc1tLMNpPOhUfMPIJwGq95luuSXSQbz bgj4mK9r72yOw08MOl8imow0JN2ja++3hgd5OHlmySTknlU3f6ZYNS+D2kDBLktYcras OJxUeRpEtqE+rl+nnB1MogzRhJZRXA1/dwn9Thka8VHats4nMzVioEM5kG9iOrVcCwUA QHNU0AQVpm0i3bvoLkBMjSoPftCYtqueY0IA2rc7ke1vOMtQXZ5QvwI+2NEovfd6USN3 kQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxcb2mbnd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:13 +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 293FFjNL014072; Mon, 3 Oct 2022 17:54:12 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2103.outbound.protection.outlook.com [104.47.58.103]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc037ymt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CaFEK2611KRpOM2m+b/dHp3hem1+ckNAuIdIPdEo+sydk1YgPvXLLKidY/LZEtHZjTImUGMn1AMw3DIcsU6ASmTsgZkKUgAjwsM2l24wTWYHWLMSjURBGOMvroKqnTiIUcWBCCJdNeGLuPza8KHRT1WcIBxRJHw17fL1Xmdqg7H86Wc0F1rvMQ5AnTFrd6xaaI3/cFm3OlIytYaLmmJo1U8t5MrXP9C4z0u+ZXb2jt1Hjdm/5MchUOqqOL8Md073WVm7icpeK88N6U0oAgM0rfOmR70UUiUN6XKaY7aLsW9vWgsufwDDbP459ubkmVfpkH6h8g0sqemZj7yx/deZRw== 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=XcP6EsDX9P9l2B0FS0Qa+71/lCOO72Qq1go3QHLrICk=; b=iWPvdcSwepDPSnCiuOrPZlGNi1FEKZ+xNbv4WrDYTCso6oPb6Fnd2fz8908vNATcwUmn/TDhhWnIR3bQKB3NWpdFbDzMjhVYg7kBpK9mHWOXZMuTgpIH074nSqOEv/Ku8Qn7Hwzjq2FBKXcDBzOB65iUnQpnrWs6erW/rzEzy5b0kWVKAZwvop3QuxuVo9VqRdiXlSHB07kDV8z8TVVVDXtyLcbOLdBufhO88lpg0fOiu7T4Uxomjhr3gTugxY7+mpCbUF6nnQy9kqcbajpGCZS2YsqMNPOa46LztNEenxT6cNd1ja52HK5OZk979jv+NdvSzv7v6A7fw564Evsi/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XcP6EsDX9P9l2B0FS0Qa+71/lCOO72Qq1go3QHLrICk=; b=UysfXSQ9/OVqTrAEqPLYDH3uXSSkvxuWa6tvut8OG8CSS/SN/wWaBtgjvXss2/eiB6CeC2GHXkjcz1fYlnVHeRXGdlifspBLmqsrthT7MuGkfwymYaQ3z5gI2yo9pOQBh+MqLZ89WdqLqzMKgWwpQPnU2GyE31rh3lROGR30yEg= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB4456.namprd10.prod.outlook.com (2603:10b6:510:43::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:54:10 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:54:10 +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 v3 31/35] scsi: sd: Have sd_pr_command retry UAs Date: Mon, 3 Oct 2022 12:53:17 -0500 Message-Id: <20221003175321.8040-32-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-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_|PH0PR10MB4456:EE_ X-MS-Office365-Filtering-Correlation-Id: 16080e17-c1e2-458c-226a-08daa5684664 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IgWQOG5ZRV74xAfcZtspijfF6vbTxCgme5kzNpOwj11cXt0oqOefIm1iNtaxCXpyWsVAZKdyvXJgQHQxmeB3WbyoriE62px71Mz1NIhD+j94NoyttrKX5nAP25C7hnLr0qS4q08Iklnqs37v+VyT83Bxoru9GHkaSGYQ35bJKm9H7qWSqgOtOErma/NT/r6vMhJA8fShUf6fcs3oCgTQRVtEp6GVceXpfAalx2rLyIE3460TnpyUrw9iVW2EE1DTE02XsHToe0hlusPUSZrxYQyVKtieSfzQmM4HrYRq25mJkgAEgjCTOy3uWtDZ50BWlvP9f9sLS4KrYhGsywypkuLly8YozYvw8SejNU77KpFz28eqvR40K4qbf3ZxBI3OtlBto4I60VRxc/kpYKXi7K+uEjPOTfDVjI5Ytse0q31Y6Ru4gv/EqSTStfGok6NZKFdhZVXfYdrNM3EHCPAV7ARqCj5OMuNFiUs+WOCk5XGe1yw+v6EjbhXU3J+a1fts1uIeHDXBRNZ0ji5X8s+spBFTKL7jiSzoQu2hv5Jj8ku2H+D0db1/FzIUQKgEtgF77mtPTLnNv3IsJouIWofa2i7fp6nRAr5dHVVdmgeNU6WCHfsI3lfHeeL3mkafPwMdcwC6KUjy/KxiZ89+ZyyEdmbIF714nT/0a2IYTolcbNvxm+Y+0LTzevNw+jylSnlKs+Z3WPEAcRKeQBlqIPJ4vg== 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)(396003)(346002)(39860400002)(376002)(366004)(451199015)(5660300002)(36756003)(66556008)(86362001)(4326008)(8676002)(316002)(66946007)(8936002)(41300700001)(66476007)(186003)(1076003)(2616005)(83380400001)(38100700002)(478600001)(6486002)(6512007)(6506007)(26005)(107886003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: i5Uca/gVugzN0AdI8I/wU2V0EO6uZWUp27z0UH8HSdV0rRE8tPscfUoEuzYqr7HvvGZmqJYaPTpthlGHcbnxJPl56OcNEfK/lUpwgOCovBqRgETSAVwMocVaErXCITbCWMf1l8ikOtQdbnCRENU+60OQR/jlLKhJIAZ1r05/44evb9oxIV2gUTu2+D4fzDYqR0QBaMiYb8G8PxAarzrrJNkTf4c3EBGT1hdxOtsOcVt6sRFTHx5fqQrvyxW+CHJR8qxVDlJcSBDW1bzFA1VYHzgOE/EsdTlgbs7ZSCPLij09Yb8P7nN6q4wMdvTqSqZPxzaVPkWsa9gjRvHDXDaCMOXIoTrVezQwaCLa5m6I4MSWxxm1GMpzew85NmTLSsTBmCVm29gDUh3aHLj5O7C1tculBWKR5G2cJm4W8TB6osI+UA6jEF4+7Yd8/NQX0ThWFYidczrYDYokuOWTOYU0eYtpChSBIChFPrFIFFT7YAPhqskY1snCfHfBvuT9UOZKnbf1Xt3QCY5FOCY+3aacn9UxLXjcuyId+dbDBKoTlbcyi6b6ahjGZ28h1Na2saBK8I+aXkYw+lLvBZz3oI/qHCGYUNsXxsXFD+X56UDpoXgGAkAz6EzAm2y1fiYTbtmMz0uiHv0nrE5nmtnFuS5SXS5eoiYVv09JzzuC7kfpJchiHxuAngpAhlN3RuSeBydV3daVwB2uLfxs3iqXDXkVbK9yvC3E2V7ysaK2yQ4XJpnb4x5nSwn7mNTsw0lDahuHbk5ukHx23mx0tSQPaWk9EIpV/AXa7ZYdrcJXhyhluCDFA1WjLNSKOkgwtm/4Yl1woWAsnbcALwCy8EV04789eM3UTgvCuUkBYxFA0VasbQtzu1qBVLB0sNANQzlVrKvGSsUrTbaDVy5CSxpz2z/M4t1XZN5F0bx4oNFmZiqt7eCzlI9r/9JCnODEvN/E5c2uq8y+jcZ9Rc9XzwqIZFUEsAEWvN+kVOgMp2A2rTHvhg8S68EGku/Wcx+pbtOJepNgJ7C3HHo1nAeubdtnYFDwY1DHs4qr6l8WZMnoSelCN7/tiG3qBTVRfMXiCzrqZ/GEmOVAJ2Z2y70RUR1/WYDOk6N2JFZrr23Ert1W7Mhjp6zJMQo3Ne6UbTYzYZl1GGCmnTindKkjx9lM3cU7181AoVmgcrI/TV90wiZNO2dQx+WznrVBb4cyzZnlO9JaMgvdJnBFXUzmraK4GEO7DlQG5IwBtQxx3Dv5egiW5FIdajPtgigJq0E3TZAkhG5/Z9oXuoN8+6V+U82wEz4FTUPVYHJREGQ5iEf3TiWwSuTrHqKACNveVmAvORnSEkvYtlZZnUitpRRAxSd4msvvBnuyvIs9CS/t8Ebq0F7ThXcKuGbiXp/oy3egmW4nvOabzNO1B2XziuuSsR1GIVvxHS8XZaZZRurKgfgcw41OF5ldvR5HZjIaXTLnGyfdM0167UG5Gn/nzyibnatwleMzWzfyYgpWU7O9gBt4gZsTps0YY2BapPV6S2jpB5w9WA2ZVq7k9vkSLkT1cF1+s3wwiIvSMLkDFhkdLkrmlYEfNKBAKf9SLZ0mpgA9EYwUc8RSTZT1rk+FUHUkeqhS3Zu/8bnxIg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 16080e17-c1e2-458c-226a-08daa5684664 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:54:10.3433 (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: aWcEAvwaZ2V9bVU9fgzXIpa9vGd2cPO65pKYjyGKqfjgPdtmQNxHDeu2YIPHFeni504maosfF3h3qJyRWUcA9x7GJHoWq5HlT5upJ1hAPVM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4456 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 adultscore=0 spamscore=0 suspectscore=0 bulkscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: rmiaHIkd29gOAjg37TPAkkFafsOn9GMH X-Proofpoint-ORIG-GUID: rmiaHIkd29gOAjg37TPAkkFafsOn9GMH 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 a6b6c769dee9..cb07a887b40c 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 Mon Oct 3 17:53: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: 612140 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 655C4C433F5 for ; Mon, 3 Oct 2022 17:58:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229994AbiJCR6B (ORCPT ); Mon, 3 Oct 2022 13:58:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230003AbiJCR5Q (ORCPT ); Mon, 3 Oct 2022 13:57:16 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4061D40BE6 for ; Mon, 3 Oct 2022 10:56:28 -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 293GOJRs014345; Mon, 3 Oct 2022 17:54:15 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=n9qvxMk/MqOhLyjFdSy8PDxv7RKseupKjD1lJCbD0O8=; b=qCI6RunJmPXDCcXuA6m2TFC5BFi4tNh8vRJ4sb7mBUZegdrctThOPZD6V+Wd3utLvVpW BySp6RtLfKziF3e+QkLf9wfphHgDdFQKel1bOr3ogL+zFnH08gfWpsUp4Isnj0c1cung NKsBkV4GGh1FIv0CMN0PFhVOhYn0nLgK2RS3/DjJC0elXIbL9DFFtW/knBy9z0odoxg3 2+CjTGG19N18DdT66FXzUngdi/dN/gscmyAq8b+tl+w4XRqENJ15qiTbpUv+CEbEfD9Y GX4/vceIpFfPw+o40ndDtMWOcOsDDx9lB4qSmmwg161af7NKEYozvOmpVlW9ObFJ+Au5 eQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxc51vj48-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:15 +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 293HdCZV015791; Mon, 3 Oct 2022 17:54:13 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2104.outbound.protection.outlook.com [104.47.58.104]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc03g42j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y/0R5a8PXjWxzVSmhliKmgcvgG3xG4AfItJBmqbbhY7CIiFGglicrIuFtnYrLqEB2+NhILGNXqJb4yoS+IST53O1DpeznW5GmYAsoKebpNG282JGAxSMBZ9FdnitNlPP6/Jf354SqUG4JStvvZMslp9LuYzJzCJtQpo7LDm1CTofhJZzLU/D+QoQZ5+s7TlKmAfiD4vz2jUiUEQpb5hIBYUlSLr/8xy2GbNtJIZooJMTKMzZtBvoc5jMmdMZOEeru+/elxM5Y0l+GnMLxX4C00jlSl3h+lCs7wSGenLKj5PAMS9Wv3w7+MycAf/zwnku8O9phAiXm9GLT6MSItupSQ== 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=n9qvxMk/MqOhLyjFdSy8PDxv7RKseupKjD1lJCbD0O8=; b=oCPLzpLjs41U0vI6OmKtCprvaLGitjx7TazYKQ+tcFnsg02axhgno6fwh0Ikem0RdApJH0A+eQKgFxMfz8K/uoqQGx4ltBYKn5bZgmq/rB2QY2bnTRWx3iRH0bv9fNpqD6s3ebAmoWPfbEYF45s7ugztxFtQUyTTySf+3nM0ZaxNPHLDIs9hCY+6itI38+aZtdIUAcjuaftboCGtK+daa14Y1WIY14Tp72JBdSbIl/kJSQbhm3hcMBUhoioio4gYowJWTuF7LaS3UY1TJTKanrRLz9ABKAU7kV+QwdhO12SXBXKrQd4XyO1s03DrD+CIHlxzAsx73IbWcBmjwlk4kg== 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=n9qvxMk/MqOhLyjFdSy8PDxv7RKseupKjD1lJCbD0O8=; b=OmR+8JAKaUt1dJH/yBCxr6SUMSNxM7/uva7N5C5a1H7WAk+57srE/cARKNs/OSDZgYIK9xMeVPOp/ntPd7NIEiSW7EspM9lQx70Llg9yFjRsMlELXo/RukvzOqIo9dkfVuTwF3Few4rwfgMVz8Lv7/B8VIRk12dMxQhice211Is= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB4456.namprd10.prod.outlook.com (2603:10b6:510:43::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:54:12 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:54: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 v3 32/35] scsi: sd: Have scsi-ml retry read_capacity_10 errors Date: Mon, 3 Oct 2022 12:53:18 -0500 Message-Id: <20221003175321.8040-33-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR11CA0030.namprd11.prod.outlook.com (2603:10b6:610:54::40) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH0PR10MB4456:EE_ X-MS-Office365-Filtering-Correlation-Id: 827569c9-6f53-46af-c3f2-08daa568474d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yOapUx+930BJspyYvzRR7Zuse4bA6EYiyMv8/ZSb7bb1LFXIdrnIUenv2p8ju5vgd8hFjxYaweHq5srBV24noD3XespVG2cvNT12dQcGvh4e/UesMhpE13C/WEjjqrhj9KWq+nEhVHx0XcATmOPSeu5/UIrDEhFFTTOO8GMZWQDIhEGK+wfH8QhjbUy02/bSyzqpEknqvkrMQpALwDCUiicnASBDF3Fz7jgh8zZncvIDNUitKGrXZD7ZCnXqOqp5t8w1/B3o3NjIKevYHJdv6gfMUlAS7vz4v8z8fpRvnnO3Wd1gNitYE2ATULPksB/wKDRK7ZXFCns3Ef/xRr09deyOmDYPwNJngLigyNRjBRz3aIwi4LXykzksbXz4mYnawr47O0LTrdemIVIfFolBqP3El7fP5+UE50EehpXhR3cE4hXwx+wt+VnlNHQdVUHAS9uUaWQjgdufr33Fc8syLlgh77ym7gFuymv0CDWXWMVFuQRot0QmCR2OuL/aNmj5nuqWveI0eO9oh9aOiS/AfM2SOSMAlx7OlVZQfqoPbxuWLpqQ5ITcoCgpmsBs+ZlSw6E/0bVxT3ebL2APrEeGsbU8MrkL9sKy/9W7acMMZBl/ocefAqeqVUOv7nZU50ikIx/phtQXlGfSogP5L4d2e1CRHqXTzyEYipzlExwQStI2aHKeGq2nkSGhhGhmTovCYTmIR4YMZQHCF3HC1zzTPw== 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)(396003)(346002)(39860400002)(376002)(366004)(451199015)(5660300002)(36756003)(66556008)(86362001)(4326008)(8676002)(316002)(66946007)(8936002)(41300700001)(66476007)(186003)(1076003)(2616005)(83380400001)(38100700002)(478600001)(6486002)(6512007)(6506007)(26005)(107886003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 38wHV6kQd3Eg5wM0s/Tb+k6OErVsqGN69MKnACtm6LacfVlc4Agk+8XTs1J+0cwByKPHaCAoHP3Qe6/uI3IaA/ZvujmGm9oycgRzOyutd6SfAFhFtaxpoN6CZSrGGzM+Osb/J/iX73ui1A0K92oS10rcia+uc0EdrYzGW3YVO24JJ+Ec8r39/XoNORK2H4MNrEJn6lF2OW2ml/0imtfFCIL2pXK/qMmGUl3H7k+xdsOL+bABkbXEuIPTbl0JjzAatdvrTiJuoJV+UlBz8G9TToj7I45E1mhDvUIWqhHr4nHIB1RC1MFGcwKQJhFTMi8+KAvabQJVErNuQFsbsJIG/OPHB6xok40VsahHPi49Hzq+7b9/nIiYanedRmV99Y2cOB/pwVaa0pCLvgQrpTHSw187pImU7j97emutZSSppSoGe1k/fqZCrWd2B9sCjVHP2haB6HMi+RLEvEn93kHR6Zcyi4M30V6F1qB+YtZ6Mo3CCLzZVIA8rbgDNhIlHwRpnXLmneb+HWN9HEmCUhk/b1VKnRR8t/XoXSmd/LBaYlExT2+pxcUOaNn6NOoeTpg9rWazkHdlcNlsw7ZR2/gKxpkh6e8xCR/QQ6dos2O4vQWV2Iy4rUsFgSnT1lY/6Apu/IZtP5K0/zllEDpzE45c9Dq303n0QhyTkhF8L4SK4yoKXa4qmEYvVtSxHTjseNp7k4CTGcZGGPgF+etMRg79kNitna+K8x9a2gRPGpEHHVhwnEsV5VQkiu/y69XiELr/thty9yMZSt5bqPbHtFV/PAzRlJN+B0hmfcKGanyLzyMnX6XxtSlsNfBCVtFBX7pbnmwchQZlolwy9+DNd3M6Qjv+RxnwEiEPbdf58IhB0GKH8hmLttax8fqlikmqytF5ChBnintG4Y6E/XpAkwWwuLShNge61IDOb/LmYSbJml3zK4zwYgYppyKa3Osp7saRpMq9ByNMwrMBVMTR2rbGbAUHXlowwKWJyiMfNlIlb7LCi1in47Kl74szyztDaKHy0zqDBg99eSVU4+mzlYyiAQeZ1JcvVIhi6V3NO++GmqnhrFD/U9jHfK44FDep33A4w1QGM7NLvSZvfZfBoPAzcA8KV4xQgzTK5GZ2L/rtd1wpIIcRyg5axF3lrptGCALjiyzPtPWoKIf9MHkRC0XYKX5Qx7BPQ/7xmg0PHe/VXq94v0V+USm8YripV3vxbUpOvfADg5WlO1s2p9Lge8q1uFRSZqkA1ckTAkdPvo9GJCLWxxCRk8LWaFrMhKrGAhOPrz8qhAxKr/aRT8Uc+1kULerzKrcLJtu4aZaRgidxL8aGyIG8t5C17kJZxYdIulRAcTt+2j1VjqcyQnZhB526e3pws6QPXbrxuto01Tpvq/TKMOrPuHlj/Ch8syBJxgSq2WkXmVdhjVxu96b3aWJ9/Qe+MBtXj0nGHtRHT9D2kP8/0wF24bvhXjIAuiN3VaX39+T3qEcOJduPZ7KS6hkuryf+psxDpvYd4ICzyBPBIo78h8ekuU+KYzbFIiQ5OhZDxCbZFWfjLHMguucQS+lQ2TiuHAl/lHOc8o+dFJTewXeiF1aHPL4j6t/PrE1O+GMSDbjcC+OB3rBi2zLjrC+aNg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 827569c9-6f53-46af-c3f2-08daa568474d X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:54:11.8744 (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: jlFAmuWpGNxr0UoCPNWdQNquBWOXfJtNzvUGq9KyGWUcEUaMO0HcWwk8RkOT1ftBPSO7VFQ8zm/A8E/9ET5bQO8oYVFLT7gKG0Y6xSTaaY0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4456 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: tgcAqJSorgJDsCap8a4VVzsvCJ0Pct_y X-Proofpoint-ORIG-GUID: tgcAqJSorgJDsCap8a4VVzsvCJ0Pct_y 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, 30 insertions(+), 30 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index cb07a887b40c..dacd54af40c3 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2401,41 +2401,41 @@ static int read_capacity_10(struct scsi_disk *sdkp, struct scsi_device *sdp, struct scsi_sense_hdr sshdr; int sense_valid = 0; int the_result; - int retries = 3, reset_retries = READ_CAPACITY_RETRIES_ON_RESET; sector_t lba; unsigned sector_size; + struct scsi_failure failures[] = { + { + .sense = UNIT_ATTENTION, + .asc = 0x29, + .ascq = 0, + /* Device reset might occur several times */ + .allowed = READ_CAPACITY_RETRIES_ON_RESET, + .result = SAM_STAT_CHECK_CONDITION, + }, + { + .result = SCMD_FAILURE_ANY, + .allowed = 3, + }, + {}, + }; - do { - cmd[0] = READ_CAPACITY; - memset(&cmd[1], 0, 9); - memset(buffer, 0, 8); - - the_result = scsi_exec_req(((struct scsi_exec_args) { - .sdev = sdp, - .cmd = cmd, - .data_dir = DMA_FROM_DEVICE, - .buf = buffer, - .buf_len = 8, - .sshdr = &sshdr, - .timeout = SD_TIMEOUT, - .retries = sdkp->max_retries })); - - if (media_not_present(sdkp, &sshdr)) - return -ENODEV; + cmd[0] = READ_CAPACITY; + memset(&cmd[1], 0, 9); + memset(buffer, 0, 8); - if (the_result > 0) { - sense_valid = scsi_sense_valid(&sshdr); - if (sense_valid && - sshdr.sense_key == UNIT_ATTENTION && - sshdr.asc == 0x29 && sshdr.ascq == 0x00) - /* Device reset might occur several times, - * give it one more chance */ - if (--reset_retries > 0) - continue; - } - retries--; + the_result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = sdp, + .cmd = cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = buffer, + .buf_len = 8, + .sshdr = &sshdr, + .timeout = SD_TIMEOUT, + .retries = sdkp->max_retries, + .failures = failures })); - } while (the_result && retries); + if (media_not_present(sdkp, &sshdr)) + return -ENODEV; if (the_result) { sd_print_result(sdkp, "Read Capacity(10) failed", the_result); From patchwork Mon Oct 3 17:53: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: 612501 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 92D3CC433F5 for ; Mon, 3 Oct 2022 17:58:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230036AbiJCR6b (ORCPT ); Mon, 3 Oct 2022 13:58:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230010AbiJCR5S (ORCPT ); Mon, 3 Oct 2022 13:57:18 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05C7440E1C for ; Mon, 3 Oct 2022 10:56: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 293GOIZJ014336; Mon, 3 Oct 2022 17:54:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=bv2QDst3SvZ9Om5sDv86682KKPj3G+AqO8+l3f6Ty5k=; b=YNkwTK4NEshF+einOA1K1SFpnNXA36NrA/jpOrOm3CnP1j+krOzVwEQaVQ1KZoGgTe6A zMLkVHc3D8b9pUN8osR4zwNdSHjPfd5q5YoPj28h69DY/UFYHVVQWyIf+khAXc0fxEts uhLKygrxV0EIo36NRbldtMnsn2x4Y9thop9+rR5Saxr4lNoWwOeHKbk6KDRYnNU4NlU4 bTDzSi0M/XD3vDeectutJ5F1H1NCbROaAWPiO/vjWUdixrAOK/K9tKyTAxpNCHNdzRS9 Pc45cn3OKYF/1xva3bHpG5OdEv3A6rYSESeYhx1AM17bOScJnPwEjyAEdLtadwIl9QxA /A== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxc51vj4a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:17 +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 293HbDSG015544; Mon, 3 Oct 2022 17:54:15 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2108.outbound.protection.outlook.com [104.47.58.108]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc03g432-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RQ3EruopR3JeEmFqmmAfCLwFmXzst3EuMO7f4/fm0WHPAWAiJSgBlNNBhn/iCjTgeA/unmcZdMJRX2YIVMgJUs/BVS+16NIz6tOTLE1sCsifvJr2pU+5j+SXd7E1fyofMlEHgH6GSn+x66lvG5Uow31iqXHTF8M/bW0pdVLl5KKXhf4T1o1G8H6B/czrgiEHWCBCOK71RKVOUie0qjVLFkSkMebg7/I8KK+y0CFh7Khf7osIYV5fp8W7+1nZVMWD7oLvCfpgDk8qC2WM8AtMWhbAnCYcilqXKF2b+aZ+UrHrvst6cr65IotjynEk0UlD0s51wnuyX+Cj0QLd4szZww== 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=oYwbAtlEl5fhJpiw9trpvpWjozFFGVmoWcg9n2c9H1PYaWg8P1ANOSWEqOmgQPDNldf12KWlFRMiocfRKxv0jqQtocQfLg9ytuDZ1LdEz5W//7g0fwk0vzO8fKB3DnkC6raJbpmZxWMmsqHobhhWpuZGyZiNSTWpUdkL+TPNQnPuNDPFu2ZZlBDkUwQewyPPEg6tni+k1o+/4OmkBLMypuFTLVB8+ZowFR1GBvNK6ixvz8zzc5V8ubpN8KLhQoUIHcV2tMKT43lL66RFKk3ShezF+1uz2ijBYe8qhpZH5KhbPW0FwYCGftmh+CA4UfL8qXwduuZ2lP4EeQiJQAxJlw== 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=APR9YRfCXDs08YbeV+aMu5rfINgQEfqD86zf/V3eZc5M+znoXgQa07oSu7hH95QTNJUXCmINN0Y2DeuN/RsXaIdn72fNSTkEicfp7/DoUkrL4W0tf1vIIHQ3BlzXroRA6Q1o1m0/dajGjBawyqf8aP2yL8cnPLn9newrMaz4MdY= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB4456.namprd10.prod.outlook.com (2603:10b6:510:43::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:54:13 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:54: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 v3 33/35] scsi: ses: Have scsi-ml retry scsi_exec_req errors Date: Mon, 3 Oct 2022 12:53:19 -0500 Message-Id: <20221003175321.8040-34-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR07CA0017.namprd07.prod.outlook.com (2603:10b6:610:20::30) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH0PR10MB4456:EE_ X-MS-Office365-Filtering-Correlation-Id: 08327590-b7de-4f5a-f0d8-08daa5684821 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZgM0RtuV+pKpRaxGCoLqy78r7qRQCTkmN8XH5V4Hd4V3baQaUMB5Z3P2n+aSc/8ftaTu3CeB5HG4ousPDqRlx3pgT7hz7vI11lZW5fPO8iDbmCWQVSg+fwQ2+GPjIOCXccDdp7/TeSViQz849K13R0A0kCIes/9k+74UBR4aUnkI/pimNiUjK5tVx5xWq+qICVzFLyKJvAmsbrQQO4kEy1CIDbhx6Cq7xx00vOR2oBGLrOnHvdDRw7fZN4Wo+AqOBBJruI8ujmUIZgK+uF5HlsjoQOuvbSATUjZCZZB+YV1r9F0aDnz9cPY7Ng+3rQqo3dYbfkEb3TmOGBbpA69vY0K71/l7wvyfYWRxQDpI4Pk2cuEnYw18VRUksFjZqMIDizWGAXTa+u4ALBz9ofPdqQaqkGqMlnu5Z6w7E7a08R/PawohkyeNjQ76J2DGlghacDAJ5p40oZdxiKiWcVjPO4IpTto2/W1Ha16XHag1QJwrblYo+hOJPRBMh0qpG4UMaL9zuwDZKTymR212vH3Ff/zm1C6ZCMWSHjRZ1fl0iehI5RsmtSqsbgh8CpbdjneGUxly+4KYf1zsUP+OSqx/ubPF1STlAySWrgqOIuvxDumpi7T0I9WgyABrFYcgzAI+fRz+H+TiaoKTAL6btc6p7f0SX7f41tfryGQ5W8iVa+q525s7+s8RoeBOS7saElQrrbMqBk4+QhIhgf9sjEGaHw== 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)(396003)(346002)(39860400002)(376002)(366004)(451199015)(5660300002)(36756003)(66556008)(86362001)(4326008)(8676002)(316002)(66946007)(8936002)(41300700001)(66476007)(186003)(1076003)(2616005)(83380400001)(38100700002)(478600001)(6486002)(6512007)(6506007)(26005)(107886003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: C5T5M8AJavovpLsyurd/mD6XS6fD5Y8WnH1UKWKD2meT+7L7GdKMase3qCvBxs6MWPnTb4uZ4gFPbbsvxRE3qTAnGXobxldH/QehM1b58lVY0OB3iWmBJLZQjzU4iTiOThzlJdqkTsBH26EkD9rdzUmLkwwcn/GVMnmlzANKQNNdnjcp3JFPU8G6WxrSzopZATp123aUUKb5iijoVwxWgXY8Fly0TtmkS9cngVqhLQyHX8ACBMdV4ZnDv6iuihlqYr8AuOE2DBTDwacrvmDmLyLgD7OHA1lxEuPJfWox3TnhC9NvfHLT6XF3uDGOJrtLJ7SHzTp1n4/+Uhqg/em/Yrd8nh0C7acPjlu1bB2zm8qs8vsh8tP50CCzTIRt64IbBFpDqa/7CzQgQoio5kQbSmDOGVwn0erAd2TIilI1D4dn++4OOnjUcEc7KVWlzIq750f9XnD6TqsVvGColmttDtGOYo3Vn5qaFJN1FmGZBOErbDeounQoCZHl8Wzy1Tv+6yumk38NQxFHvg4rOE/F/ZtIrSUeREe8GS9OR6W0WXGQpp5EbkuX5ei3euZ+kUexVLMI9Ia9orUAt8ZMUmyXyabQkx8j9bVNtq51vGDzei4cuO6mNtcze3sPffyxWaV2OBQOCo+q6WQ8ZyA98+cVIP35TxGKonKY8Zpkpj2kADYUk3Fa02h5yIg97fdZlKuGFzrT9U4j6YLuaoWeNCjUIGN1T7kIuidtkCxQCPHp4QzpaWZTfRsWj0gVJl0139xnj25/mYmgnOdc6Be+Rvm2rRPpnT2jV1IZAiDkZvv+EccEIMUMJXJsjLthAp2Kb32TYlB/UsuRzNcBPZJhkGSokndDLcVTLupeDxmeaKXwydQLShL3qXuElqEqrnI96Vyr8ZbvpGPOk5ea3nWs+MtlzTpOE/BQS3HJxoKTjfNg4qAkFNDBmSDc+O06VLtrpcNASW12CM1P6VeB1ksBowILUw7wVMW3DIOY10BS/bOwhFfPG+Ycgdef740p6bjPHdXnmyuyvp/1dnsYddQOGjzIhmU0bYuXP25abLoL4gMiSiQGrr+MER68EKY5MafGDHnOnCNvXDY85mMp1N8bBY6AFhQtqZznhrOBIPAMG5ApaW4aLjHUDiakUPSbcowkuWOsMNWhjDi5O7yuyfv0sGrrVYPi395V70WRvkF2nolTwZCew5Mi+u5ZkKyY2Npkac1CimBuc4wgR9TCpFaY7eXYHlNY19d6CvsFGS7Gdl5QgcpmXmDfJ9JH6Pb/GY3qUQJTMve9C8q8GrM3Farfo3TlVvfBDbZJ617Hlogn8UNtSpfvC+xlDhsZwbHtzFeAhf+RSyIj/4iK0X1O9d6T3z9sqqd3efLyFQ7kQRve6lE8FIPd5P/lwOAHWEDROtvQ0rzhF07cJfPQbRToxZl+kFQgUSkDjiw6HgmgHFrN4p93+PvRiYGzRr/XTH3gRexMeEAhOytYSpXuNHf83eDeox0jOkkxvmetxbsh3jNtHLft6nQ7PLZgXudCh2BxNQzrd8MzJ4kWQeNMFsiqMzETxmPAEAAMbswpm8XunASKfV6OSwain7w0Mtgxahm98qMNVMXPl2TobQeKAQ68tuvT0lLOXg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 08327590-b7de-4f5a-f0d8-08daa5684821 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:54:13.2649 (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: PFJmSduifzKNg1pqIpq0sFPlBeeiZHU++DktGLg6u/Hdj3Fs/F/hiyVQWG8cGukE4YJ5YDkkhqWe09mKjqisKBkW2seNGBBvuqveMvGVRkM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4456 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: 6S0gRV_VSuiHAXB9dF9Gi6pZlWXRM9G9 X-Proofpoint-ORIG-GUID: 6S0gRV_VSuiHAXB9dF9Gi6pZlWXRM9G9 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 Mon Oct 3 17:53: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: 612139 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 B40BDC433F5 for ; Mon, 3 Oct 2022 17:58:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229819AbiJCR6h (ORCPT ); Mon, 3 Oct 2022 13:58:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230013AbiJCR5U (ORCPT ); Mon, 3 Oct 2022 13:57:20 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75CA040E29 for ; Mon, 3 Oct 2022 10:56:39 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 293GOYgY015780; Mon, 3 Oct 2022 17:54:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=4E+jWLkxDul2trY3gNhCf4CD1JooEgzlz2CsRZhp1YY=; b=AHdeaW+knmzHWrMisWx31gERADefUe6C5oDaOXX/Rmm+kT//JyTGF4prv1aD+u/QpGNf fwt6svy3WQZMiMRLYSb8LBttX25X6zq1DMujfQ10uJsKco4uUQbj11retkHUYH1stVZf L7sfiQYj/peH+YXFgYsIHR8w84QBhjjCW2SM32YfZUrYm7IcyugWPti4Hht4C6kwhPIJ 0qFNmA1e6fWV9sU3jhleOtd9Rz9/H2SzRIao/Dfiv0ROCguIZRLyVVse+kLHD2p6rTLV ZAHMekETTSpTyJ8mMK3ubmyNkTECdP1P8V5J4NhtMF3tsu2VWBsgofMAC5BX43EEUI/k 6g== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxdea4cxu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:26 +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 293HoVuE028041; Mon, 3 Oct 2022 17:54:16 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2109.outbound.protection.outlook.com [104.47.58.109]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc09gds7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aS9S5FGzMBwhfRy9t9vNTjuuJOt1ZzwmlzoFRSCwecI5JKgOX7AWmQ3PqhUbx2UlUEg5hN+rJ1kbURUK+eblg8Vf3xTVCTK8UnX31Uwj/hqtZuBs/8tR8f9+TG83gNkUkh1SZ2HketSlL0VPOJk1W976k1xz996DB0OI56wGLvSQTQX4Hf9Ln9l5XdCoI+bs4cwPm/m0fVkdZ9S+sWsfV82sTMm1i2UEml1jfBPaXyqWjFJHSplOA6upBVG9zFlXZ21tQvNpH+4sSzdfoZrwIl7L8uzLnZYCwOD2+OPrZKHlBna+RPIE3Y7fUBvc2j1n1koiXPMtH2cp+aDTfF5/OA== 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=4E+jWLkxDul2trY3gNhCf4CD1JooEgzlz2CsRZhp1YY=; b=XwGtsYLFmZDE/lqBFllts2LBh93Zn1WK6O1BmP9khtI65rePqXsDW5P5QJDVwEbsE9HhOEX75aS4mXhS03ZNhpSj5vUJ26Z6xLqb5xTUP8M2IFePIojaAb3wy381Wt1xW/+BkOtr8ag4dd0EeFxeAyh2DqSwLcpap5jwtUI2yjr+40/oiz3k0gKkC0apDsC83nVSVLyNSmVWBdnTZUZBThp2HLC7L3rAhNcRt1/xh+kaVYlUXqZTWmNthuqVVdgQ8mqEN6HakhYoPycp93GQ6jA7YYxuM4TSQV1lmJaewkCe0JSSLGFKS1HYbiUdupArkvW1e/aUFX+FyM+5lAeRQg== 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=4E+jWLkxDul2trY3gNhCf4CD1JooEgzlz2CsRZhp1YY=; b=MEr1CepPNGdEEj1iR9jMz9FIR8vcdmSn1SP+66rt7WXnF3VLcFqQvNDzm0cT4sVcVXxdmcB94T06kf9Uw0TEcHu7Z70GJwrhTSWdZLxrGrurAaTPIiqUHWYNHQcT6OlkWbQH315+XuNIbRZLz5ApmKKSjb2B/2rByojcRydrPWU= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH0PR10MB4456.namprd10.prod.outlook.com (2603:10b6:510:43::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Mon, 3 Oct 2022 17:54:14 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:54:14 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v3 34/35] scsi: sr: Have scsi-ml retry get_sectorsize errors Date: Mon, 3 Oct 2022 12:53:20 -0500 Message-Id: <20221003175321.8040-35-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0067.namprd05.prod.outlook.com (2603:10b6:610:38::44) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH0PR10MB4456:EE_ X-MS-Office365-Filtering-Correlation-Id: a25a86b9-2e64-4a46-f6cc-08daa56848ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EQeTGQ9OaFsjYOb+PCobXWLJSZWSy5TehTgFupZ5o5hRVrXoQU6baKrNRLJu6T6GRLsQ73HRfm/7SdgreR389AnoVnmngg0VGIOOYSz7971EaOFV7AhL/pWdF4XIL1hgnI/uF2qs5mPgU3J9WQScTiIonHDKw+PRwoXMiGPyR9QOAxpPQskbm6jbu193VHCUfmlGv5E/Kfvz4KE4sNaPPjipoqH8u/+IGQjy7BxXauS/aUoPEScIHuGhNNnmGQQDhPpOXUN02YXEGrp4bjqGcuFL6ewq5WUL6DfoxGVj9DxM9pz5Cx/PkyrpW/oZ/iwSPF3C6WirQW2dEQ2I4O8mOa8dQ/Fu7RNLJHOtboiF2wvq4YBgM5s+GJER9uMas4RNWKowU82wfmtO0zAcrNdYDo3ZicYpHABok85UmBC7W+o8RLScqOToeZ8md+53EzKl1CJzbpDb7Tnz29/WIXx3bJyTPsZWED3FYLHLoYny2Mx/minKzgXNXSf5fFGe1yCauXqZK6tQjabm4JQ/3sRaumF5/pbwxNLaN+Tw9nIKZrTbHuJz2boft/k1ciBPeko/PwHxJc0G6uAmMV5dZF7GzcZarFuwDmzJU8UOEhTywCQNqeSRQyWnZJRz3rC6nozaixsoP2IonteIOwwDrDB1hNJv798bTzHgfjP+Q+N7QrMSAEFw34zbfYu6/XWDrR/eGN39kJVPkwLDadQ/IXv4xQ== 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)(396003)(346002)(39860400002)(376002)(366004)(451199015)(5660300002)(36756003)(66556008)(86362001)(4326008)(8676002)(316002)(66946007)(8936002)(41300700001)(66476007)(186003)(1076003)(2616005)(83380400001)(38100700002)(478600001)(6486002)(6512007)(6506007)(26005)(6666004)(107886003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tAPWNsESd5N+Ab/VWM4SlwxmcL0CyIRyufJYNTqS3zfiXJjybIU/GZHSPjdkRlM9gQhSmwRW33ObIcEyYQTvlyNVbMC2BI/Sr3nhSv4hO3tqa44GSOYTFBS3vIHh6tkTSULmzXhCse7G1niPacIkPSS+quyxS3ydqD1GeHrbH4Hshv2LLEW053vnyk3BZqCkn8gDrbIAxNLX8NiRZfidGLO01yNV22Ul7Xcj00lo3glxcunYJtEqwJSSMjdzokrRXQwI1Lxvdl0Mop0KTSy1bli3aTibXlc+RgT0V6ITGYmKThKzw3T2bfSUiX2ObWknEMS0mVrtLTHhQwiqYptvW5ihPcHbaoH2CKkltXoV3OYvvLclwOsdw4bwDav5/TEbZ2+yvw7XgSpF1f2iCVWJEVqlAfQeZjXq+yzP8zGgHVYTVEbc6nz1pZUP70aUTWcNJQhyj1rO0q4nyQAYKtfTGVuIxYOxmR2aJJfWdCyz5xpW+WjKfiPZhKvliTWajDfXMaTrXDQ4/C7fdDTDbsl/PMfcahLTipdUfe6pbBj3JfF0pFXtq+oZrKaEWBiOy1qiZP+u2QwtadU6agjmj/CXxOY9atzFy2V33aA5WdsNLfDX3FxGOiX1Uq4rV25y4whaS7w5JAsdA3mEYu5902TZB7Hrk4uP3gwpepuA3zOGY6X2CxT/jxDah71n+lodzID6uycEpCbxNxJkMM2P64dpYZYY7yspw9FtwOxuandWPna3h7OhwzPGGnCXKzYslnJ+WdEuCzpcNELVk3BT86ARf0OzLbXpf0GOhFj5QIeSJnopHxMropJFrX/gMHFNYmwWMxCZR+ki0jvV1C/8irWor/gls8SHbpygPh6/NJYEnFPhiwgeOWJmEGLK8ewBYG8WC3dA4y07YqMIpNSVOupFRwR6Ot4ZBAHjZkq+3gkJd3DLZ//zpm6Fl74harw2zCJYbGPulcRR6bPpP0KzbmzOV8m6QQu2MDfdT3K/tkBKwN4JBtrOE7k5WpnC8CWoYVUd9qM0BETXT6sWn4v8/U5Iq/R5CHdwkdMOl3XJSb4pC9taCMCwI8//88qHKmAN9GvQYgM2nXwYLPRF/LGTt3x+1yZ9lDFgLmOxnkb5bj6gIdSWChu6NstFLdpWBtHcl7+H2qYsl/cImO4XOjgjFl2SMA779+miYh3PliDJYuB2LNR4EDusZobRNhb3jeVpp65WCsLd2PSI1PHzKH4iwTGdHKJMqJSrDVPrwZvLtNGFRSu6tyRVVuT4sdZUVNMOH3NhvlfESnNpNmGsJ9fJXpp0FW0cbIAPjBBY+HVDnYua7Tu0L9R/2GAoN44KG/jJ4OvrGyDyxsZYpyEoPmht1lTQ4ZsHoQA/PjmXw1jzCeX754DjYQjwMa0GW891nlzNlX/lpiro68wHbrH6TZO11zA2dbMG6C6mFXeDr7UFgFhxq0ztIoA4+STqoiZFM0nH7ITq/5ux+VlYep3F5DcJVYWWC4vsOff/AEiqt0i96uFarP59kW9eevzpjLUmSyY7UPAWOz2Pwy3d4v4fc2pGOfjSFHvA0DBtAX21mZ2/nR3C1MtHh3ztRp8+xs6vqh+FAQIQpsBQpCDcir2ir669nOdN/g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a25a86b9-2e64-4a46-f6cc-08daa56848ee X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:54:14.6086 (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: 0+QrLmS6Rpnk5BSOy4PuQHkrhYf0AWnbwbkSGLfmkMCnu4VUSma/jEaBZcSjQZEurUF/TTfUzTObwPL1jowIGCbMY/yPApQ4Afev09rUfs0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4456 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: bVW5vPcnec6yYK5PUGvJenZnDIjLwIuo X-Proofpoint-ORIG-GUID: bVW5vPcnec6yYK5PUGvJenZnDIjLwIuo 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, 21 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index e3171f040fe1..8e21ad83e938 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -727,30 +727,31 @@ static void get_sectorsize(struct scsi_cd *cd) { unsigned char cmd[10]; unsigned char buffer[8]; - int the_result, retries = 3; + int the_result; int sector_size; struct request_queue *queue; + struct scsi_failure failures[] = { + { + .result = SCMD_FAILURE_ANY, + .allowed = 3, + }, + {}, + }; - do { - cmd[0] = READ_CAPACITY; - memset((void *) &cmd[1], 0, 9); - memset(buffer, 0, sizeof(buffer)); - - /* Do the command and wait.. */ - the_result = scsi_exec_req(((struct scsi_exec_args) { - .sdev = cd->device, - .cmd = cmd, - .data_dir = DMA_FROM_DEVICE, - .buf = buffer, - .buf_len = sizeof(buffer), - .timeout = SR_TIMEOUT, - .retries = MAX_RETRIES })); - - retries--; - - } while (the_result && retries); - + cmd[0] = READ_CAPACITY; + memset((void *) &cmd[1], 0, 9); + memset(buffer, 0, sizeof(buffer)); + /* Do the command and wait.. */ + the_result = scsi_exec_req(((struct scsi_exec_args) { + .sdev = cd->device, + .cmd = cmd, + .data_dir = DMA_FROM_DEVICE, + .buf = buffer, + .buf_len = sizeof(buffer), + .timeout = SR_TIMEOUT, + .retries = MAX_RETRIES, + .failures = failures })); if (the_result) { cd->capacity = 0x1fffff; sector_size = 2048; /* A guess, just in case */ From patchwork Mon Oct 3 17:53: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: 612500 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 E55E3C433FE for ; Mon, 3 Oct 2022 17:59:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229797AbiJCR7I (ORCPT ); Mon, 3 Oct 2022 13:59:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229950AbiJCR56 (ORCPT ); Mon, 3 Oct 2022 13:57:58 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74CEA1F9F4 for ; Mon, 3 Oct 2022 10:57: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 293GOJni006375; Mon, 3 Oct 2022 17:55:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=5AI+pzfkeFlpLrmQ46clNzkXWsL/x0YYvdRawOO34PE=; b=ScGrEwRnEhysYVeH8OHYiL/s1R6VRz776H6pl5EVmHvO8yKOqRarX0evU5YJj8C0NrPH HLKeLshcqlRzIxNn/neqzU8opkbWjyeldth8qGdt9/nKuCM7D9U20jMABT5oC8jfxZg4 2SjNtOd+V8NqcFcYuU/SqLukFz/bXgHF664FgSbqvdSZlkX6VbW/BZw+X63ml0IVBm4b uwk3+rRF+BCgrox6NIwNQs8yXmyCLw0LeF4JUryFskMQRHmOkRvIVhaSPLog1OKgcsXr /czH4c5v2+rJgyz7kktL7gjkPs9vKj80hhjgkslEd0YintwFyODJbilPGYd5fYsAvTwx Gw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jxbyn48wa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:55:00 +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 293Hp55Q014859; Mon, 3 Oct 2022 17:54:59 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2103.outbound.protection.outlook.com [104.47.70.103]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jxc03ysrs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 03 Oct 2022 17:54:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JMEZqCMO7QjuEcrjqBoEz0qAYZJtB34Zy1J7pkw8XqaRARuGgmDXy/mTa5HNDL6qJeworeb5U9XsMwl6CwyQWYZ7Aksj4Ah5YoqdCqaMfqtlz8NR6HlBH0kAoGVCnmJ64OaKbXcQydY0CzrKh33h6dBB8ZWfXe/t4UsH+Q47nXY1aQDIkaLWN8tvM/hVOnI7trDrIMAg78ZicCv9aUn2mBh39tzLxYI4V391CRw5RyoMSQMgp3dhA9lvSe1EAH5r9nrQGXggvDNtOK48aL9Fw57rkRS/9cuRqghetwCuSSZjvjcX27z7t98ZpQMgEtDTppDTyLVsCtwBY+3b6GPWIA== 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=KWHul7HhMP/GsCHbJn1kJR0W66E5Hb/RGevT4mcLidIpKgQ5s9wKuBSNogQUlbQQCEtCr8KA32PCCP1SxMEXJiSWJQxONmaElxcJNAN3yHqTJLuMsuoaj4bFsWFzqE3YH8Vn4qDqVqXmM1xbIJoGsZeivm/LSJbegr07Oi3sFgDWHui4mP4AxY0GuZEBfGlq61VCmDikEeVqWRhAqmjQnD2rHvQir9wC+MTVyamai4kTNOKHuKVLLg3ZKCdb+0moAoCCYaoX/5nHcKqCs8OAhtj0OxKPMh5Bz6CNEDHhDBW1xefhJW9xDF7YzR9WHtRY17WaRjcP3HEyxJrFDjviXA== 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=IWPVKzEOrzsppxlP/gHlou3G5dX6vsoYEu3T6WmU1iqFc5Q2dYll+XJmrmCNMlRwNbT3H3eAVqLGjoU87RlD/1faLnca6xL0nSCuNHRm/OvaJNSRq6G4F2UIEFeKWl4yiFHH3y24Mnw9nhASdcDiweXUxnXjzdRfPRM38XohPYQ= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CY8PR10MB6683.namprd10.prod.outlook.com (2603:10b6:930:92::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Mon, 3 Oct 2022 17:54:56 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::5503:f2f0:f101:9a22%9]) with mapi id 15.20.5676.030; Mon, 3 Oct 2022 17:54:56 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v3 35/35] scsi: cxlflash: Have scsi-ml retry read_cap16 errors Date: Mon, 3 Oct 2022 12:53:21 -0500 Message-Id: <20221003175321.8040-36-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221003175321.8040-1-michael.christie@oracle.com> References: <20221003175321.8040-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR16CA0028.namprd16.prod.outlook.com (2603:10b6:610:50::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_|CY8PR10MB6683:EE_ X-MS-Office365-Filtering-Correlation-Id: d1ea01aa-07e9-4eeb-bdf6-08daa5684fb1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZFJMTJBULjh2gwrDZOmd9ryUEEnYDFKUGKsRfXMuC4s/bLyShs5De3vbGmndGA3U+ukY9CQqZ2nZKswbQL2QjnVBC6ObsUwV84Gk8woIDifDqgDBjplPbgYdxzJuNT0XS9aGBjDdDagZSS1ZhiE27RbiA4hz6FMysU+HBL66ZJNLYKhrpMRK0mKHt7GuDt4oyhAvAXJiH0p2yTi7PO6oLleUUBnA557jGRKQmXnaLs1TwTxbPeJNzRGyDBKIamLy9mvlzGPRjJe06ZxRnSw21Vab0HEMAX57iyOybOEOuzdmnebwTDwcYOnZIcdBnvNvZ/O5Y+Ik0VseDCXoLd+bbwCZ8TBttHnqFlPyag8w/JciwICygAzfr3QUairoRKqlGWl65W+1c8CP/pKGnQlFdnS1RfkJ4LEauQE3368QxpUa8ISUmiXXxU4DBtfeocrqYFDBtOjJFriRPA1JWYkuzLG816+591dHkah9P5gmUejiwqumcotuxA66OL6WUSLHXFM3+aHwi6SSajL8RxiRoehSh7tgre+8YZT11pqbMDPRAm7L222/18T4xmVxTDdblA5lXKevDGCfrnryo5RvP2uiZSjzttySw85uaCkeA69JteSuY/dBem5xM6y5aNCn+rjHcNshh6ALAqXSbq3pm6z3bdGxAaxtQxxkkb0m5nKpw44RlX1Clf+K0WyPZIQTb3kkJduYK9n9Jt+XmAW0+g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(39860400002)(376002)(346002)(396003)(366004)(451199015)(66476007)(316002)(66946007)(66556008)(86362001)(8676002)(4326008)(26005)(6486002)(6512007)(6666004)(107886003)(41300700001)(6506007)(8936002)(83380400001)(2906002)(478600001)(5660300002)(186003)(1076003)(36756003)(38100700002)(2616005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: aqXe2VIFCHy/Qfy2Qtn3er24iInpYBhRr9Q9xljY6O13EZpnMfhawCNaimOnM+jevuSds9cAtPnrcR5Wd/FcpVK8oibr3r2qb/kMRhBihqJQqWD+GkZ2VSeGocmKPx3MjFd9UfcscW4HfKrvioog558FRexxvMpRQxViQuPblDKPLI6ZG2cFaz932y/inkkIFdpfcrJn7hAPJXaV0J3RSH2Ltm6EkZnr68QqllNPtYXNz8RH6hNMw7WbHVeruAP0LnGuIfUYtPTmenjZ4oxWKLeYX7j+1PPAI81sRqqOVkIHxYzQ/h4nh7Xqju/x5ZFfw3YYQ/7kCkJtxqTVamv5+0vnwPtf1DF1oZZEcYB5Ub8Q4VAWXtXpUCYXsPzlnaKvvuCuKsuZ31dX+XdzT/3fuNVJLMp+4qIOYW4Zsu0SQOI6NJGphj18TVXOZZo+KpGqBR8sMuNU7Bh6Pv+Rf0IgWl6T96yLfCV30iOXsDVavQAx2yeB/eUoGnvy5eabsRCR8snV7QsQDksauqOVcoz3Z5ArDnQv8/PxF42/kMR0ruWbz/aBMSi6Ytnyyw4IO205EWdXJ+K15c4wh8HMV79sD+R/0hOgpTtLVOmAr7SBalK2TrkPR17WtvS+tQzE8s84vpelGTDKhk7eGQ93idCZEOB5bNkQB8ePLvGdl4fKMWvEbjVXbnZ9GqlUxz2h7I0T84NQDXzHKvhVgnVkopA7f1ViQfhBJFHIphFeynUxPiBd/vSkZrxxa7ImoORC2Oy/OO7Zb4b6T4yiLTwk44XPMlPZ/bo+xMRyLQqAUaC65j65fdfs8/uH2ZRWr5hhnGWYsX5pxo3EBe94hKtvgIbbBz0Jb7vBj+FoLIAcIx204rgpmFCbA0U29eU5EQyeoVfi3zlfwqd3T/y/BKMwE8QDhakQpQmrr/3wYB6RlmmJHeeYEeKwm5LChOcR/WJMaCnZ93G87sR40qPxjbCdgY115VJ6OwHjXChuU71HgnWDhMScUX8POZaACk74SNhrF9g2ySa7BIPLCLgpgQ7dWWcqLFrIrrwYyahx90duBKs7ohkri+ZqOfxzuuBbKPk88r8BoIDwQB5+u7HSldt2uqPR959dZi5+0KZovYy5CdAJy0lrhCaHtU3r+8iF3aS+mFT+A38m0vP8cZhBONpyp1kXPY3TXNa+pgK8eulYjrPUeVPVj/72/BD8TN5PQ4GCqrcsDPKYjMDG+1Qrge/BfndkmVq/C4PlUsH3S4ByrgS4d0Ae7uPKOJSSCvdRXicr8ozgFm7as/UTOEX9Od6SYkKmGZKZLxkRQCRX5Tv3FUPT758xYWCRJvPjX+nf4i8D51siIhwVCHyC8sxwF9vuy1N+d6wAxMfRsVynbUv55XrfTYkcqcI93nYG2iYgEJNKJWFeuYco8PP3Pxz5dZrztf5xPvVOFIxUKRzspCCnw2MIeX02zuicpcgcQLia+a7may1C8wkNXd6b24uUX8mvf/Wpgg3t0EkQft6+TP5F5cBEbsZFMggNz+DWkfqRG+30hvMLTUtuFtUp2dqzi0x/zOTB6qQzMUanSoMqjNsMaAqx54WBLmAU0f3X2rkSU5jm336IJF0J6tKGERuccz6FLplEnQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d1ea01aa-07e9-4eeb-bdf6-08daa5684fb1 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 17:54:25.9983 (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: sgASnb5pDZ/JKRwlpbfjX22RKmaYeXeGxzCodvcv1xE3ofcxrdj9oOa87/S+0IkU7u1mozzrKnQQ+qCjBbjdt0A7br5Dn4MVJqM39m9h/74= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6683 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-03_02,2022-09-29_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 bulkscore=0 malwarescore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210030108 X-Proofpoint-GUID: VKvxyubwJT1C-eeKmevxBRdRtrsNZBXq X-Proofpoint-ORIG-GUID: VKvxyubwJT1C-eeKmevxBRdRtrsNZBXq 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; }