From patchwork Fri Dec 9 06:13: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: 632851 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 31DE8C4332F for ; Fri, 9 Dec 2022 06:13:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229746AbiLIGNq (ORCPT ); Fri, 9 Dec 2022 01:13:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbiLIGNo (ORCPT ); Fri, 9 Dec 2022 01:13:44 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AB446BCB9 for ; Thu, 8 Dec 2022 22:13:42 -0800 (PST) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B8MIgYp002839; Fri, 9 Dec 2022 06:13:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=xBAewrfjTWCZWX7wI6Jw46kWOGq29W4uYHL9wYKbXJ4=; b=P5weAyqK2VzSl4RvSo3CTkGt2dqT5cNWF8kvINOcCCO37yN78fg+bpnvtRsZ8VToEiGX BKj2H4S9RF8mONe6+TaBUorid3pAIJcbC+XI6SNf4e3sp5Uo5k81uqK2QEGR0s6qB0w6 j7Gs89pJ+mNYjnWtuN2XdEovOh6o2EbrxdSNilHwNk6745Ckl5w4s95HHNOF8+tlRodF zcBfhXRVBXOiBee/80jmBfjvPOudgjX9EbE/bQF7zbpdn1sLKJs1BTNuXJ2JC4Dr1sAX lIxg8BgJ1dot7Sy9LlYtCBRMk5+yZ1UpbqEE4cTeD0k5ZcnPhdudWxFXAWU3FU2Fq6zV iQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3maudkcjds-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:33 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2B94hqNO019602; Fri, 9 Dec 2022 06:13:32 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2104.outbound.protection.outlook.com [104.47.70.104]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3maa8jwbc4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=moMAZeo6ljHCiYa4p33zzUJfPajyBzmhw2PbvdBfLzwdWp28NfPe3Jni37CsyUi6P2TrngYJxbe72eUFBHJU+WkXjRDf7JFYdzgGbwZCfqahQnwcL8yNAM1X4QGSYcu9AS4kMclMWFfOuF/Z7wTlHZmyg1itnUVuftMgBUZr1+gjv9paoZfRVXT/hfBJaUREtZ60lN8WonXWYSXxoyX//74ROLdLP2dgL6rl2jsB52PiDwWs9yCdIJNGVWu2u+tnTY42tW7+F17NGn37QBczIMIG1okN/tqGa91S8tQfLCVjhRsVIOIR1I2z1N4ckqVIWDyb3wSW7FqRo1wXldKMow== 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=xBAewrfjTWCZWX7wI6Jw46kWOGq29W4uYHL9wYKbXJ4=; b=iBd3r6lmr8xvQgJh77mnDl3dP3E/jseJ2zho8zXNxWjxgr0fRdqw1T659a3bDIQYb1/WXQ0JJeWs3ddr1WPqGwkAtvi2tHhGmlv92RPE/t6VOlpv2PXxdjPWXGRglnHIk8XnWEPXIWpPr6ZEZ+jpc5Xeiv615Eqt2pbMj2lRaN+RUejSBTErvPYnjgQyMACBEkODl62zGjpkFU7JacgHH8KWJ3nYhJtfS4rFtDxbhpJkbvDVAJaZigpSlMHefiMEu/D+Tzphn7lnIIY/GugWRG09eYxAkPU4YdNGKiBKPaVgDA/bImxSkzNXwILLrea43s4zvfZ4SSjLt4JdfhiQAQ== 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=xBAewrfjTWCZWX7wI6Jw46kWOGq29W4uYHL9wYKbXJ4=; b=Zer4EQpUEyTzDHxfKCYdd+dHr3P7sIJ8QyrYNA7CSD0OgJrBoquGhl2f8NeNvjCNFb+VNOJFRUGeyo2rxr8Btjbz0RGIE/lvjkBFPqx9fpLvjPNCraBbWiCqBnkTTVJBSzGwKu8awPRsMyAVgCANbC1ZhP1lGAUi2/Si5hEMPH4= Received: from CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) by CH0PR10MB5066.namprd10.prod.outlook.com (2603:10b6:610:c4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.18; Fri, 9 Dec 2022 06:13:30 +0000 Received: from CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99]) by CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99%6]) with mapi id 15.20.5880.016; Fri, 9 Dec 2022 06:13:30 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 01/15] scsi: Add struct for args to execution functions Date: Fri, 9 Dec 2022 00:13:11 -0600 Message-Id: <20221209061325.705999-2-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209061325.705999-1-michael.christie@oracle.com> References: <20221209061325.705999-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR04CA0021.namprd04.prod.outlook.com (2603:10b6:610:52::31) To CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR10MB1463:EE_|CH0PR10MB5066:EE_ X-MS-Office365-Filtering-Correlation-Id: 550fbfed-c22f-4ac5-7742-08dad9ac7e28 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t+mHK76uc1CRxEQfrYM+vrcSSSZGs3b1j0+6EqbT6vCx8VYpkIeFW14sZdBKQY2+Sge/bqTeXJ3EsxKT+7f3ASj+8umnp3eBF0RgERICWoFaiS1zgzBsmjM2hrgvBb/p/oOLujq2MrPxCFvLZNGO4oArGP8mj9FmlakZWkpjF/LMYFqYpAm6C7+eGfHshzvAt+tgr0m/b9onD8mDXjy0d3sFqHiRGG9paIyNdxH5J4piY25Znka4UsCAGmR2SgQM5uY5ZEj5HrjEndDfna0K3x/4jEckX7tyQupoRbgXwVY60DszgNZrHk2g/UihYFZVzA9DxEozH9umVshP1gioghzOKZE8UtNpzRKkWhP3ztoWe+QpjE/Tts2VNz/2SMVdVSE3v60y5p/CdvJ02KV64dWxevjkuFpJqL071Zi8+xKZL2RF8x9TnImPHByHexj8mBTt3GEt2eR6e/BSc2A310gcmAAg1jcw4BWhcWuuBsoTRKUA5eiKXekA4LoIXlLcxB9l2/AlVFkTBgvzb1BpgO7iHdXZebT3ELF4ZnGEfkfMr4yBiouaZ6X2yQnka8mFvCj/UN4+61IBu0GL+TVXN+6GSSnIFG3oo8lUP9iKu1byPT0TwCQWm0u+F1plATPKz8ad+zuFyJ1pfs91G6ujpA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR10MB1463.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(396003)(39860400002)(136003)(366004)(346002)(451199015)(478600001)(6512007)(26005)(2906002)(36756003)(6506007)(6666004)(107886003)(41300700001)(86362001)(8676002)(66556008)(66946007)(66476007)(4326008)(316002)(5660300002)(38100700002)(8936002)(6486002)(2616005)(83380400001)(1076003)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zUMkpzv1ChdmVDcdiPYRyj2zyuKkccZnBFxph3rV3RvjXnZgdbh3J6dNymlvuLt0qYu9pYC1QuMxarKFcplWAhbXUNKuzn5rKRsVbrShHhYIjRtYUHIowXzGpkzbwFpIhk+0dvftegdrN+ui+AbPtqJIVi0s7CyO0wBQWaGpjv/P3WHm6AA/9dkyEWtVeraVNbbJSgwDwYAjCm9x2icaKgY6ngpsj4w/D50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+x4DnxWbXurirj4vSjGP+JCgPYjzPX9xsN27LV/b5dUBjG6+XvVRpTSS359NmKAftH47UJiTEKwmvGB6q7Mw8lXR7gTm3orxVcthpFogXAaBg2e+CqCK+k+tdqAlDg3Bn/ajlY3S44H+x75XsqkRybKIWZQYKMhN74wt6e7kN60P8HNE97rBbIlYw5qmkvfu9lRpXDfdyFhMPgCwqQO7pkbJ4epn4buetGZHqiMDrCI2RoYCpHM1lD/bUfYe/HTjzgknERZUCrsK7jZvn+0raKXsWjvtnSEkud8gVBCJD4niXRXUtA5w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 550fbfed-c22f-4ac5-7742-08dad9ac7e28 X-MS-Exchange-CrossTenant-AuthSource: CY4PR10MB1463.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2022 06:13:30.2248 (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: tgRcKX7A/FJFZ1qBuO/wcWD6GMd0lcDZwR5LUeHJl60Mt7OYpRgoK81EYQJQU7QMbpq8XnXZd3qPDLgswPLw5zXtpOP022xdNFJ9GgWcjS8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5066 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-09_02,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 suspectscore=0 phishscore=0 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090053 X-Proofpoint-GUID: hAEriS362Lpp7PNL98CMOFIVIIRbXPXT X-Proofpoint-ORIG-GUID: hAEriS362Lpp7PNL98CMOFIVIIRbXPXT 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 optional args. This patch adds the new struct, temporarily converts scsi_execute and scsi_execute_req and add two helpers: 1. scsi_execute_args which takes the scsi_exec_args struct. 2. scsi_execute_cmd does not support the scsi_exec_args struct. The next patches will convert scsi_execute and scsi_execute_req users to the new helpers then remove scsi_execute and scsi_execute_req. Signed-off-by: Mike Christie --- drivers/scsi/scsi_lib.c | 40 ++++++++-------------- include/scsi/scsi_device.h | 70 ++++++++++++++++++++++++++++++-------- 2 files changed, 71 insertions(+), 39 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index a29d87e57430..f76acb468abb 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -185,39 +185,29 @@ 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 + * @sdev: scsi_device * @cmd: scsi command - * @data_direction: data direction + * @opf: block layer request cmd_flags * @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 + * @args: Optional args. See struct definition for field descriptions * * 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) + blk_opf_t opf, void *buffer, unsigned int bufflen, + int timeout, int retries, 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(sdev->request_queue, opf, args.req_flags); if (IS_ERR(req)) return PTR_ERR(req); @@ -232,8 +222,7 @@ int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, memcpy(scmd->cmnd, cmd, scmd->cmd_len); scmd->allowed = retries; req->timeout = timeout; - req->cmd_flags |= flags; - req->rq_flags |= rq_flags | RQF_QUIET; + req->rq_flags |= RQF_QUIET; /* * head injection *required* here otherwise quiesce won't work @@ -249,13 +238,14 @@ int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, 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) - scsi_normalize_sense(scmd->sense_buffer, scmd->sense_len, - sshdr); + 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, args.sshdr); + ret = scmd->result; out: blk_mq_free_request(req); diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 3642b8e3928b..eb960aa73b3b 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -455,28 +455,70 @@ 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); + +/* Optional arguments to __scsi_execute */ +struct scsi_exec_args { + unsigned char *sense; /* sense buffer */ + unsigned int sense_len; /* sense buffer len */ + struct scsi_sense_hdr *sshdr; /* decoded sense header */ + blk_mq_req_flags_t req_flags; /* BLK_MQ_REQ flags */ + int *resid; /* residual length */ +}; + +int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, + blk_opf_t opf, void *buffer, unsigned int bufflen, + int timeout, int retries, const struct scsi_exec_args args); + +#define scsi_execute_args(sdev, cmd, opf, buffer, bufflen, timeout, \ + retries, args) \ +({ \ + BUILD_BUG_ON(args.sense && \ + args.sense_len != SCSI_SENSE_BUFFERSIZE); \ + __scsi_execute(sdev, cmd, opf, buffer, bufflen, timeout, \ + retries, args); \ +}) + +#define scsi_execute_cmd(sdev, cmd, opf, buffer, bufflen, timeout, \ + retries) \ +({ \ + struct scsi_exec_args exec_args = {}; \ + \ + __scsi_execute(sdev, cmd, opf, buffer, bufflen, timeout, \ + retries, exec_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_execute(_sdev, _cmd, (_data_dir == DMA_TO_DEVICE ? \ + REQ_OP_DRV_OUT : REQ_OP_DRV_IN) | _flags, \ + _buffer, _bufflen, _timeout, _retries, \ + (struct scsi_exec_args) { \ + .sense = _sense, \ + .sshdr = _sshdr, \ + .req_flags = _rq_flags & RQF_PM ? \ + BLK_MQ_REQ_PM : 0, \ + .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_execute(sdev, cmd, + data_direction == DMA_TO_DEVICE ? + REQ_OP_DRV_OUT : REQ_OP_DRV_IN, buffer, + bufflen, timeout, retries, + (struct scsi_exec_args) { + .sshdr = sshdr, + .resid = resid, + }); } extern void sdev_disable_disk_events(struct scsi_device *sdev); extern void sdev_enable_disk_events(struct scsi_device *sdev); From patchwork Fri Dec 9 06:13: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: 633179 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 ADAA0C4332F for ; Fri, 9 Dec 2022 06:13:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229809AbiLIGNz (ORCPT ); Fri, 9 Dec 2022 01:13:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbiLIGNr (ORCPT ); Fri, 9 Dec 2022 01:13:47 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 519376BCB8 for ; Thu, 8 Dec 2022 22:13:46 -0800 (PST) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B8MIpO5028640; Fri, 9 Dec 2022 06:13:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=3RyRPyJWwaaQxj0yP/6Tl0/KBaDQD3jR7BjjcB86QAA=; b=ot2m2HLcQ7QwziuC5BsbrXPENpVFF92jq7K3bWHll6LCLavN9vmwQVWpNXcKYgZi8yQf v/SJaEZqrrcDyPVsTZkwSKsBcqcThW1Y2IyxcjHHulQ/HColqWGEIk34mQNaw2Ljk59s EW/kmdXdwOgLqg9YCjH1pw2OAejLEh83DOcxgBBHQpNeEJuCMPDUE4FTn4K7wFIX3C7G gC2KbdUeFZwmUB1g9IEMH7H94XDmlBORcDEGqgWGbuEUtQw2mUvxdA7Ju75Q//C54/3k 5mI+AQpxkEBEWz8L2+pBxz1Fg6GXVaKXemZVD7XtJ+TNXxMwwpbuA3g5Yt0AAGa5ZyR1 AA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mauduvcpc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:34 +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 2B9589Tj034548; Fri, 9 Dec 2022 06:13:34 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2102.outbound.protection.outlook.com [104.47.70.102]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3maa4t7sku-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cZDWubmWtXJ8VDnx4wtml1iMkHRwdUtNOdauyBj42+wDO3siVIesu3FPJeWVsN0ldIruHCRELLg1n0KgiadAXtgWRagQERCIQPQt2Jvrur2/N2pTxztDqO8hmpd684+OtPPNr+BrwfAzCZErPaDh5Fa55EG689HY2njeqjBfbmtAKzk/3oNEBgob4q1aAPCfz0Cw39EO+6o/HKKRUVxZC4YyxwB7S99UfkCa2oBLi5OmXiXivw2vJygtdpy9z7GheM5Pf6sF7TQ4vy7qk3Zd3lcYyweuooJPKGT/TKnm2pjt6f/HYRdgCtXGVeK1P3Y3oiVhnJthtkjLWW8U+gIeRg== 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=3RyRPyJWwaaQxj0yP/6Tl0/KBaDQD3jR7BjjcB86QAA=; b=gWW/nPPBqys10NjvD6PKWW/NGr7q3+YzAOn6fTnBqzV/RmVnVGfwgdaC/4EpJ2aEo9gd/EZLT+L8jfbmIBVeMQY1sjokCuts68xDxtLI3vrdoMFJMkIbHdBJTiT9veHn7gwViW722CX1txzAdd5b6u+IOJQLZ6TfSoQRVdDOKF1B2xB1bcPNJkbuz83PN1HlyVKOOTvxZY1itEmuemRu3HCMEtRkSxTAWFZPtSvi4FvaRENq5FWdvu9/Wvsa8BM8F9GY9ltIwUJaojYpsb94RbXRhexWDa2AITd24TzbP3b0wJjIq0yPA2uYSN4KkzBSQx9d/ky/mJcfXAGOSr/7bA== 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=3RyRPyJWwaaQxj0yP/6Tl0/KBaDQD3jR7BjjcB86QAA=; b=sezMWZ12syh0J5MbxVWrQdbC+6TUzjA9Wdbn/TBvJxJHYor95j21ckGQYdssy8nebSNphA+8OuL1qaR/4VZhjaW00Qq2ZIfDMUyFtaFiKIPLIPzVIa1B04Zl122I/vW4bx3yZXuBw6lzJiqLLGlpDplCukWIVPFtc7yqK47P++Q= Received: from CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) by CH0PR10MB5066.namprd10.prod.outlook.com (2603:10b6:610:c4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.18; Fri, 9 Dec 2022 06:13:32 +0000 Received: from CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99]) by CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99%6]) with mapi id 15.20.5880.016; Fri, 9 Dec 2022 06:13:32 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 02/15] scsi: libata: Convert to scsi_execute_args Date: Fri, 9 Dec 2022 00:13:12 -0600 Message-Id: <20221209061325.705999-3-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209061325.705999-1-michael.christie@oracle.com> References: <20221209061325.705999-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR04CA0022.namprd04.prod.outlook.com (2603:10b6:610:52::32) To CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR10MB1463:EE_|CH0PR10MB5066:EE_ X-MS-Office365-Filtering-Correlation-Id: 0c650ebe-e677-4310-4e16-08dad9ac7f6a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FPY8NqqGH8/Qsqe+2mPUUTc/4SMN46DI4sQuZYHVCfoJUXmgzq5prj43So0JmQfWTd/F0uVxrMYkF55/qBVZUfGm+pf6bBWRbu2Y79hVvljHcdkvfGJxZpFoGiQWtfp9al3gWc+06a/vO+1yaDBsCDD0jgkITxoPO9wDXKL/2JJ8SDvkpP1YewEf4iY8iWmDCFQvSHymLILpRz4BaDUbsbzTEfZUIf5lp1YHW19nCrJYDGfVtQdw8DAkrRHz2bc52ytg5YZXgIQdBeIGBBTyBi+aqOylP+gijHlV1inEXvuT4E6MELJYPzA3wf28FAlYRvPlI2/D1D7G3FA4BUhZAABRFoZLgzAFhiUcmAHV87e9e5aSOYxD9NY3xXKmn1E7gdepaOlbwL0PPx9bjQBXIbQuO7qj/40VL4nz9gg591mVnbaFo6St+qAut9Lbkdjrffqu+fNS3l1Uypa9q3xJwLOulSaSrDLvmpVnGWBECBAFTkCAKoFGPoUqAoDn+QIgL3sGiQz6C7pbVfNa2FwZs273xaaGdmm63H9mtHV6CtDPSIAufPSL2aq1tinMVyZPAo4zDOM2i0xECO9V/xpnfULAv0qGby3jX49V4i2ERpM9YFAdF5IFDX16NNs+1uwNKipLauTNeC6GbAlHE202NA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR10MB1463.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(396003)(39860400002)(136003)(366004)(346002)(451199015)(478600001)(6512007)(26005)(2906002)(36756003)(6506007)(6666004)(107886003)(41300700001)(86362001)(8676002)(66556008)(66946007)(66476007)(4326008)(316002)(5660300002)(38100700002)(8936002)(6486002)(2616005)(83380400001)(1076003)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HhkNegEX/gs4WMIhYYAU8vtTW59jQ3SzLckpNJP/P3TIT5S5kLL0+UiCjTYGUpif6d4tIOmW38g8R47cq+B43Vq6FNOBjt3yVLQxDtV6tUoGMXlo5teFbE+vHZ67Dk9L45sx5M/EWzT2Mtlqe7KY66CtLCfpiR/Doz14W10kxZz+PZvEFMcG7e7jPfcjnXGR7xdPkys2pT4fr4HBbAQ3FXM//VSUaRx67lo3xR6+9V1kn5NtUNaEt5cLoSOhKez72EWH4gq90ONISC9PnbOMYcl+ndbVW4JL1RRd7LLkc1xe9AIymTUzjgaFMft8nAMgSCLXqIM39H+TnVI4WgMkkZD5GAEtQxKQ9adfsiaPGRSF7AQWHpRNJs8bGo31DlCu7hLh+5RbfaKT0cyUIRCqMekOV/TscAywGbPJBlyweoll4lYzzcvTvt/e8giur8YLfQNmilyLc0Y/82oXoBL27SfZh0QgE0xkccdmfqsPPiv8TbEhX+sum7uA/cLqObXH6+2aRITsFLAtaBD71RLJ8g/dOU6HR/VJlkiVOQSJUnS9UBsnLXFNscs7IWYXi0myvoeC1717edUCbbGgedVKhAOro328izICpQRGjJokwe5GfaZ060IX3qB2Ac6Ohu959U6OTYfl0Hkvsl04u5nFQfj2/l0IIq0cdC8RWdX8ZmRz5ZftruhBt2NXRauKdmEqK6Wb84x1pMElADLPG98WxlkSxgVvC1PojdV4k4eArjqA9rp2yQCJIvhQodcS+0NJIXGzi2hKfTfw4BnW33M4n9b2eCeedocTQVRoicTLnSHlOain4uExWdwnIC7aJeg4vE0MibmT68uWqPLwiuCOhwffhisWoOrUCssaQo+y1UV0Pr1Pw+2zxN0/jUJJ9OesxCny3+zT1zVsZ5y2vSUtVzqCNymVl8Knu22A/iieifqGXVOXcTNfffjOa71oyt00muHgt7mqKfTG/fc4DBJH3Xs31yVS0KwHhWwd7atV2Ug3ySIAvl/HlkTb7s3sD08VZzhFO49EO1wh2dQO8YPe7ZUoitt/g5hO68F4zyZBL5izvGyNJhZg8mO4Hb+Vi7rYOEAzEVm5QUhowNLlCWvimMoE9hqCMqoiDCY2yEITZsQW+/QGNotoN1Ie31lLBV9m8IIluGhIQuetGyHVld5cM70sPblHNxpkg2WK2ploDMSR4gTDN37+vnWZAryks9NKatdG3BAWt3Br42gaxXplEyzl6IF/iuI+/hHGGxpB9vqt5ssb7uK+bMDB/FoRknL3oO1UBsFV1MBn6hO3iVogTHhUSf33JzyQvPdDVRYI1SEiRHfUNEU1aYQ3ix5FPbosOWf9k5zVrI1qrgOkeh9CdKTxlEte3qfcvHx/As12+o3P03CFyKInBLXmG+MRlw/QSKHWYMIGf9P0JmLonLftOpQgpdjFUXehgQsGEKu5mcjIYwPkuubfpAlTb9uGmYk8Dd6T9dnTmRXkNCVdZBvibRFs5XNDJiZlU/ALoYqeYretNa8yp1D9G3RjDXbgKBNnzbypRRNJHGz/5R6pfqDbd9EX9g5HtknHZsjpuK7pKej1qzidVoT1KSg/kN1n0vdkv/LRR0+rahtwpFLgf7MVTA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c650ebe-e677-4310-4e16-08dad9ac7f6a X-MS-Exchange-CrossTenant-AuthSource: CY4PR10MB1463.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2022 06:13:32.3184 (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: nvBtJPOFwdSZyKK8fIhGv3426FeRB65SFDSaDvxSfxrdxxg7CfnYyrxZM4xWVyrXxSlIt9OR+BDhZuO2TWnGDU5s5qrQVqTF5t7BoGzdAqQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5066 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-09_02,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 mlxscore=0 spamscore=0 adultscore=0 bulkscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090053 X-Proofpoint-ORIG-GUID: qSGJeXJDxKLuDlsyBRMLJSmPaAgnTqSu X-Proofpoint-GUID: qSGJeXJDxKLuDlsyBRMLJSmPaAgnTqSu Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute_req is going to be removed. Convert libata to scsi_execute_args. Signed-off-by: Mike Christie Acked-by: Damien Le Moal --- drivers/ata/libata-scsi.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 06a3d95ed8f9..1dbd02118803 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -367,8 +367,12 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg) u8 scsi_cmd[MAX_COMMAND_SIZE]; u8 args[4], *argbuf = NULL; int argsize = 0; - enum dma_data_direction data_dir; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + .sense = sensebuf, + .sense_len = sizeof(sensebuf), + }; int cmd_result; if (arg == NULL) @@ -391,11 +395,9 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg) scsi_cmd[1] = (4 << 1); /* PIO Data-in */ scsi_cmd[2] = 0x0e; /* no off.line or cc, read from dev, block count in sector count field */ - data_dir = DMA_FROM_DEVICE; } else { scsi_cmd[1] = (3 << 1); /* Non-data */ scsi_cmd[2] = 0x20; /* cc but no off.line or data xfer */ - data_dir = DMA_NONE; } scsi_cmd[0] = ATA_16; @@ -413,9 +415,8 @@ 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_execute_args(scsidev, scsi_cmd, REQ_OP_DRV_IN, argbuf, + argsize, 10 * HZ, 5, exec_args); if (cmd_result < 0) { rc = cmd_result; goto error; @@ -475,6 +476,11 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) u8 args[7]; struct scsi_sense_hdr sshdr; int cmd_result; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + .sense = sensebuf, + .sense_len = sizeof(sensebuf), + }; if (arg == NULL) return -EINVAL; @@ -497,9 +503,8 @@ 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_execute_args(scsidev, scsi_cmd, REQ_OP_DRV_IN, NULL, + 0, 10 * HZ, 5, exec_args); if (cmd_result < 0) { rc = cmd_result; goto error; From patchwork Fri Dec 9 06:13: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: 632850 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 F1A36C10F1B for ; Fri, 9 Dec 2022 06:13:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229796AbiLIGNt (ORCPT ); Fri, 9 Dec 2022 01:13:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229769AbiLIGNq (ORCPT ); Fri, 9 Dec 2022 01:13:46 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25B0E6BCB8 for ; Thu, 8 Dec 2022 22:13:46 -0800 (PST) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B8MIgsn002832; Fri, 9 Dec 2022 06:13:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=npyGHWv/OFlafYI6bTJF/osyKXDm62/Qkk2tOz5qabc=; b=YMsMEXXb0TIkHESA79ygIezKCZAE/dNgyG/DNtPOGij0yNLBYKXA8s/+3F2GBK/RRrT+ GCp2pyMlzkDjyDFw+Sgiw6/Nz1SagGlOeOgBQRd9kF7jkfbH0XS9AuSfBLU88cxpHzUS yZb2QnOWh8ZE/4RoU6zml9q65JSdkapfPGiQnF4WaD3z1eYly6+63CfHFg/nbD5sHmby re9Df51VjmlEAIRrQT0DAo9wToD6Xh6zIpsGP0K1CuzxN9o7zY/gma/zKZv59JUTT/ET WB06c8T9owrKCSN70nPaa4FM84x+5mPYkFGXfQSmrBSShJ/Z1dos0TjJI3FJ3j+KBcS4 2w== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3maudkcjdu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:36 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2B94vaG6019666; Fri, 9 Dec 2022 06:13:36 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2102.outbound.protection.outlook.com [104.47.70.102]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3maa8jwbds-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fvmF42uPnM/FgHqLZRWYm0+fpTqB/TIkt2Hv9wFCpNk5kBlBqQVPrwdfXPG6cVz5G0cUYqhn2drb3baJXF59to91OvcKcF5Tuk56uMWuCKrauB7fnFenW/NxD/r3Q4GfF5YbkZ406ox7LYA5Ae5oBdsTvEc7vjVHFttZBlpOqf5eYAysDeIpLfo+GvF0Pg3QPBWq8zmUNBcNP+qH4tZDsxGiV2mJ6uuyvV6xlQ8rTcE2a8cpfZpwWTTZWimw6eGFsw72/xg0lB7RSXmEmI2gcvxx/GUlNLf7ZX4h4WGI7WuRbqfaSqBF+XpCaaMBay6y6WbdgVQqcZhC5IeWQd7lBQ== 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=npyGHWv/OFlafYI6bTJF/osyKXDm62/Qkk2tOz5qabc=; b=D0x/P5oYqGdiI7X5d0TswmO0hH4mEUVXWsTWc3uozw8+m3iR1JUDIILCwUacvaj+k4m64aYP8/RJZBfyRMIJFAoZS3MEaPHjBkp7DY9C5wOS7AAigo6GKu3AvGGqt4p7gJ7SLHfQnheiqpotVWkamHg7sx7EzI0U7QZOI9NLBc7ptIW8cyQZSjmc2ZwrC4DXY3MLht14K2FyZ0WkUvMUr5edTc+1hfQUbErJfGthvmqb4g+u7IJvvIAqYSUvCUw8o7dQnFkPrfK2cgIXq/ciXNv+ZxPisOIl50l4DnmgqIciQIKmLTfPpIXKY83eATXnhXOwMXxJ7VKqu4vF8kWfSA== 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=npyGHWv/OFlafYI6bTJF/osyKXDm62/Qkk2tOz5qabc=; b=ITjXVCIAiDym/05lvXyhzYoskKtlcGJkPkB4jj195iXfH9Xi9qMYmR4FTl/DjFTxC6/qBP4/7NG/gK0voRO8nYBeKQBw/Uh6vDX2yq6rDfJZR7Cum7/2nie6q1nemqFbFETX8d2GGLyXExv73Tf/i7LUNcIopmtNAqjFhzROcyI= Received: from CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) by CH0PR10MB5066.namprd10.prod.outlook.com (2603:10b6:610:c4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.18; Fri, 9 Dec 2022 06:13:34 +0000 Received: from CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99]) by CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99%6]) with mapi id 15.20.5880.016; Fri, 9 Dec 2022 06:13:34 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 03/15] hwmon: drivetemp: Convert to scsi_execute_cmd Date: Fri, 9 Dec 2022 00:13:13 -0600 Message-Id: <20221209061325.705999-4-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209061325.705999-1-michael.christie@oracle.com> References: <20221209061325.705999-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR17CA0030.namprd17.prod.outlook.com (2603:10b6:610:53::40) To CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR10MB1463:EE_|CH0PR10MB5066:EE_ X-MS-Office365-Filtering-Correlation-Id: 49b110b2-b58e-4a6c-147a-08dad9ac807a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CwvE81r5gWTr1qJSzMtyfnt1PmkQh8f4fSpWeGPlWm6xM+PJKJ7ziAvoxC7HQ7nOIGkU8HgiQEiQr2+GcRohpDJibgxNG9+SU7B5scJgY4lQ0/mZB5UEnRPcY5tvVE3YBh+1eWGas2ugo7Oa3l4ipiYArwuJeESi7toJacQPqmIibHpS437UnKbVp2sHgxC59Oe20FTASwTMACnCP9hfcKMceNNSglLJJAWptGNru0IS7I6870n923d4zFzvdn+2YxqLXVRrYDwbOknKxF/pAsxqVYlUvxUVm/dU/w7LFBF3ZaarW2xVtJRKrbgkyO6S4+aT/hJt34+C6QeC8GTL/7klRek5raUJbjuPfwFlXu3PcsOzzuY8Y85I30vUJZ07nQ+/+MImhQAzczoXFFnWYNpRok1r5X34kT3XtLOKoA9wSOPxpfGrHwCko0QMdaAMq2W0jDVg5tlO93Zo2JObBAA8XuKFiv0R3/yzPifSIh9KEOJCGNOHiBDHp7uPeSDbxFfbTZ+LuT/cHNQDi9oqSRvzHHXtKCdf/2ddqAQIDXt8jsNhWnzi9qk/9ZoG2UveQZqkhCuROeI0SlTyDHp5YxfIbsUjtqN3RyVr/fcZTYprrE4wbzuo1NaqzBtd/qQdJeHL5xzdS/XLkbIypZ3odg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR10MB1463.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(396003)(39860400002)(136003)(366004)(346002)(451199015)(478600001)(6512007)(26005)(2906002)(36756003)(6506007)(6666004)(107886003)(41300700001)(86362001)(8676002)(66556008)(66946007)(66476007)(4326008)(316002)(5660300002)(38100700002)(8936002)(6486002)(2616005)(83380400001)(1076003)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ieG3iSKLRENT7LqVzY0t6BllyfOCbZG0IcwqSmPqVZuGencxpecFogUAU9G/vu8GM60ETd29E96Y2rJwYLVbIKr4XyKa7lXrzNEw9/bfI7zC5nuOpSQmR2OcFcpfwnThKy87iJfCjpez/fG5m/P7z6sYY6D6iohAm4OV9VkqWWug3YZMJId5pBL9cU5id+Y1hTsu9gmgxj+RR9QMaiW9aRwehUxGjQ6kAR36pj0sMdba/0vH55YJFdxOnB4ifSq5auB0gLiFhj2+fW59sBrmmr5KWoS6T+h/yigSRihq2Z6FAhY2Sn4LAhumgMaxcZmrW0cez/oGcukR48UqVu1gDXSy+hlIDPeSqapDQkPvc7qyTieQcOvXfmr+nHHI0vEiHjBjQleIHALml1Kht9MbNFCwi1Q8rXIFSKPQG/Dt+aEAyUNTUEzCowCsb4qKYuCvttrmil86bxZ6z4HHo42C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c4gxT7o2nAdBFUcdAF/dkrmlpgociagJDHB0aN6ATJKmN8s2lN4T8+kF9gpIHA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49b110b2-b58e-4a6c-147a-08dad9ac807a X-MS-Exchange-CrossTenant-AuthSource: CY4PR10MB1463.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2022 06:13:34.0995 (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: l52pPms0H7ovGMsNmP980WM4uRYMn4+Szh07cxWH6FA4XcCTcgy/xI+uqT7O8oH9NHCqJuNg6/zVWiU7fG6z8SBSq6iB6duYr/YVHaMcdHk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5066 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-09_02,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 suspectscore=0 phishscore=0 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090053 X-Proofpoint-GUID: g5i5rK6gTB51T_acqwM4qR6kOfxk5lvB X-Proofpoint-ORIG-GUID: g5i5rK6gTB51T_acqwM4qR6kOfxk5lvB Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute_req is going to be removed. Convert drivetemp to scsi_execute_cmd. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche --- drivers/hwmon/drivetemp.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/hwmon/drivetemp.c b/drivers/hwmon/drivetemp.c index 5bac2b0fc7bb..2434ddb000f0 100644 --- a/drivers/hwmon/drivetemp.c +++ b/drivers/hwmon/drivetemp.c @@ -164,7 +164,7 @@ static int drivetemp_scsi_command(struct drivetemp_data *st, u8 lba_low, u8 lba_mid, u8 lba_high) { u8 scsi_cmd[MAX_COMMAND_SIZE]; - int data_dir; + enum req_op op; memset(scsi_cmd, 0, sizeof(scsi_cmd)); scsi_cmd[0] = ATA_16; @@ -175,7 +175,7 @@ static int drivetemp_scsi_command(struct drivetemp_data *st, * field. */ scsi_cmd[2] = 0x06; - data_dir = DMA_TO_DEVICE; + op = REQ_OP_DRV_OUT; } else { scsi_cmd[1] = (4 << 1); /* PIO Data-in */ /* @@ -183,7 +183,7 @@ static int drivetemp_scsi_command(struct drivetemp_data *st, * field. */ scsi_cmd[2] = 0x0e; - data_dir = DMA_FROM_DEVICE; + op = REQ_OP_DRV_IN; } scsi_cmd[4] = feature; scsi_cmd[6] = 1; /* 1 sector */ @@ -192,9 +192,8 @@ 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_execute_cmd(st->sdev, scsi_cmd, op, st->smartdata, + ATA_SECT_SIZE, HZ, 5); } static int drivetemp_ata_command(struct drivetemp_data *st, u8 feature, From patchwork Fri Dec 9 06:13: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: 632848 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 3D10BC4332F for ; Fri, 9 Dec 2022 06:15:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229762AbiLIGPy (ORCPT ); Fri, 9 Dec 2022 01:15:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbiLIGPv (ORCPT ); Fri, 9 Dec 2022 01:15:51 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05A438F715 for ; Thu, 8 Dec 2022 22:15:51 -0800 (PST) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B8MIfLl002811; Fri, 9 Dec 2022 06:13:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=8iBDUcGFdAoUWj4rxtmqB3WcwSz320vHkiYSN+G3L3Y=; b=Dkwmo5yx6zheDt9Z0ahBcZ0IwU9MMeoGmbWBJSeXXoeaGgDEqrw1+GV8PYrNunq8zT8z rdnCa4TnM6fuDgykzw1TwE3EWm9oZVMvPs8isBT0d84chd/+XYDgLoL5Gl4XfVWt6yF2 kgmmdpyqzgcAdF7DeR0QHz66LebpD1V+/CO4BfddLm1704Gvb/IErq6v/qPQPCvXlalD nsTUfUUvn0bXf6B0xTs6ESZntfyyPUSaS9xrcx767QRVPKWTKpP5tJ4rRsahqOaDg/C3 hPPDe1CzCyIdoNEyBbh/WWjWWhcNHiM8Ahu/Qy68a4vmKd7bGc6f7goOfeJYRs0PFEuS Ig== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3maudkcjdw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:39 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2B95eQX3008346; Fri, 9 Dec 2022 06:13:38 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3maa61ymmr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rf6iLynVqTJNzg7h9W2u7HsiOQyZf7MS33mvWRMnwXH5hbfKb74YlkIHp150Imz+oYQO/Z6DSr0JBb7kpghMCkX4ExoezLGQIT2fYOtmDfoqFDGClBczwwgl7cfigEvbketXtD8FmpIGhVZvqzernm1SecTjNlHERF1bAh/PbQqtrAzUpTpcrTKHAg7GIoCOFkxZwwF9yg8SIo9hD++w+amhp6kwvMUODlF5UaKAAp+BCRBNXOnHOeqO0Fu+U8MPphFGSTxM70qdASU8ugu8LETij8XMzxg2sw7notM9sRDZUFSlL2jLWqg0VCq6h6U5Gf8S7ltGPGJdv/siOXJMrQ== 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=8iBDUcGFdAoUWj4rxtmqB3WcwSz320vHkiYSN+G3L3Y=; b=ncdR9w8lH/6+TC0Gexv53oEdzN60LtTMcUQpq1ILPoUOWTOBO60f48MRWRN2ak9tnoEPW21MlJSbY7IOX2FoKyrZDjAo7IDetWDSNVRrpHczkmaPz3CpRNFzweU5LmL5SkJT/qgpx7X7/mMyt9zJuGBTf4k/GsAnZDUJNVw2s6elLyz3S+HUiXZra5JHggeY2PypbLx6G/EdW8N7x4dk18pY/LYU5Bo3+j09+vLt5Lm5W3lw9JPx97KhQK5Ui/YjQAt18iKmsptX4/e8ded6wJ+kxwuUnj3fHLBL7q1xiT8FNS3xdcToHxcHirnmMfJ2Pd9f0mAFTIV9iXQ+moGGCA== 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=8iBDUcGFdAoUWj4rxtmqB3WcwSz320vHkiYSN+G3L3Y=; b=hOoEHyqC2Xu7MieAYXcoSR57dF/iO0TGssUgDXxL10zLS+sJHp4dbhpBBtWu61XZhByFx2ycgMpKv+nQQz7/4mToCkvW+BUCZR72IUh3rwV1nXoO4IsPE93wqy8iZ504BMhqoFW4uiOn6TpbeMlNUj8fUhZrVKmS03cyG6Sdris= Received: from CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) by CH0PR10MB5066.namprd10.prod.outlook.com (2603:10b6:610:c4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.18; Fri, 9 Dec 2022 06:13:36 +0000 Received: from CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99]) by CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99%6]) with mapi id 15.20.5880.016; Fri, 9 Dec 2022 06:13:36 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 04/15] scsi: ch: Convert to scsi_execute_args Date: Fri, 9 Dec 2022 00:13:14 -0600 Message-Id: <20221209061325.705999-5-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209061325.705999-1-michael.christie@oracle.com> References: <20221209061325.705999-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR14CA0025.namprd14.prod.outlook.com (2603:10b6:610:60::35) To CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR10MB1463:EE_|CH0PR10MB5066:EE_ X-MS-Office365-Filtering-Correlation-Id: 718124df-0da5-414b-4b85-08dad9ac81dd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BgkKo+F96tffi918mFqHGvoc4nnqcvNVqPaobHl8zlR/PYqJYe+RqKNSr32zLiesso45Pwhbelq8BMFQEmPcgMN/JWR4t9ui/UiXFuGM0XIjoFCx913Et42kEibbwVzHpmZgkpC2miC9nmoWswtNvcZp2hm7UTXx9fmuEivaB8N/JnTHJUQKTzOE7JqSR2pg1uZKuokCGx857WHWKN1BhCWBR22HgpjX5aRhFxn9AUUb6LoV7Qv9YnhwcoPGE1Ej3C34XNWSHjdqSf3SR78UK45LuoaIFi2ssfOKGflXIQ0jieeNHFTiK3LasJo3YkdQmb26+1AvO5+qDQSwhLlDlpcf7igxyyVsI6h7qeZxgL4hku28oTSvP9LS96JscI2p6iNBSFQ9oWkDSSY/9wyKd8OWBzEaOiu3vRQJPkmtj5bnwc3PibvGxS/XO0eCz0Vfr2hruKFAUONl4cdV8AL6d2n6hwHQ4jkkwAwOf9o3luGCZO1/4BsPgldI8stA51cIFEQle1FvwDUXvr004qO8nk2xiHR8HHA647j4gxit45nHy0kBBb+brIW8xttO/tawXh2INLWnh2Py+I3Qsq8/uN84ZI9Y2Bkrq/aUyyWi6Yu7Z4grQMqTpxLIlOU7YOQdhOsWjEqpWjYcf/mj3kJkUw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR10MB1463.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(396003)(39860400002)(136003)(366004)(346002)(451199015)(478600001)(6512007)(26005)(2906002)(36756003)(6506007)(6666004)(107886003)(41300700001)(86362001)(8676002)(66556008)(66946007)(66476007)(4326008)(316002)(5660300002)(38100700002)(8936002)(6486002)(2616005)(83380400001)(1076003)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wOEjLoK6vNH7icPiziiYBKXNkBs0wGuS2czVaVU2e91B/dyVfQBPqf6AotOUBDmvCKQWKtxKLKLQsYdADijbpETQg/Sk1KJ5JqAX4Sbn3iKU7sOWepB/0gjW9Kw2rzt6vVcEWJOwOBmvAlUZ7cFOydJHWVZPfVfFkJzIiXqjq5KQGY8NJrVc9bzFUo4cW8PjJbQnOWYI99oc0a4eCB8pVDA+eVIVOT8iaQ19o5GAzMZuK8Mj5jVjeAR+zynOb5sJM558vsqvrrGYnkCh/RWtlEpCtTRYUHkzzCVHGhBcsXZix7OSYwDe0N9RqKx/U5M3WqPYA+i++pJoNPxFIQ5fg6HnEH2S2iC77IRqnC1IhwnOIbbdDOrlqKbjRd6DM5Nj0uHkGmSIfZ2Vox2JMPO+CecXDHbKDTpQE5PKbfJBXgwE2KzAm0Pijf6HZRTAcKVkIiLSFVabk7k1mdoSrvV97Ye6lsUdesQZSauOY5jXvmjFNbz0B9kEQ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vocOgt+ztfw0Vm6uR63t+gw30KTY0XxKT9C4gobeCLR8BQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 718124df-0da5-414b-4b85-08dad9ac81dd X-MS-Exchange-CrossTenant-AuthSource: CY4PR10MB1463.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2022 06:13:36.4431 (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: DnFuLuPDP9wRO1ZArTvML41V1qt0drl9erwCzEW3VFBB0qFHId+/SSp4Jxh490ykVglMPSK6qnk4CZAhowA6iJs/T4wTLEyHvIDPvpAhv/w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5066 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-09_02,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 phishscore=0 spamscore=0 bulkscore=0 mlxscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090053 X-Proofpoint-GUID: 6BzEfYiVrgiX3JGpM0akc1R_0qszJiKe X-Proofpoint-ORIG-GUID: 6BzEfYiVrgiX3JGpM0akc1R_0qszJiKe Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute_req is going to be removed. Convert ch to scsi_execute_args. Signed-off-by: Mike Christie Reviewed-by: John Garry Reviewed-by: Bart Van Assche --- drivers/scsi/ch.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index 7ab29eaec6f3..58e7d5ee1a62 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c @@ -184,20 +184,21 @@ static int ch_find_errno(struct scsi_sense_hdr *sshdr) static int ch_do_scsi(scsi_changer *ch, unsigned char *cmd, int cmd_len, - void *buffer, unsigned buflength, - enum dma_data_direction direction) + void *buffer, unsigned int buflength, enum req_op op) { int errno, retries = 0, timeout, result; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; timeout = (cmd[0] == INITIALIZE_ELEMENT_STATUS) ? timeout_init : timeout_move; retry: errno = 0; - result = scsi_execute_req(ch->device, cmd, direction, buffer, - buflength, &sshdr, timeout * HZ, - MAX_RETRIES, NULL); + result = scsi_execute_args(ch->device, cmd, op, buffer, buflength, + timeout * HZ, MAX_RETRIES, exec_args); if (result < 0) return result; if (scsi_sense_valid(&sshdr)) { @@ -254,7 +255,7 @@ ch_read_element_status(scsi_changer *ch, u_int elem, char *data) cmd[5] = 1; cmd[9] = 255; if (0 == (result = ch_do_scsi(ch, cmd, 12, - buffer, 256, DMA_FROM_DEVICE))) { + buffer, 256, REQ_OP_DRV_IN))) { if (((buffer[16] << 8) | buffer[17]) != elem) { DPRINTK("asked for element 0x%02x, got 0x%02x\n", elem,(buffer[16] << 8) | buffer[17]); @@ -284,7 +285,7 @@ ch_init_elem(scsi_changer *ch) memset(cmd,0,sizeof(cmd)); cmd[0] = INITIALIZE_ELEMENT_STATUS; cmd[1] = (ch->device->lun & 0x7) << 5; - err = ch_do_scsi(ch, cmd, 6, NULL, 0, DMA_NONE); + err = ch_do_scsi(ch, cmd, 6, NULL, 0, REQ_OP_DRV_IN); VPRINTK(KERN_INFO, "... finished\n"); return err; } @@ -306,10 +307,10 @@ ch_readconfig(scsi_changer *ch) cmd[1] = (ch->device->lun & 0x7) << 5; cmd[2] = 0x1d; cmd[4] = 255; - result = ch_do_scsi(ch, cmd, 10, buffer, 255, DMA_FROM_DEVICE); + result = ch_do_scsi(ch, cmd, 10, buffer, 255, REQ_OP_DRV_IN); if (0 != result) { cmd[1] |= (1<<3); - result = ch_do_scsi(ch, cmd, 10, buffer, 255, DMA_FROM_DEVICE); + result = ch_do_scsi(ch, cmd, 10, buffer, 255, REQ_OP_DRV_IN); } if (0 == result) { ch->firsts[CHET_MT] = @@ -434,7 +435,7 @@ ch_position(scsi_changer *ch, u_int trans, u_int elem, int rotate) cmd[4] = (elem >> 8) & 0xff; cmd[5] = elem & 0xff; cmd[8] = rotate ? 1 : 0; - return ch_do_scsi(ch, cmd, 10, NULL, 0, DMA_NONE); + return ch_do_scsi(ch, cmd, 10, NULL, 0, REQ_OP_DRV_IN); } static int @@ -455,7 +456,7 @@ ch_move(scsi_changer *ch, u_int trans, u_int src, u_int dest, int rotate) cmd[6] = (dest >> 8) & 0xff; cmd[7] = dest & 0xff; cmd[10] = rotate ? 1 : 0; - return ch_do_scsi(ch, cmd, 12, NULL,0, DMA_NONE); + return ch_do_scsi(ch, cmd, 12, NULL, 0, REQ_OP_DRV_IN); } static int @@ -481,7 +482,7 @@ ch_exchange(scsi_changer *ch, u_int trans, u_int src, cmd[9] = dest2 & 0xff; cmd[10] = (rotate1 ? 1 : 0) | (rotate2 ? 2 : 0); - return ch_do_scsi(ch, cmd, 12, NULL, 0, DMA_NONE); + return ch_do_scsi(ch, cmd, 12, NULL, 0, REQ_OP_DRV_IN); } static void @@ -531,7 +532,7 @@ ch_set_voltag(scsi_changer *ch, u_int elem, memcpy(buffer,tag,32); ch_check_voltag(buffer); - result = ch_do_scsi(ch, cmd, 12, buffer, 256, DMA_TO_DEVICE); + result = ch_do_scsi(ch, cmd, 12, buffer, 256, REQ_OP_DRV_OUT); kfree(buffer); return result; } @@ -799,8 +800,7 @@ static long ch_ioctl(struct file *file, ch_cmd[5] = 1; ch_cmd[9] = 255; - result = ch_do_scsi(ch, ch_cmd, 12, - buffer, 256, DMA_FROM_DEVICE); + result = ch_do_scsi(ch, ch_cmd, 12, buffer, 256, REQ_OP_DRV_IN); if (!result) { cge.cge_status = buffer[18]; cge.cge_flags = 0; From patchwork Fri Dec 9 06:13: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: 633177 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 5A5A6C4332F for ; Fri, 9 Dec 2022 06:15:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229849AbiLIGP6 (ORCPT ); Fri, 9 Dec 2022 01:15:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229760AbiLIGPw (ORCPT ); Fri, 9 Dec 2022 01:15:52 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34516941B8 for ; Thu, 8 Dec 2022 22:15:52 -0800 (PST) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B8MIruj021284; Fri, 9 Dec 2022 06:13:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=jcnelLL82mZHIMuOTNnh1M/rC/UzYDWkFZPBCVJT9FU=; b=wK1DV8LaXuW+Z/8FXEJ08qQQmeRPFR8Z0rHbuaMP8XxNOzendmCW5MXnfzGZYIPIh3uZ J+j3uxwqXbVQ3iE7dvkVaURswO7VCm02OAGsh+HrkqXgsdzgmY5b6zolcsF3ZMdHwKr1 4PBkoaCCMWzsutMbMyz//CuOH92NjUrnHNM0F491KlnaRmZ6u1D2XxBaQud7o5YOvu4H 0UmF4Thti2BhK7dXMN6XQqJ6Z9edyoAtw1ezdGlZTzvpGQCbUW0Ejboqswjg8UnUCBAS 2FuGlb1StR5WcLGpP4jzl7giNgbncaY+ezgbZHJzfnrIXukVmLqvNEmcm4zlUf2VGVR+ lA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3maud74jca-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:41 +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 2B93ReqH032684; Fri, 9 Dec 2022 06:13:41 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3maa7fdaf4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lLfVaSilP+BsM58wUDSBeNRUn9eBVSBcZhTCRT+4/N9YV0oF6E+C/TcrqHOFn1n/kdIEae3NckDaeEH5nyB5iUy6eqUyUo2eiDNWjBuuwxNqXiRARM/wufl6/RqGxXFqE5A71vhoTAZvfKx42L1RNg9WssstpVjaUY13FuOMY4HAJrVyNalZLUw1tdAaVRJfdiEjBKkO8MANJcWeuMK0pqAu2lO+ikLIzImoPuqg2iPSJKlwW5PQaKkxeoE7EZRFQ/oStiqOGcLXJE/7Tls3Ys/TE8CNk4gV7GLiYkHtyXQe3X8LkqbMvktOr1lG1jvFRN7OzJmBpeIuQtj40/ksUA== 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=jcnelLL82mZHIMuOTNnh1M/rC/UzYDWkFZPBCVJT9FU=; b=XiOVJNXbQo+zdV8lOy8of334NyOMYZ775mY21ku2789sGvKfbuYq/DDJ0AhLjG5lbGEn72CL+TfGyuwF12I9Ph2xMjv3pdlHGsE2qbW0dTnvnj6dO3qVq3Pq7z2ObODcjognN+TIykRCiFQkm8PpE1IWPqGAULZkfY4lVPyWR+Wnqa+XYIP9l06T2nlLicG6X8cPO3jojMMyUSxUNQHo5tEdHuoes9ZDSAs6Nb5fn5YCsdsQ+sZamegaChnjdYY66wKuW8eI+6HYZrPoawtOGZNiS7tO+x3ONJqtnWXQsXMzXuY3kR+7hoAdgNb0kAeQmjengZZyg2yzd+2wM7mp+A== 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=jcnelLL82mZHIMuOTNnh1M/rC/UzYDWkFZPBCVJT9FU=; b=BCOioSKx2vnxr+sVkn+/yCReoRquoCXQBC963NQNR2hdPiSD1Kfv17wy9rH68psjeKNFiAmsJDc4hJWuJuCF7TrQSlP4WrFwlDuEyM0t+m94hY7PcRrQ5Y8D7lPaeSB39yVTDPD2FSBN2o4KYC496G+p3wV7+8soNg+0wk4/Btw= Received: from CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) by CH0PR10MB5066.namprd10.prod.outlook.com (2603:10b6:610:c4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.18; Fri, 9 Dec 2022 06:13:38 +0000 Received: from CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99]) by CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99%6]) with mapi id 15.20.5880.016; Fri, 9 Dec 2022 06:13:38 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 05/15] scsi: scsi_dh: Convert to scsi_execute_args Date: Fri, 9 Dec 2022 00:13:15 -0600 Message-Id: <20221209061325.705999-6-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209061325.705999-1-michael.christie@oracle.com> References: <20221209061325.705999-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR14CA0013.namprd14.prod.outlook.com (2603:10b6:610:60::23) To CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR10MB1463:EE_|CH0PR10MB5066:EE_ X-MS-Office365-Filtering-Correlation-Id: 5ed1924a-e0f0-4aca-36d0-08dad9ac8313 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZqZkSnMseBkFIUjYsei/AwvuylwKf0sR5tNysxeShysFuegG5oWsC/gkyerOxZpeH/u3S3P1kbv7yx84SRnL6xLDsbmeqtuTdpLPXLpfpgZcn4jlyEE8G6NMcmi5nhpNL1NeZ1M3EFN8knRfFz+nL5FFvoiGSJjYBmEv2uzsP1wyN6bjrHtP68gGyym+HnjKTn6GYn38i7nu6MNasmzHZGXRRsWLVdEaCUz0ET9MUNRwACGaG6rIh+0UUjNk6iqVFm1yRR1nsl+rQLBs+Ivt/kt+Ncf8331Ihb8Kj3IwHVNEDyxJKTqDHB2zste7ZZVB/KqamaSsA3dUSXseZbyuPEGKLBNnUUt27lNKOcbaDW4oxPU9IGFreLfQbGFCx+bPJjMrp4XkVOCRWuyGN8r7uOjRZQaJo8rrdOt/LuPfdybcyq3RQwfUxrKvU13G9YUePORHVnSOtyCpNjT1RTcUbKcNXq1KEeaSC0EjAl/7muNJN9lT2VcPv1MaywKTIelNo9qNL4uQTPDxdsY1Z/DEkRr5QV4zVOveFT8txUb/Ubx4OjbE1CIogrq1viAFcbAZ9xLSTbG59ySZeOjkIBkYbMjyNhdhxMoBTrm9a+hvPxWQr9xBDWzk1NUDRHwiR8z85mRPyN6HAdrVvVgKef4zvA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR10MB1463.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(396003)(39860400002)(136003)(366004)(346002)(451199015)(478600001)(6512007)(26005)(2906002)(36756003)(6506007)(6666004)(107886003)(41300700001)(86362001)(8676002)(66556008)(66946007)(66476007)(4326008)(316002)(5660300002)(38100700002)(8936002)(6486002)(2616005)(83380400001)(1076003)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iE6o246PiZdg9mSYsODx3DOen6w9zd4w4pFfeGzr5uPck/RD7iJ5ISs3mo3v1JVufL0BtRDXAKPA6mRA2iSYmiD1lwZR4VGCU5h0fk1u98Vmfoig/tJDc94IfaWWoU0WVk2daA5dg8oUOJVjw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bUnkgp2mkOAEuLjRseGh5GUPw8rbjupGNGtvaxS/zi1AYomMmMnUnnmaltQCJMgVFdhEsSPzZUl1hf2mWRiD9Yyv2Gr1XkPKH2XMmc9nYiIfZB5Mgnwvrp7LS1HBLbGqt7rpkoPn4BNYNWxWDca1sV+Rg0lqubvN6AdHoQuVUyyzed36ntPy4fVlpMfMYPfFpn25cKALfHXJlguxg4nigbDhKKs1GpaP4ONXlWEfTtD0GBpZYj9uXYlMIIp5qU4aS+kbdPk6T+XWp35gLtMYdsBcdna1IlyMh2kg4HPAfo6tyGGH0bzoA+TPYc8adASw1D6gcpBnoIJWOs5Ti3nxSQN/LFgxbM7k4yD419grsuNbGH/WmkFA7X9jD4INWoZsu4EQ22vVA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ed1924a-e0f0-4aca-36d0-08dad9ac8313 X-MS-Exchange-CrossTenant-AuthSource: CY4PR10MB1463.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2022 06:13:38.5054 (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: 1b6R+AuuPuHwURETR4TLFwhrECq7wpcX1kt1K2aYzLy14tl+MFAcBjA0y3EAsMbPnGIkrVb5NdWhVWOQ0MZ0STYY+bk42ov6bl5HFcTIu3s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5066 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-09_02,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 suspectscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090053 X-Proofpoint-GUID: SqNTLncFRuNq1nzC64TI3MkJvxGpJ9f4 X-Proofpoint-ORIG-GUID: SqNTLncFRuNq1nzC64TI3MkJvxGpJ9f4 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute is going to be removed. Convert the scsi_dh users to scsi_execute_args 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 | 22 ++++++++++------- drivers/scsi/device_handler/scsi_dh_rdac.c | 12 ++++++---- 4 files changed, 45 insertions(+), 28 deletions(-) diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c index 49cc18a87473..c5bb04a8992b 100644 --- a/drivers/scsi/device_handler/scsi_dh_alua.c +++ b/drivers/scsi/device_handler/scsi_dh_alua.c @@ -127,8 +127,11 @@ static int submit_rtpg(struct scsi_device *sdev, unsigned char *buff, int bufflen, struct scsi_sense_hdr *sshdr, int flags) { u8 cdb[MAX_COMMAND_SIZE]; - blk_opf_t req_flags = REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | - REQ_FAILFAST_DRIVER; + blk_opf_t opf = REQ_OP_DRV_IN | REQ_FAILFAST_DEV | + REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER; + const struct scsi_exec_args exec_args = { + .sshdr = sshdr, + }; /* Prepare the command. */ memset(cdb, 0x0, MAX_COMMAND_SIZE); @@ -139,9 +142,9 @@ 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_execute_args(sdev, cdb, opf, buff, bufflen, + ALUA_FAILOVER_TIMEOUT * HZ, + ALUA_FAILOVER_RETRIES, exec_args); } /* @@ -157,8 +160,11 @@ static int submit_stpg(struct scsi_device *sdev, int group_id, u8 cdb[MAX_COMMAND_SIZE]; unsigned char stpg_data[8]; int stpg_len = 8; - blk_opf_t req_flags = REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | - REQ_FAILFAST_DRIVER; + blk_opf_t opf = REQ_OP_DRV_OUT | REQ_FAILFAST_DEV | + REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER; + const struct scsi_exec_args exec_args = { + .sshdr = sshdr, + }; /* Prepare the data buffer */ memset(stpg_data, 0, stpg_len); @@ -171,9 +177,9 @@ 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_execute_args(sdev, cdb, opf, stpg_data, + stpg_len, ALUA_FAILOVER_TIMEOUT * HZ, + ALUA_FAILOVER_RETRIES, exec_args); } 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..b07bc996b3f2 100644 --- a/drivers/scsi/device_handler/scsi_dh_emc.c +++ b/drivers/scsi/device_handler/scsi_dh_emc.c @@ -239,8 +239,11 @@ static int send_trespass_cmd(struct scsi_device *sdev, unsigned char cdb[MAX_COMMAND_SIZE]; int err, res = SCSI_DH_OK, len; struct scsi_sense_hdr sshdr; - blk_opf_t req_flags = REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | - REQ_FAILFAST_DRIVER; + blk_opf_t opf = REQ_OP_DRV_OUT | REQ_FAILFAST_DEV | + REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; if (csdev->flags & CLARIION_SHORT_TRESPASS) { page22 = short_trespass; @@ -263,9 +266,9 @@ 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_execute_args(sdev, cdb, opf, csdev->buffer, len, + CLARIION_TIMEOUT * HZ, CLARIION_RETRIES, + exec_args); 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..4cb78a2f825d 100644 --- a/drivers/scsi/device_handler/scsi_dh_hp_sw.c +++ b/drivers/scsi/device_handler/scsi_dh_hp_sw.c @@ -83,12 +83,15 @@ static int hp_sw_tur(struct scsi_device *sdev, struct hp_sw_dh_data *h) unsigned char cmd[6] = { TEST_UNIT_READY }; struct scsi_sense_hdr sshdr; int ret = SCSI_DH_OK, res; - blk_opf_t req_flags = REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | - REQ_FAILFAST_DRIVER; + blk_opf_t opf = REQ_OP_DRV_IN | REQ_FAILFAST_DEV | + REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; retry: - res = scsi_execute(sdev, cmd, DMA_NONE, NULL, 0, NULL, &sshdr, - HP_SW_TIMEOUT, HP_SW_RETRIES, req_flags, 0, NULL); + res = scsi_execute_args(sdev, cmd, opf, NULL, 0, HP_SW_TIMEOUT, + HP_SW_RETRIES, exec_args); if (res) { if (scsi_sense_valid(&sshdr)) ret = tur_done(sdev, h, &sshdr); @@ -121,12 +124,15 @@ static int hp_sw_start_stop(struct hp_sw_dh_data *h) 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; + blk_opf_t opf = REQ_OP_DRV_IN | REQ_FAILFAST_DEV | + REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; retry: - res = scsi_execute(sdev, cmd, DMA_NONE, NULL, 0, NULL, &sshdr, - HP_SW_TIMEOUT, HP_SW_RETRIES, req_flags, 0, NULL); + res = scsi_execute_args(sdev, cmd, opf, NULL, 0, HP_SW_TIMEOUT, + HP_SW_RETRIES, exec_args); 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..c5fe40f1f845 100644 --- a/drivers/scsi/device_handler/scsi_dh_rdac.c +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c @@ -536,8 +536,11 @@ static void send_mode_select(struct work_struct *work) unsigned char cdb[MAX_COMMAND_SIZE]; struct scsi_sense_hdr sshdr; unsigned int data_size; - blk_opf_t req_flags = REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | - REQ_FAILFAST_DRIVER; + blk_opf_t opf = REQ_OP_DRV_OUT | REQ_FAILFAST_DEV | + REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; spin_lock(&ctlr->ms_lock); list_splice_init(&ctlr->ms_head, &list); @@ -555,9 +558,8 @@ 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)) { + if (scsi_execute_args(sdev, cdb, opf, &h->ctlr->mode_select, data_size, + RDAC_TIMEOUT * HZ, RDAC_RETRIES, exec_args)) { err = mode_select_handle_sense(sdev, &sshdr); if (err == SCSI_DH_RETRY && retry_cnt--) goto retry; From patchwork Fri Dec 9 06:13: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: 632847 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 422E8C10F1B for ; Fri, 9 Dec 2022 06:16:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229843AbiLIGQJ (ORCPT ); Fri, 9 Dec 2022 01:16:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229835AbiLIGPz (ORCPT ); Fri, 9 Dec 2022 01:15:55 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32F97944CF for ; Thu, 8 Dec 2022 22:15:54 -0800 (PST) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B8MIvCH029750; Fri, 9 Dec 2022 06:13: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=TWpWKPTJjOJqQwtwUfV0RbhOj49aoyayeLtrRaHXhw0=; b=k78ovrb7QOQbvcEc6rTR3+HjHsgSsfmgFF+RTSEzMycdbUVztMgge/WaohiwHbdI+kyp CcU4CZ+YZ5ZcirZbcfy8xVRDUtJfsa12QSzU3oSlX3KnXE8hWAIFl1Acvm7+H/2IXWcN ZZbijkYQfxOf4G/FVhpgjwOAGJsksISyXn/pM64voYEatQIUL4G75iSFHd9a7JGukocG YYnBQZJkTW47yb8ITPAOgWMPh5ydUze0QwcrZDz9bS6XhZHwkYqCcwEqq0TPAUJnFpLC ORBg7+I1ZyxuhNkhasnl8h0LH5SlrZSBZUxwMaM8nXuxfEH+Dw6NEvCgndhrUHPq4L22 Ng== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3maubamj5p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:43 +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 2B93FAG5032666; Fri, 9 Dec 2022 06:13:43 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2174.outbound.protection.outlook.com [104.47.55.174]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3maa7fdafy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WLhfs15DHZ+D9xEoPDw14vqh5qUxhfSWrpi5cjPH8TfC2CpIdc1yfjnh/T3XHNMXEGKlG4q4eXfZuza402a3ygAjLHgsgqljf7YpVLWQaU9GP0BzjeW6DyreTrJslfpHigLgFOVnLb9S2/R/IcunXNKQiFehK+FWwowUqumtsHpQIlRUsnrn9oms4n1y+Sm5trTeReZsivgCeOgBr3lKkvNVzBWd//Y97Wht55aapFgFz2pBk1M+LD2kCRbXcfbhU/O+50q/nc+cUUJNLli6m+qz3KAkDPe/KtzBmeOS8csVRqRNf/jvvSh5TAWUf2/31LQMwEKBwnuTpQuxcKaLlw== 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=TWpWKPTJjOJqQwtwUfV0RbhOj49aoyayeLtrRaHXhw0=; b=Ml653ZVxjdbk6+DadIcZUgacSzYt8s700jmAzTjEUUNVwzrGkAIiNxa8prbuwebxTbCVKEoKyub7Y1LCEedbhoce/QbGjbaSprtYHIeOBkf3eokwymuFjK/rEeODcrMjf7jiB+YwTnP5cEHHQ+At6m4pniXnFfLOnXcb6xXVot2skMbPcgw3Wk6hfwh4VXjFMvqKt4k1tzopELniX2mgBGbAddB0R0m0zhXTLi6sg9tql7BXCj9+wGRpRiP+VKcK0XWdx1dKVH6WfcRc3KlAcTC6POi/7i4bkp+XnJVehW+Yu9Nd3lCBe3AMGEesJS8+o9zcOHVCYlZHYjzg4G/5pg== 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=TWpWKPTJjOJqQwtwUfV0RbhOj49aoyayeLtrRaHXhw0=; b=xus8VB9dQdBQwWxCRvesOS0oHVQPbkNUjorOKmhEFxk0PAJeLND09matQ10Ry/aZXjnkzbSzfDTSOdr5hi5Ab64A+5w8wEExQhjRKy9Dq4uCFhP2nz5qngQ2j2fgt35co/DhdXtq7vH14kBPfupH8/l3IMtqrM5C7AUQYz+WuR0= Received: from CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) by CH0PR10MB5066.namprd10.prod.outlook.com (2603:10b6:610:c4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.18; Fri, 9 Dec 2022 06:13:40 +0000 Received: from CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99]) by CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99%6]) with mapi id 15.20.5880.016; Fri, 9 Dec 2022 06:13:40 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 06/15] scsi: core: Convert to scsi_execute_args/cmd Date: Fri, 9 Dec 2022 00:13:16 -0600 Message-Id: <20221209061325.705999-7-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209061325.705999-1-michael.christie@oracle.com> References: <20221209061325.705999-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR14CA0005.namprd14.prod.outlook.com (2603:10b6:610:60::15) To CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR10MB1463:EE_|CH0PR10MB5066:EE_ X-MS-Office365-Filtering-Correlation-Id: 6be7c7f1-8e27-4f20-6dd9-08dad9ac8476 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jX+qKUNy3nG2Lmbp+LBBse+qoEz/w6aKHcw5krTTuzEeJfPb4eTnRBi7Of7FU384sn0XgFUv7Y5956t9tuZL6mI/20FRf0aeJdW1pPTA3B4EehrbUMeYRy5jr7DoO9/LeV4So1pmECJBP6p81A8M9fYsnt2rWilYge3blHSTzPeYrTO9mUxTYCH3MXSDWmcRRnQi4nt2ztPja0MqHaowbJAkCNIzaY/TMJ5KnwkvWvYpkuX8lhWg2Y1cNnnyJSChsTyeGeDcmrSgA7aV6dnMtDn5kWdTseMyK/HnfZvptCqX0wt6r4Sg8bJrdViu8gb/zkGiXLElW3Tq4CYLOS/dtObL7cKfvUyifHevLopmcYDkf60gSxZYVDYotkbRU2CwINrkW7V22JdJ0nKczC1sop/TvfV5VnzyL7ISspCNznbVsQ+grJCPqa4dVAqhTT52xdKa+zzUXjcfBKbJVTmIBO7MJEE/Jvd3oej/Y+pjLHn21L9ddSKPR266SK0fvXwDLFBKIt8420hq9JdBcJmIZ10CNF2zqaz/dra98MtRgL5Gq5/To/vVi0EoqdE/QayYD4XNga5CslRPmOZ3wRDa02/BN6YmpgEuCNo2XE84v5Sp9h3b6GG21a20AEbb8RM2CNvXYNBja1iDIcuVXXcWaQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR10MB1463.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(396003)(39860400002)(136003)(366004)(346002)(451199015)(478600001)(6512007)(26005)(2906002)(36756003)(6506007)(6666004)(107886003)(41300700001)(86362001)(8676002)(66556008)(66946007)(66476007)(4326008)(316002)(5660300002)(38100700002)(8936002)(6486002)(2616005)(83380400001)(1076003)(186003); DIR:OU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1W1z49hHz2YEBZXgrl39I/e+5hBXCmyJT+Bz28b61ycuH4ax+g9Lc0DsFn33Fqs3fVQIv95d2nQRf39MENERDv28pKHQ6GqiB8c2TlVvJqspoPhcalrQyfrEZGkRcV/pOo8fHCrUhQSobO90FpZYj63yEYHBt4q+8SVw1q5C3SQ0tQeFMkv3NHJKe3KrPiVcItRlix/eqYAAUNLQ7QzaBsqDiEILQBBA0nSBLp+48Ezrz47i3WqtC8QbucpX2YBh60NX5g/CMsQJ2v8r/cRvYrNeH38qNQbj1yvg8HsxzblCel3zS5/opmzUYGCoxGm/cQpgS9VT0mutlXpAFLWo367c5vdUp7O3kkVjcEzjfySfB82ZORbWd36slITG1zjU2s/U95qSG/wji/CPm5hnlVDQeY++YNrR5Hx+l+RvnblC3Fdk5C3Lz3KYoBk/jjF4bSUCp1GLN5ggYYj81vzxzbPjo0+Q4O3rVRQ4ePcPAS3yny5TG/rRFGGecqB6qzpH4882/LqnREloGvPxJ3Sl+CyejQDBgwRyyWij1eaS+HBi6fji312exxVopxGNPfkmfGmBPm733LZIB5tiky2zRI3Yx045kd6yZXGfYpo9r1w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6be7c7f1-8e27-4f20-6dd9-08dad9ac8476 X-MS-Exchange-CrossTenant-AuthSource: CY4PR10MB1463.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2022 06:13:40.8177 (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: dszfu+BjPLxzcVmyTFcQykZUXzqPpLHOer7au/EzFjznLKRmwIoPsOmd41mZEg51xPhSz6L7OVuMjbGSeKR7/+g1nQWuDlsaPmrX5sRNw4Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5066 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-09_02,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 suspectscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090053 X-Proofpoint-GUID: tZ-GeA_J-eRGhBCtv9helIK-t1ELfZWb X-Proofpoint-ORIG-GUID: tZ-GeA_J-eRGhBCtv9helIK-t1ELfZWb Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute_req is going to be removed. Convert scsi-ml to scsi_execute_args/cmd. Signed-off-by: Mike Christie Reviewed-by: John Garry Reviewed-by: Bart Van Assche --- drivers/scsi/scsi.c | 12 +++++++----- drivers/scsi/scsi_ioctl.c | 7 +++++-- drivers/scsi/scsi_lib.c | 20 ++++++++++++++------ drivers/scsi/scsi_scan.c | 30 ++++++++++++++++++------------ 4 files changed, 44 insertions(+), 25 deletions(-) diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 1426b9b03612..7717eede4039 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -309,8 +309,8 @@ 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_execute_cmd(sdev, cmd, REQ_OP_DRV_IN, buffer, len, + 30 * HZ, 3); if (result) return -EIO; @@ -510,6 +510,9 @@ int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer, unsigned char cmd[16]; struct scsi_sense_hdr sshdr; int result, request_len; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; if (sdev->no_report_opcodes || sdev->scsi_level < SCSI_SPC_3) return -EINVAL; @@ -531,9 +534,8 @@ 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_execute_args(sdev, cmd, REQ_OP_DRV_IN, buffer, + request_len, 30 * HZ, 3, exec_args); if (result < 0) return result; if (result && scsi_sense_valid(&sshdr) && diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c index 1126a265d5ee..5ce90875866e 100644 --- a/drivers/scsi/scsi_ioctl.c +++ b/drivers/scsi/scsi_ioctl.c @@ -69,12 +69,15 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd, { int result; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; 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_execute_args(sdev, cmd, REQ_OP_DRV_IN, NULL, 0, timeout, + retries, exec_args); 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 f76acb468abb..994e133c19d0 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -2076,6 +2076,9 @@ int scsi_mode_select(struct scsi_device *sdev, int pf, int sp, { unsigned char cmd[10]; unsigned char *real_buffer; + const struct scsi_exec_args exec_args = { + .sshdr = sshdr, + }; int ret; memset(cmd, 0, sizeof(cmd)); @@ -2125,8 +2128,8 @@ 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_execute_args(sdev, cmd, REQ_OP_DRV_OUT, real_buffer, len, + timeout, retries, exec_args); kfree(real_buffer); return ret; } @@ -2157,6 +2160,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, int header_length; int result, retry_count = retries; struct scsi_sense_hdr my_sshdr; + struct scsi_exec_args exec_args = {}; memset(data, 0, sizeof(*data)); memset(&cmd[0], 0, 12); @@ -2168,6 +2172,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, /* caller might not be interested in sense, but we need it */ if (!sshdr) sshdr = &my_sshdr; + exec_args.sshdr = sshdr; retry: use_10_for_ms = sdev->use_10_for_ms || len > 255; @@ -2190,8 +2195,8 @@ 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_execute_args(sdev, cmd, REQ_OP_DRV_IN, buffer, len, + timeout, retries, exec_args); if (result < 0) return result; @@ -2271,12 +2276,15 @@ scsi_test_unit_ready(struct scsi_device *sdev, int timeout, int retries, char cmd[] = { TEST_UNIT_READY, 0, 0, 0, 0, 0, }; + const struct scsi_exec_args exec_args = { + .sshdr = sshdr, + }; int result; /* 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_execute_args(sdev, cmd, REQ_OP_DRV_IN, NULL, 0, + timeout, 1, exec_args); 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 920b145f80b7..2cdba56c1265 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -210,8 +210,8 @@ 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_execute_cmd(sdev, scsi_cmd, REQ_OP_DRV_IN, result, 0x2a, + SCSI_TIMEOUT, 3); } static int scsi_realloc_sdev_budget_map(struct scsi_device *sdev, @@ -647,8 +647,12 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result, unsigned char scsi_cmd[MAX_COMMAND_SIZE]; int first_inquiry_len, try_inquiry_len, next_inquiry_len; int response_len = 0; - int pass, count, result; + int pass, count, result, resid; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + .resid = &resid, + }; *bflags = 0; @@ -666,18 +670,16 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result, /* Each pass gets up to three chances to ignore Unit Attention */ for (count = 0; count < 3; ++count) { - int resid; - memset(scsi_cmd, 0, 6); scsi_cmd[0] = INQUIRY; scsi_cmd[4] = (unsigned char) try_inquiry_len; 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_execute_args(sdev, scsi_cmd, REQ_OP_DRV_IN, + inq_result, try_inquiry_len, + HZ / 2 + HZ * scsi_inq_timeout, 3, + exec_args); SCSI_LOG_SCAN_BUS(3, sdev_printk(KERN_INFO, sdev, "scsi scan: INQUIRY %s with code 0x%x\n", @@ -1403,6 +1405,9 @@ static int scsi_report_lun_scan(struct scsi_target *starget, blist_flags_t bflag struct scsi_sense_hdr sshdr; struct scsi_device *sdev; struct Scsi_Host *shost = dev_to_shost(&starget->dev); + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; int ret = 0; /* @@ -1477,9 +1482,10 @@ 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_execute_args(sdev, scsi_cmd, REQ_OP_DRV_IN, + lun_data, length, + SCSI_REPORT_LUNS_TIMEOUT, 3, + exec_args); SCSI_LOG_SCAN_BUS(3, sdev_printk (KERN_INFO, sdev, "scsi scan: REPORT LUNS" From patchwork Fri Dec 9 06:13: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: 633176 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 003D1C4332F for ; Fri, 9 Dec 2022 06:16:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229760AbiLIGQL (ORCPT ); Fri, 9 Dec 2022 01:16:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbiLIGP6 (ORCPT ); Fri, 9 Dec 2022 01:15:58 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2AED941B8 for ; Thu, 8 Dec 2022 22:15:56 -0800 (PST) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B8MIruk021284; Fri, 9 Dec 2022 06:13: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=muMdYY12NOlv/RuQs6Hx4JZHDL2N8P4PYQRSqeUfujU=; b=wKG3S0CoTYGaa3q4hLISHejlMxVtzA5aKxOPdWGK2NfxOa8NUaJE/Ko4Pk7Ucdmt+GNI kFrriQwMvbqeyuLBAFRCjHUnD4O/qSs87dpv/QGYbFM4bKeYVfyyKM2ATqKTFhGMH2wa 5WBMqDG3rE/YunEgqoBxjendP0bFlsUmPY0S89rNCkNacdiNlI4v0qOVActBCJGOdpKg 5cD1wh1jMG6QCdQuE8qba+0po/VMvJHXbG4tV0imAqjHqF/29NQ5mpDyrE6zo0RCzU+4 oy5zM1flzAYMUyNXVKmMbEERUNAp3kYz/0nfo+sHOLZH661xetAKNJuU1oN9Rem/6d1l cg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3maud74jcc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:46 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2B961aTO033827; Fri, 9 Dec 2022 06:13:45 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2174.outbound.protection.outlook.com [104.47.55.174]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3maa6c65q4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VIu9eVwqHMBXY7ZEhYx9Mc68sZUVDoC+EpZbMZ3pGN/nhnn8zTtjH0Yuinv7nczjx+rH6weKu7TkcNVxSVbKIdvPCgiDyyuvknjRIWteI8SOgbZhQhTo1cFw9aaejdXhTS9vfDDeRmMX6Y1ga6M5EptcaEPVnJCkONtIpngLU3WfORxK4jVWXuNIwhvjA04AYvkNwLAfpyQ3ocUvnpQY65DV4HpyU5hkgE/aHWnce9Py6sBb22LQQQP63g/D3fEC+g+v9X8WsxRBj4sTKwQ/h1RarHxGN019oZzIb6fVkjOxDVIRsTRzOnoXXTdK9aM3K0nZVWYoVJS48wX/CBapKw== 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=muMdYY12NOlv/RuQs6Hx4JZHDL2N8P4PYQRSqeUfujU=; b=Vja3xL8qWi9bMqd3erySG/mBA2i5Il8gMoeilbx9z2hfxuS96WoJzswLS3I1HSRl0lkHANx6O+jpN+b3toEbRibTnjztrfEnWgF82WGa9sEF0KzpWWP+xcKr2zpo8bxoAiXA8Ga81L0G5ObzV0gDrZngYDcAIUUt18gv+fEmzeveRslkCIMcrbtbNNm6S2D8HhAsuuvoLGT5L0gPybfa38wmD+kxAhPbobaLPLjz8EqvMN3IInrTAd5gJUYg+chXfUhHdl4FjU5smp6H7C50KJMijYpscuBs0t79ROABSBfVBFnLzpvcVcl8BPA/Be3/mw42cUt86JQGjzrZk6/sXQ== 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=muMdYY12NOlv/RuQs6Hx4JZHDL2N8P4PYQRSqeUfujU=; b=JGhydOe5lCmM0eHUQntQOZKG+Ry26j6FdTpUDLDXufnUJ1UNOcFHAZ9RHlzyR8pr3BJxtRqrFhVqkTRd4bJOQbCn0nm7po13pNfFV6cGmbiDfoMRYG28dPlPL7frHCyG5gtWQC6IKLhRnji0UFTfIAhiUxGLDDKOA5ZIwYNmfI0= Received: from CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) by CH0PR10MB5066.namprd10.prod.outlook.com (2603:10b6:610:c4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.18; Fri, 9 Dec 2022 06:13:43 +0000 Received: from CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99]) by CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99%6]) with mapi id 15.20.5880.016; Fri, 9 Dec 2022 06:13:43 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 07/15] scsi: spi: Convert to scsi_execute_args Date: Fri, 9 Dec 2022 00:13:17 -0600 Message-Id: <20221209061325.705999-8-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209061325.705999-1-michael.christie@oracle.com> References: <20221209061325.705999-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR14CA0022.namprd14.prod.outlook.com (2603:10b6:610:60::32) To CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR10MB1463:EE_|CH0PR10MB5066:EE_ X-MS-Office365-Filtering-Correlation-Id: ca000b9f-8464-400e-9269-08dad9ac85c6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WCNhI4JboJTnWAn7XbZ0+ii9Q3ybnvEGqzipn8Jwl1sgc4OcqECtxaS64nC51H/kQtvLIevGo9thiLQBYu4NgsLfkUxGnua0JUyHx/AFjGEBOK1xk8FXd5NLurd5hzXQtbq2j+3PdfT4eRBPyG+aekdIp0vGphBERPVz2OtGc69yrvXptQYuQRVsjbrhSkaUx9WgMY+4jLkI7VSPWQ9G1qoioshQ0XiFKnIC4qhAK+3YiBk+9Lj11J/LCtUdHpq2S871/uqB2dV2UD12s+/smRGjI5GGu1IRxjXMq1g27kk6zPvn9Bxbk2Ux1FacuzEo29ZGslRAKytt11DKy20bfgcZ4JFfGGZIRbkTup0HxX6EF+aHXZLueHLmdhB1NnBD9qHozL3EHAFZYVCFiJ+7tWwv/vN/9OjLILRwBbPI2sEO2saWJlpzb5BDJ2NY6F7hSle8JHqQC87P0F6oME9QMIhSBcAShaObeyz3oE54vU5KKMExwyJhSq9uTSr1F3JevsOL73CXqQMNtDASFLvuFwYyPCpb8ssXObR4hJtfMw88VGcW8+/NGhqpN/XHKIxLHFUeCrh7FPb5jh32ILB2PhN5/k8Koe1hVRp8atVeipUv7mYBcrvTqxMhH2RKjDjL9tuXQReyZ6pC6D/shJzgUw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR10MB1463.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(396003)(39860400002)(136003)(366004)(346002)(451199015)(478600001)(6512007)(26005)(2906002)(36756003)(6506007)(6666004)(107886003)(41300700001)(86362001)(8676002)(66556008)(66946007)(66476007)(4326008)(316002)(5660300002)(38100700002)(8936002)(6486002)(2616005)(83380400001)(1076003)(186003); DIR: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KsmNOvLwrk22oZoJNLk27IO0wQUviHeb19JeWNyNOacqJ0qgp1BZT61kag2qESwqM5HXxZ/KvrPcC/Ri/WcA0tAmoqXwuJRHMtmRqpJA+Y3+BjHB+veyqoIReRrpajVwMqxbuO0msSaiNjYj41ZonsVhPqZRBPnnc3oxqB5R3zjKHPBiOw/sgNlht3t4rqloddWmR72nQ8gN4rShCj7vWDkxilWE/5w5RJ1N7KS+5djqTeXHGYok+My6gxYOesq1z1Mswj4SvMmSwiB48kONfNC3WdumdHU0ZwojjbWCNcy8FB1WcxcULLyixKKn10wPp1QCrywyJC3jhlxU2JUdjH3YGev78AN4XbrZOO6jkveiFAccEkeBjXZXVPdIIj74QAE/EtAHjnx4of4Hs/Em8ZCrYiMlPocxePyUInhRnmkwG6lfjt3AKjNxMd2svqjCh9X+iC21xDh3WnL2dAGpLUdtqeBmYfF66lnX4qBnRPS/pz6kq0AiLjFvN0hKtJVwaUl+l7WeUz7KLeP3BJ3m+/bql1ABNo95guukw0vx45HClCeOUcAR2Ku4G6UjnmGy4TaJvz2vpy+l+i+o7alPVvZ31MEPg0dQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ca000b9f-8464-400e-9269-08dad9ac85c6 X-MS-Exchange-CrossTenant-AuthSource: CY4PR10MB1463.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2022 06:13:43.0050 (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: aHaAi6KeYQlSP+WXkHQt8knpi1kdPIkNp5DGnk4QjUXYvaat97q9jSILZ8jvPmgOIJMWiYYbr4/X7XuJLpL2AOzjHlm199xjDdV1pGnRUZc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5066 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-09_02,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090053 X-Proofpoint-GUID: isXhjBnagKfUlKU9xJLAD9D335Jto7E5 X-Proofpoint-ORIG-GUID: isXhjBnagKfUlKU9xJLAD9D335Jto7E5 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute is going to be removed. Convert to the SPI class to scsi_execute_args. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche --- drivers/scsi/scsi_transport_spi.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index f569cf0095c2..fa06821f3cb6 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c @@ -105,28 +105,28 @@ static int sprint_frac(char *dest, int value, int denom) } static int spi_execute(struct scsi_device *sdev, const void *cmd, - enum dma_data_direction dir, - void *buffer, unsigned bufflen, + enum req_op op, void *buffer, unsigned int bufflen, struct scsi_sense_hdr *sshdr) { int i, result; - unsigned char sense[SCSI_SENSE_BUFFERSIZE]; struct scsi_sense_hdr sshdr_tmp; + blk_opf_t opf = op | REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | + REQ_FAILFAST_DRIVER; + struct scsi_exec_args exec_args = { + .req_flags = BLK_MQ_REQ_PM, + }; if (!sshdr) sshdr = &sshdr_tmp; + exec_args.sshdr = sshdr; for(i = 0; i < DV_RETRIES; i++) { /* * 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_execute_args(sdev, cmd, opf, buffer, bufflen, + DV_TIMEOUT, 1, exec_args); if (result < 0 || !scsi_sense_valid(sshdr) || sshdr->sense_key != UNIT_ATTENTION) break; @@ -675,7 +675,7 @@ spi_dv_device_echo_buffer(struct scsi_device *sdev, u8 *buffer, } for (r = 0; r < retries; r++) { - result = spi_execute(sdev, spi_write_buffer, DMA_TO_DEVICE, + result = spi_execute(sdev, spi_write_buffer, REQ_OP_DRV_OUT, buffer, len, &sshdr); if(result || !scsi_device_online(sdev)) { @@ -697,7 +697,7 @@ spi_dv_device_echo_buffer(struct scsi_device *sdev, u8 *buffer, } memset(ptr, 0, len); - spi_execute(sdev, spi_read_buffer, DMA_FROM_DEVICE, + spi_execute(sdev, spi_read_buffer, REQ_OP_DRV_IN, ptr, len, NULL); scsi_device_set_state(sdev, SDEV_QUIESCE); @@ -722,7 +722,7 @@ spi_dv_device_compare_inquiry(struct scsi_device *sdev, u8 *buffer, for (r = 0; r < retries; r++) { memset(ptr, 0, len); - result = spi_execute(sdev, spi_inquiry, DMA_FROM_DEVICE, + result = spi_execute(sdev, spi_inquiry, REQ_OP_DRV_IN, ptr, len, NULL); if(result || !scsi_device_online(sdev)) { @@ -828,7 +828,7 @@ spi_dv_device_get_echo_buffer(struct scsi_device *sdev, u8 *buffer) * (reservation conflict, device not ready, etc) just * skip the write tests */ for (l = 0; ; l++) { - result = spi_execute(sdev, spi_test_unit_ready, DMA_NONE, + result = spi_execute(sdev, spi_test_unit_ready, REQ_OP_DRV_IN, NULL, 0, NULL); if(result) { @@ -841,7 +841,7 @@ spi_dv_device_get_echo_buffer(struct scsi_device *sdev, u8 *buffer) } result = spi_execute(sdev, spi_read_buffer_descriptor, - DMA_FROM_DEVICE, buffer, 4, NULL); + REQ_OP_DRV_IN, buffer, 4, NULL); if (result) /* Device has no echo buffer */ From patchwork Fri Dec 9 06:13: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: 632849 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 25A09C4332F for ; Fri, 9 Dec 2022 06:14:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229865AbiLIGOX (ORCPT ); Fri, 9 Dec 2022 01:14:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229818AbiLIGON (ORCPT ); Fri, 9 Dec 2022 01:14:13 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DD9E944D0 for ; Thu, 8 Dec 2022 22:13:56 -0800 (PST) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B8MIuuj001592; Fri, 9 Dec 2022 06:13:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=0vQGfqBoY7yjR0VTOmxde1JWPq62yOmoyNOEWOLZqSs=; b=IpgSr5wK4y5BNPgrQiFuuBaNEyromjzZr1GYrlXUiNtOiuHKtqOP8XFP9LNn7m7fJx6f zqs8Trn+/v0YUA+YvQqtsCZ8t6NKHMoKmkJfuHRBlOzf1mJ0nsH13CAT59lkPY0vmsLA LF3aFODocwXbVOVyS0BAnOJJ98w2awAAybKmV9H2/Y+dMbqlTsHdB+EDSTmwlK/2/jtW r6JDFyyPtvpBp5wveg/WijF+qDH82CEor7CK8PSaIB6jLRgm0xE5sfbLiDNoV9NqOEHr vDTSlLKTJkQOp8N2x9WZxR29qSgSkqQvjWPASkSBMLyBGUD5toES+tQyAqxI3EzaJ+2+ Zg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mawj6ujb5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:48 +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 2B944UWZ033852; Fri, 9 Dec 2022 06:13:47 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2175.outbound.protection.outlook.com [104.47.55.175]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3maa6c65qu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RarUABi37DLQt6wmOskudTpwsNSMTTaEe8kVKr/RG8QvM405l0w5jXGPyVP3JmcDlEVmbi+IYLMb8UXp76i/h3EdddfMLpLK3YR5mB2pRW5j2ozk3jTs1M2LpN9AeriKbf2tQKALvzy2Vfb2kFuELKZ0vSNLSBOJxVy5ZwAD4Fn+3OccVxjEE9KN/ScB1+t77d6gDde3vSvjYMa6WL1QMa34lfQP+hCvEYjOjAdkkzsnqMAw4JawFqL0wPk29mkU7hlVhrADTCH1qWt0N8DK9igvxhSWQutid3V48T5JVwTXqczE0YkCrrX2CX+8uxKCQSPL6yKsmoHmDusheAt/cA== 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=0vQGfqBoY7yjR0VTOmxde1JWPq62yOmoyNOEWOLZqSs=; b=cy1V2azHv7orCAjnCI1w1CMRND+mPwb3GO7dylVPBJmE0XOFjD/SUvRrxJWxwNkcEnjHOaYTIMBgG62qYIj+aK8imXbi2NE5F5+m6ZZumvybiQzUw1SAWkZgw+4AZLljj3oUfHQPhXgsSgQekhl8SYOMZGXQou2U9r1YGzXX1Rg0Cx1GHXzZaNGIvPZWuCt6RO48OMmXWyVLisTdiy5g0pGlxcV+U4EyzaOEv0MHQwBSA/AEk00OiQhkv5RUI9X/a6AtCcC2SMDkBbrrlY7YEqQ9YyasfzFSj7uwYN4Ynghfwq6fZQbkSKG/16sFlxE5JV8i+rCpN7sfWZoye6w3Tw== 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=0vQGfqBoY7yjR0VTOmxde1JWPq62yOmoyNOEWOLZqSs=; b=DA96TEyzEQ0+JT05Fy2O7ZVnnT3ZvjeYT1RqejYoKL1xh45PhNA9pF/cCyciY5CZrJgivnTt7bqG1azm67acAFf0q9aEn/wjWrHuLVIHJdcgz3q2kg+BjhEF3mxuRGMItBatv2b6aAoI+H92ZZh9uJez1Jc6wMNJZND6gJzAOHY= Received: from CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) by CH0PR10MB5066.namprd10.prod.outlook.com (2603:10b6:610:c4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.18; Fri, 9 Dec 2022 06:13:45 +0000 Received: from CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99]) by CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99%6]) with mapi id 15.20.5880.016; Fri, 9 Dec 2022 06:13:45 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 08/15] scsi: sd: Convert to scsi_execute_args Date: Fri, 9 Dec 2022 00:13:18 -0600 Message-Id: <20221209061325.705999-9-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209061325.705999-1-michael.christie@oracle.com> References: <20221209061325.705999-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0017.namprd20.prod.outlook.com (2603:10b6:610:58::27) To CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR10MB1463:EE_|CH0PR10MB5066:EE_ X-MS-Office365-Filtering-Correlation-Id: cc302056-b07c-4f0c-f481-08dad9ac86f2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iJEShQUr1R2At9iSAzNHbEQdwJesquPcbEevvpA2ZiAri1wA7JCdnbT890eIlXDRzBoyCHKz9+MM8X4kw0N/Dl8h3IoEd4/LTUnX/NLAwTuxI+FtDUDOM2StcHu89/hhrSugXScuHwg9wrhX5OWxsC60jXUFZaygT4jxLqIqrNBQ04rdIlGUbkQWcveaE9NPMsHhqGOh/grwdmnliM72PPpOuSXbZS1yh4+TTMAzlGkmK3Eqbt/6vEUZ4Ra1sBwRUXv6ErP5cmAsnQcMSkp6LEGjzVj8g5vr7ObIerCz7B5COppgk5WtvY+j5vcJaCyBUNFt4x/coMc84Te7KJxd5bce7gLBFzEN6jT2my/2M8xTpMRMDW0u94L0cqLofmmGluVIaoJfl7SuCF30vk48atFWBO+dy7eHXmMVmiwY+WJEMz/n0byf/TEZ8q8lcqm5Ou7A7IijkkSpTYjAY6M8ahT19OEsx+i1LZh+ywuOwYixdVddvyPIURh80PZKtuOmQx+KDOOcmAm1ghLhgPy6efTJZCE+YOJZfxY2iTDNNSnEnYgnXi7w0xNgbWWPzrIAlzqgFmnnMo3PesNxX0ufxJoCl7SPU0ldAoLsw5+liNJ5RlOafNFkz4wq9fC5LLbGUaRZcWEprpZEPjHptZBVfw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR10MB1463.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(396003)(39860400002)(136003)(366004)(346002)(451199015)(478600001)(6512007)(26005)(2906002)(36756003)(6506007)(6666004)(107886003)(41300700001)(86362001)(8676002)(66556008)(66946007)(66476007)(4326008)(316002)(5660300002)(38100700002)(8936002)(6486002)(2616005)(83380400001)(1076003)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2HvJ7/KUICvjCL0vGsKq93O+jxIAx4Q5SvxeilQkNDru+Ogd7uYuyjrAiAS6TqnS6dbMkZUo+tmn/57jzawr0e+0P11OEs0EBJ8d38IB5riqNR+hirVDSW6rE6NAkDedg/iOmDwonpsePf/5PPHAsmBDe5RkPGTLjk1UwFQ5n88nQon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en26efD4tg7s0i+qNSZdE+Q7oSxMu1pgixDtAse36LiP0jgZLBoDmm5GP0dISPdGW0azHew5AF+uB3XCvKDpYG/Us1e7SqzR8s7FU9L4dlNqBe5yW5p/FURVYEtyQeRfZhvcPnXpkRrvUyMddBNEaeEjJiz2l0Gp4vE8gDswPsj20WzlNQIDAApDHtUT/AWYxV72RYehtkW+f9J66Gh89YQRyZI07+Wy7HtOumMUPMlEj8Qldh2H+E+aSd63Dg9PXcqhpWOHfBh7Un4B41HCURKIgtt/FvShEeV7F8dS9PiTtIz0gndSeSXv2LXP9WDKydp0FVi64yVHZpfAfvjuV3YOJrPwWlXVEscYUH2rae6BICCsWdYA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc302056-b07c-4f0c-f481-08dad9ac86f2 X-MS-Exchange-CrossTenant-AuthSource: CY4PR10MB1463.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2022 06:13:44.9736 (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: a0hvf2YjTx8YXJiJTwLnottc9fEXji86w0ZlsA66RNwI3z+qFRu8VCpAayfFJl0nILGxA1SpdtA42/FzKjVq1/L7dxS3jjnmbyb45R+egf0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5066 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-09_02,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090053 X-Proofpoint-GUID: zlPn6TmY282ZMM8t3I6JoK7gEUzMLOVj X-Proofpoint-ORIG-GUID: zlPn6TmY282ZMM8t3I6JoK7gEUzMLOVj Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is going to be removed. Convert sd_mod to use scsi_execute_args. Signed-off-by: Mike Christie Reviewed-by: John Garry Reviewed-by: Bart Van Assche --- drivers/scsi/sd.c | 80 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 26 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 47dafe6b8a66..4032db01cb63 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -664,6 +664,9 @@ static int sd_sec_submit(void *data, u16 spsp, u8 secp, void *buffer, struct scsi_disk *sdkp = data; struct scsi_device *sdev = sdkp->device; u8 cdb[12] = { 0, }; + const struct scsi_exec_args exec_args = { + .req_flags = BLK_MQ_REQ_PM, + }; int ret; cdb[0] = send ? SECURITY_PROTOCOL_OUT : SECURITY_PROTOCOL_IN; @@ -671,9 +674,9 @@ 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_execute_args(sdev, cdb, send ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN, + buffer, len, SD_TIMEOUT, sdkp->max_retries, + exec_args); return ret <= 0 ? ret : -EIO; } #endif /* CONFIG_BLK_SED_OPAL */ @@ -1583,6 +1586,9 @@ static int sd_sync_cache(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr) const int timeout = sdp->request_queue->rq_timeout * SD_FLUSH_TIMEOUT_MULTIPLIER; struct scsi_sense_hdr my_sshdr; + struct scsi_exec_args exec_args = { + .req_flags = BLK_MQ_REQ_PM, + }; if (!scsi_device_online(sdp)) return -ENODEV; @@ -1590,6 +1596,7 @@ static int sd_sync_cache(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr) /* caller might not be interested in sense, but we need it */ if (!sshdr) sshdr = &my_sshdr; + exec_args.sshdr = sshdr; for (retries = 3; retries > 0; --retries) { unsigned char cmd[16] = { 0 }; @@ -1602,8 +1609,8 @@ 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_execute_args(sdp, cmd, REQ_OP_DRV_IN, NULL, 0, + timeout, sdkp->max_retries, exec_args); if (res == 0) break; } @@ -1745,6 +1752,9 @@ static int sd_pr_command(struct block_device *bdev, u8 sa, struct scsi_disk *sdkp = scsi_disk(bdev->bd_disk); struct scsi_device *sdev = sdkp->device; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; int result; u8 cmd[16] = { 0, }; u8 data[24] = { 0, }; @@ -1758,8 +1768,9 @@ 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_execute_args(sdev, cmd, REQ_OP_DRV_OUT, &data, + sizeof(data), SD_TIMEOUT, sdkp->max_retries, + exec_args); if (scsi_status_is_check_condition(result) && scsi_sense_valid(&sshdr)) { @@ -2088,6 +2099,9 @@ sd_spinup_disk(struct scsi_disk *sdkp) int retries, spintime; unsigned int the_result; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; int sense_valid = 0; spintime = 0; @@ -2103,10 +2117,11 @@ 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_execute_args(sdkp->device, cmd, + REQ_OP_DRV_IN, NULL, 0, + SD_TIMEOUT, + sdkp->max_retries, + exec_args); /* * If the drive has indicated to us that it @@ -2163,10 +2178,10 @@ 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_execute_args(sdkp->device, cmd, + REQ_OP_DRV_IN, NULL, 0, + SD_TIMEOUT, sdkp->max_retries, + exec_args); spintime_expire = jiffies + 100 * HZ; spintime = 1; } @@ -2296,6 +2311,9 @@ static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp, { unsigned char cmd[16]; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; int sense_valid = 0; int the_result; int retries = 3, reset_retries = READ_CAPACITY_RETRIES_ON_RESET; @@ -2313,9 +2331,9 @@ 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_execute_args(sdp, cmd, REQ_OP_DRV_IN, + buffer, RC16_LEN, SD_TIMEOUT, + sdkp->max_retries, exec_args); if (media_not_present(sdkp, &sshdr)) return -ENODEV; @@ -2387,6 +2405,9 @@ static int read_capacity_10(struct scsi_disk *sdkp, struct scsi_device *sdp, { unsigned char cmd[16]; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; int sense_valid = 0; int the_result; int retries = 3, reset_retries = READ_CAPACITY_RETRIES_ON_RESET; @@ -2398,9 +2419,9 @@ 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_execute_args(sdp, cmd, REQ_OP_DRV_IN, buffer, + 8, SD_TIMEOUT, sdkp->max_retries, + exec_args); if (media_not_present(sdkp, &sshdr)) return -ENODEV; @@ -3637,6 +3658,10 @@ static int sd_start_stop_device(struct scsi_disk *sdkp, int start) { unsigned char cmd[6] = { START_STOP }; /* START_VALID */ struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + .req_flags = BLK_MQ_REQ_PM, + }; struct scsi_device *sdp = sdkp->device; int res; @@ -3649,8 +3674,8 @@ 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_execute_args(sdp, cmd, REQ_OP_DRV_IN, NULL, 0, SD_TIMEOUT, + sdkp->max_retries, exec_args); if (res) { sd_print_result(sdkp, "Start/Stop Unit failed", res); if (res > 0 && scsi_sense_valid(&sshdr)) { @@ -3790,10 +3815,13 @@ static int sd_resume_runtime(struct device *dev) if (sdp->ignore_media_change) { /* clear the device's sense data */ static const u8 cmd[10] = { REQUEST_SENSE }; + const struct scsi_exec_args exec_args = { + .req_flags = BLK_MQ_REQ_PM, + }; - if (scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, - NULL, sdp->request_queue->rq_timeout, 1, 0, - RQF_PM, NULL)) + if (scsi_execute_args(sdp, cmd, REQ_OP_DRV_IN, NULL, 0, + sdp->request_queue->rq_timeout, 1, + exec_args)) sd_printk(KERN_NOTICE, sdkp, "Failed to clear sense data\n"); } From patchwork Fri Dec 9 06:13: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: 633178 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 216A0C4332F for ; Fri, 9 Dec 2022 06:14:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229825AbiLIGOZ (ORCPT ); Fri, 9 Dec 2022 01:14:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229769AbiLIGOO (ORCPT ); Fri, 9 Dec 2022 01:14:14 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E96C9D2FD for ; Thu, 8 Dec 2022 22:13:57 -0800 (PST) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B94VNMW010492; Fri, 9 Dec 2022 06:13:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=Kqo/c/FavKW89TINXx92/bxcE1yI27TngkykaycrckE=; b=snhk2Gghx2+6V+y9Izog1HocY6wFD/O4wN6qwcLwPK8QlQlF7m/sdUfB098wkRXyZrH3 MXn0Rqr0DX/2rgVYIRj2KdMCvapBj//hIiWKv3pHwtOJag8NFfbpucoPg7L5BXYkNdrK E9jgQi/KV3xOB8fc7JcrDF3QBfEbdAn47TSaeeEytaobZpcWusqJw7kOTdxFIvt3x4PC 6ML1pzoLnEXoPuKl7cHAVTVlQd25WcaUYireXLOBSTleFabo5RQu3tXsLeGXRbF3UJvq 1w40pXu7tYBct2iTdKALKYz6nmye7BhyNQoggG0jyn137MRto1dTSu58RGA5yFqIVUBb dg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mauduvcph-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:49 +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 2B93K3f8008472; Fri, 9 Dec 2022 06:13:48 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2169.outbound.protection.outlook.com [104.47.55.169]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3maa61ymrv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V5baIM/WQBLZukcWT7LmCWfyxap85hdNy2P3rihPcUtazAhcqdGPyJkD4sx3a6QfCnZrDdCU9jWTik4grlRpQlI04hHrqBRXpaS19jJZaleJBzPUYbTE8Z3NUPPMJ00Zkjp705A2SqRfbsRt6egcLzoexUapEYy4Ga6cofHna+6f0XLgLGKGB43ZOtalQxVPWiidlodnLSWe9wqiLshcJCfXYEd4UeMP8jjDhnSl/Wx+OP+GFnroMNJiXfEAtnQKT1/qgnJ4NAPB6mKxht4x9+MRQql7hboJSXWGwh5ziyPCETYThJw7ScpObtSf8Q4bvgQbfwazfn+vy59A5A6x4Q== 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=Kqo/c/FavKW89TINXx92/bxcE1yI27TngkykaycrckE=; b=lscGsTURhZjU73aeOqfh4XNV0pRKMzw23WQUy0pYpSeVJbipQWr/ydfn4q06ESVXNmYLjV85xquhBgptBycWMzuE6Rvod/aPwp2zEjHk4AmxqVZSt3A5alTgm7urhyp1vYsRw3A81bNYU1oXvsiHy1U741tZF+3AbFHKJbm5HccpQwJ4Cgyey5kJcUPsvVe3wmjwjdixUOlL/tAUu6iWldPNxCmBVA2Taq5XLlZnnFOvwkMkhnNm15AFws5KqvcVrnNWawChs9DGc1fLlO7P8q+ESCdFfDPxXysGSg3CjxAsMTYNMazV6Cb7FNyGoBk/bkUKeWuONy1bl71wxEbgfg== 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=Kqo/c/FavKW89TINXx92/bxcE1yI27TngkykaycrckE=; b=lK/QgN1kC+J66d+kvY2nrE+iTfSHat1YuyL1HFL7ja5VFsccaDYFiP2g0nz9yCQ9cxRMPwHeXc85J/LEKSVVvclK1LIWQN2AoWK+bBmYAiUI3vZF6nzW6XxuvVCYPgBosj3Xz3+ncqbnHRVlDm/lzQqEcnpRhX8pDZoUuJ+o0Rc= Received: from CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) by CH0PR10MB5066.namprd10.prod.outlook.com (2603:10b6:610:c4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.18; Fri, 9 Dec 2022 06:13:47 +0000 Received: from CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99]) by CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99%6]) with mapi id 15.20.5880.016; Fri, 9 Dec 2022 06:13:47 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 09/15] scsi: zbc: Convert to scsi_execute_args Date: Fri, 9 Dec 2022 00:13:19 -0600 Message-Id: <20221209061325.705999-10-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209061325.705999-1-michael.christie@oracle.com> References: <20221209061325.705999-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR04CA0044.namprd04.prod.outlook.com (2603:10b6:610:77::19) To CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR10MB1463:EE_|CH0PR10MB5066:EE_ X-MS-Office365-Filtering-Correlation-Id: 653f3f1b-a670-4461-5476-08dad9ac883e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0Rw7W99gmPwKTC6e17NLTrinuJUrNpUIjcwhkE5uu8loCRX3KUS9//EuSVl7BEipOiUUnhPzuUfWGeYL9VwkT6NKY9n9MT16F0aFh9CUYK6wxJ4nuZI36HEYcjiDUq7YDnsC5gnlZJAyU166YN78ksOjougYB4RqARA7rvhbv5BxDairWTO+dYj+lAm1PeR58n3hsCYcnUskFfHxCt+dx2Dz3MzRahQb78LPYnAAIy376x2/mV/eIN85y2kcrv1L3Cgi3dZzOlwGNq+ERvWNDuIyB//RkMP2wNU7sq0btCGDANtoin+G/YaJujx9Ad6BTrQc3pUHuCjriWiObAsmcIfqRdC7/mfLPOUv7CiB0tfYR3h8Qn6iT92xA/Nc03z8NF1RlV7K9qMI819JKNK7qFkChpVXsv+++I/b8CKBZ8iLMyOQQ6wVIOFp/p4b3SK95M8MuYnCAMbb5/VjUW15jVxqvH3uBJNgaJMu9dRopeGTBl16Up+armoGUnfkGwjYtyz/KzPUnFVhz93r0/D3OLjIMr2H3TFAq1k9xO5OM5YDOGFkusYE5q4nCTvvG3CKMpdwyxaHJX9LNi5Un3SPFJ+dR0M2Da4XXzPhNrLzrMgpseUg6aBQKG7CwoNI0i8Va5/NvPjYzJTvQ/Q2MBTpqQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR10MB1463.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(396003)(39860400002)(136003)(366004)(346002)(451199015)(478600001)(6512007)(26005)(2906002)(36756003)(6506007)(6666004)(107886003)(41300700001)(86362001)(8676002)(66556008)(66946007)(66476007)(4326008)(316002)(5660300002)(38100700002)(8936002)(6486002)(2616005)(83380400001)(1076003)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 16JgnBAqeykidzDk0D617sPquClwVbun+5BVadSuiuZFRUfdQZRuxE7KcRxRO+k57ym+7wH1UmiZy8LtQzj2GlRw5Ii0iCsodE8PD1Vi0SgivXTJALk45IeaQFP/oSuqLLlqWHstC+RdNNfc2+G5ahHQFootTIZ4Uis3OfmBxCiKhv+qU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TBWcalVnYH6nuQkBfk+TQUE9AAXY8+cdcToYbmIi7NL0omnUQ4h9gIBXbbCfsi/sBEYe0wW9IYawMFfjkZL93iKSzG+sHi4rkZwlKSJii0XgwudUs0QGg7+mkr28IiCdsHwS7gRKbFd9zFu9+10SZ9IcmlO6nnJpJ6kTJx3QI1S6nHMtDySDT5FOwXh/QL7EsHn6rngaznM7nNjsxDlMK/rFlBBMplMBJrBUOaSb4dZUwtuchfZeKxvUmuA4n0wDDD2xMWqzs23Nck0qQlqnYJR+6v2Zic4RIZL8Q2us+GK0c0s2JD48fVUbRzJE5gYZ7AmZOu47nFqbFQ7lYvlfvJm70Wkp65Lpaukw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 653f3f1b-a670-4461-5476-08dad9ac883e X-MS-Exchange-CrossTenant-AuthSource: CY4PR10MB1463.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2022 06:13:47.1766 (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: JqkFsi9QXQ9cqTbaAMq44kyLPXk2R0uwx+W3pqxxrcRNI10D2U3Sp8IJJz0ChJeXaZjHBjf3KFgn+GjbS+b0wRGWhwLoLfZngi0YkuztKfA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5066 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-09_02,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 phishscore=0 spamscore=0 bulkscore=0 mlxscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090053 X-Proofpoint-ORIG-GUID: jN9bbEPr9JgkUDIa8xxzWF8-u4cS_eNJ X-Proofpoint-GUID: jN9bbEPr9JgkUDIa8xxzWF8-u4cS_eNJ Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute_req is going to be removed. Conver zbc to scsi_execute_cmd. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche --- drivers/scsi/sd_zbc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c index 62abebbaf2e7..2a7c352343be 100644 --- a/drivers/scsi/sd_zbc.c +++ b/drivers/scsi/sd_zbc.c @@ -148,6 +148,9 @@ static int sd_zbc_do_report_zones(struct scsi_disk *sdkp, unsigned char *buf, struct scsi_device *sdp = sdkp->device; const int timeout = sdp->request_queue->rq_timeout; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; unsigned char cmd[16]; unsigned int rep_len; int result; @@ -160,9 +163,8 @@ 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_execute_args(sdp, cmd, REQ_OP_DRV_IN, buf, buflen, + timeout, SD_MAX_RETRIES, exec_args); if (result) { sd_printk(KERN_ERR, sdkp, "REPORT ZONES start lba %llu failed\n", lba); From patchwork Fri Dec 9 06:13: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: 633175 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 336B4C4332F for ; Fri, 9 Dec 2022 06:16:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229851AbiLIGQ0 (ORCPT ); Fri, 9 Dec 2022 01:16:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbiLIGQC (ORCPT ); Fri, 9 Dec 2022 01:16:02 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B5D8A431B for ; Thu, 8 Dec 2022 22:16:01 -0800 (PST) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B8MIknF028591; Fri, 9 Dec 2022 06:13:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=0qp+CJ31+UjcgAmjHqUQtuxTKxcZib61pZWKBWl64HQ=; b=Q4biHWCEADaeNVLnLicNNfdabhQPKTDRsnayn+qjYJDMWvzK8WRtLXPpCQoXfQ1WY2jL oQLW9eKt593qsYKVkvzwLWhOgqDqhO/r/NHevZM3CxFFHywModkLHHeAXZn933M6AIqE 1GX47rw77LutlFrWLr7NHpXvGHgaV+U8rP8fH0L/Lpr2JisZxS6ToffjWB1DPUJsIQnQ 72wRc+iS34scY7NXf+NEz2ptEOrxqjo+C5qMYq5zoTSchUjSq4R1MpwPxw8czAKba3su Ml11KmFw+xxGtRlWOnzTJaLEPtHWwaAFta7CImx4oxbQv1TVT2EnORsdsE17YcQ0+doS iA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mauf8mcpr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:51 +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 2B930jFl008326; Fri, 9 Dec 2022 06:13:50 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2170.outbound.protection.outlook.com [104.47.55.170]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3maa61ymsq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OYTBoOMh5D6QcWnUFFjeO3ug7Uk7fqgSdHqC1FpNMkoKFxvUSqAuWWwNWYF57Zxv5yk8PVyJ4rvyDU7jgcLkHLqgVAcmeNcqHn2l67HiFI+xUXWtVvpJNxX2yVBMXc6X0kQ+QVuLvAGPnTGK7Q9YdZNOWMayfLvVcq7+qG2d4NDUnwakKe8hR733BxsSDqMEiYWPeodSzAbuj/pu8p8TSvHcWQrMz5L6c0C0YMc66S1vFB91gVFUUmk59BpA0C5v7uj/7y/wFGyes4yUC1eQgHMLGvTkLfwjnPzcKBdUppiCtLeMSVmb2FvMuOqAdrwIE/UVQZP0Iadi9oxJ8zQi8Q== 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=0qp+CJ31+UjcgAmjHqUQtuxTKxcZib61pZWKBWl64HQ=; b=i2RPj+gBI72U/GE1+6U8+6yAN/L9eQqgvSsBGNOyZsFXvAbY+ZgEzeHZGzOmogwVO0ybonSQ+6QUh2tJDWyup1kJER2sqmTgFuAoWMXZjbMIj6/EoSwRc/md5t4k+xjDZsigao3aGRauqwEVYSpsUFi6FnSmat5Z3BSLmqlrbXaEiIiBejrXbDPyGaaM98noArJLpxhTPAQwiWBVrX7A0khMk432V4NB4IkpgR+8lqu/TKn3iuegA7N9UfJQ0829leWNXniN1apoc8x/AM6yO3nCRLfi3rwgt7RtvjQVqk5DVPkQpf9UkPu6G8tFVHDcoTCIRLwK6eFc3WIgcXVhWw== 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=0qp+CJ31+UjcgAmjHqUQtuxTKxcZib61pZWKBWl64HQ=; b=EIC/pjPAZ9NTZajjx/zKXM82TUQXbToiewQ3u3x/BJREUH0q71lQS5vEzsVoaAiLTAUO9xfO0QDZAICc02c0/VhQhGLh5HMzf83hSYPc8YtdFtQaBnto0KohGLWVIu1LKMoomWXoxBJzOzGbiF17cmIMbWXumm5rRgsMCPBKmUw= Received: from CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) by CH0PR10MB5066.namprd10.prod.outlook.com (2603:10b6:610:c4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.18; Fri, 9 Dec 2022 06:13:49 +0000 Received: from CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99]) by CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99%6]) with mapi id 15.20.5880.016; Fri, 9 Dec 2022 06:13:49 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 10/15] scsi: ses: Convert to scsi_execute_args Date: Fri, 9 Dec 2022 00:13:20 -0600 Message-Id: <20221209061325.705999-11-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209061325.705999-1-michael.christie@oracle.com> References: <20221209061325.705999-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR04CA0054.namprd04.prod.outlook.com (2603:10b6:610:77::29) To CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR10MB1463:EE_|CH0PR10MB5066:EE_ X-MS-Office365-Filtering-Correlation-Id: 7c86e3f1-4b13-4e33-7d37-08dad9ac8950 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QJrWoy5XGAg/hXyHpv8CNW7dwWeqPeiqjzdIUD8fr/IjAubGwFUyoCXVByl3yhnMBB9u93npUhv3+1Kd2idWPkrG1SlChRmepu2k6bFSx75tMnOrhxjeGzUPGb3b4oK13e+jSIuTq6gFgriJxnIg7yUcsB2QurEXWGqFuG09kJ+gGcJwvP5wRDAi/Spsgdtm2ldIIHtp0XzjdGhhv5jwIlv7/aJtzREPbkv3nZfQFnBpHQkQSnq0JEB/Vqr7tgxPE1NpbWnmPImskil0ZRrDxf9fcZPpYRm2+3WNcdX8NIOqJ43xfa1w4R8SnYlS3xPLk+SinT0VkzPZFSiM3ZY16aeSNGhRU48wusMeMG3AbG7naNr58WIZ/cXfexZvfLGvshDfd8oo0EhO7o15pA+c+fKXu77jOGLe04r1zVzKOyKJUQPkucRit3TacIvQHlcF0rEYVh396hvAFM0wqnuL9+JJ76b/CjPtzWK05oHE/q1CP2Js4HIEQY1O52tueg4ZDyxxctACSdWj2tYQXrlEjDXkyXmVA8ZtqMH31jfkKQyKr/gbws1RUE7ke8kgaIekGiw7AvnKd3KkmUA+ekOakyHAex0cPWiP3nsD/zybjzjRybkPVbd+D02+pgC2/7krjWPf6mnSl5e26f4ivN0JkA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR10MB1463.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(396003)(39860400002)(136003)(366004)(346002)(451199015)(478600001)(6512007)(26005)(2906002)(36756003)(6506007)(6666004)(107886003)(41300700001)(86362001)(8676002)(66556008)(66946007)(66476007)(4326008)(316002)(5660300002)(38100700002)(8936002)(6486002)(2616005)(83380400001)(1076003)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ytce5ggO7Kyw0XdUpnSiHb+ADBOUAZYiI5BXWRcXkZTkYobZp6K075rf8KsqL+vpHaG8ZW99lKU47r2IEMdJHISEhn0O1zB79skG2vY2Wv1bYwShXFiRNCILC/rjTJxuRquHldoDyK6stLF7W6hSuGFnNByoqPLKYvY8RXyPFdgZvG6aTtOfsAZY9Ted5+zV/RSQ55eJOoC/GD+HivUZsudG5+PsXrgwK7YToGxY3jN8NkrT76ujLfiGlEYhCYs7mEiuSki3Vm1vt0aO52Imx5ctMmi0g/ODV50h250qZcTfRMV0cN9ZICA1MezB24jMpJc7lVUSobWolcPvFQNXiBxhgIvb5ymvhSPJTjLgIhX0S15TUzXVFP54kUMJ8SB+7WzXI1mICcpVob8bUaI8tcR1ewBtkwSABKxpWTkWZbCbWTKyjiWfVaYsQDtBRE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Y1OF4C5FHBYWD/aOa0GpxQHlV0Q/V5Sr3hWEIR1mXfnMXcN14b5P7NEQF/NkOBESeq73aRCRd2CgpY5ORVTkFtXjtEudQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c86e3f1-4b13-4e33-7d37-08dad9ac8950 X-MS-Exchange-CrossTenant-AuthSource: CY4PR10MB1463.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2022 06:13:48.9577 (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: 5V2izUZhhCr+gexee4UBNpL8osarRtrC9yjPjVj1ljs+NXt2sFeLdFe+BRTxJkSOyHCw7NngTSJCgGFl+1SajJuFBPzW9lfr2AfKfs/fIEg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5066 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-09_02,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 phishscore=0 spamscore=0 bulkscore=0 mlxscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090053 X-Proofpoint-ORIG-GUID: 5JCdbPyvsJF_BGcvRTuZ4X4Etz5nceYB X-Proofpoint-GUID: 5JCdbPyvsJF_BGcvRTuZ4X4Etz5nceYB Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute_req is going to be removed. Convert ses to scsi_execute_args. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche --- drivers/scsi/ses.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c index 0a1734f34587..7f944bbdbf61 100644 --- a/drivers/scsi/ses.c +++ b/drivers/scsi/ses.c @@ -89,10 +89,13 @@ static int ses_recv_diag(struct scsi_device *sdev, int page_code, unsigned char recv_page_code; unsigned int retries = SES_RETRIES; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; do { - ret = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf, bufflen, - &sshdr, SES_TIMEOUT, 1, NULL); + ret = scsi_execute_args(sdev, cmd, REQ_OP_DRV_IN, buf, bufflen, + SES_TIMEOUT, 1, exec_args); } while (ret > 0 && --retries && scsi_sense_valid(&sshdr) && (sshdr.sense_key == NOT_READY || (sshdr.sense_key == UNIT_ATTENTION && sshdr.asc == 0x29))); @@ -130,10 +133,13 @@ static int ses_send_diag(struct scsi_device *sdev, int page_code, }; struct scsi_sense_hdr sshdr; unsigned int retries = SES_RETRIES; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; do { - result = scsi_execute_req(sdev, cmd, DMA_TO_DEVICE, buf, bufflen, - &sshdr, SES_TIMEOUT, 1, NULL); + result = scsi_execute_args(sdev, cmd, REQ_OP_DRV_OUT, buf, + bufflen, SES_TIMEOUT, 1, exec_args); } while (result > 0 && --retries && scsi_sense_valid(&sshdr) && (sshdr.sense_key == NOT_READY || (sshdr.sense_key == UNIT_ATTENTION && sshdr.asc == 0x29))); From patchwork Fri Dec 9 06:13: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: 632846 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 B1484C4167B for ; Fri, 9 Dec 2022 06:16:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229891AbiLIGQN (ORCPT ); Fri, 9 Dec 2022 01:16:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229738AbiLIGQA (ORCPT ); Fri, 9 Dec 2022 01:16:00 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B41B6A431F for ; Thu, 8 Dec 2022 22:15:59 -0800 (PST) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B94VXMq023754; Fri, 9 Dec 2022 06:13:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=AQFjWA/Y12vls0B9lqvjsWA+TXcRJujOFD5cMoLX9oo=; b=PawByA/pwfG6Bdba5aZ6r5SBDEVqbg/iS6PIDIJyv9qx6pHzQnCN21yI9JYmxJn6kJlA P1zC75N1CUkiXtMtv1bypy0Fq3VSjImY7Lix7TU35p7CszKUiv80/kyeZ4KDF9jeNKbv H06+31Ain2156qKrOYQC1+VoI6FK6vdPQ4E5ZiU6IYRPnA4v9wJkHRNOHw8eKqLS+G1f 6VdxbkYCNW0wRGnOHQez80sm6u5GDmtJcPB/FDSgvMvV/s6/OjpnpLz4XmkT1fqrA2eZ 02veyyK51bKY4DsJnSionHZEaQqbsnxoz1Zg4ItnL9j8mDpbkQNU04KNn+rlmUOTl0Cb Dg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3maujkmb8n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13: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 2B9657Wp008402; Fri, 9 Dec 2022 06:13:52 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3maa61ymtq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nRifMB9IedQ/mZ+aO38LgJIdanDBD4Ar/2Ndp6kEljTBuCfmlMioboG4o46bBf2mDKyMFNHrl4i83pxRmGfkp2dPTnSj1yHnk9r0vkLi8IjSDWWdF20AaBpC12QcL+odvTxBCD3Fyn1f8EbRI77e36n5StKTcQHrPtvLTc1wB5oTCUszveBi9+npXKgzr+Z0z/7fjW+iocblS62gLCx6KOOtMCWuLYW8IXXY1OmfxCEfqfL14OPn1hu7vrAIuxNFez/ayAgZN32zNvTLLtPhYCj0h9dTqEpGk/wRmiMV0r/kJjfaFNUf8BmZ1G85E/5/raqkwbBbsvxKkswrKWDxVQ== 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=AQFjWA/Y12vls0B9lqvjsWA+TXcRJujOFD5cMoLX9oo=; b=nwIJFrocDo7FF9h/WiKalSuioASdkeMxmsddJ3+nz0L5lm6K56eoFBEYogsvmZrGFWT0iDUDHwSNmOziiNgMs0e//KYXUbcx44S4UlaBPUcoTsxx00pckA3CHczimmlL2RBeDqNt3WyxHn0sedqx9HOsLgwdGy6Rm+E7qOAz9ZrPQaXjEdoJlGHBvo6hG/l1g8HBk8+avVg62x6L604YtFg+rKqu1ea9EkN9hxm4gHhDRNPI/VVo9t9ozBoYdZazrZmjDcplvawkZf/k/LsW1DAEBXmdH+YjY+CyTCdFzR07VVg8nLcEEA/pSCvh89pVdE3SdmqSDHPrZL+8puBpCA== 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=AQFjWA/Y12vls0B9lqvjsWA+TXcRJujOFD5cMoLX9oo=; b=E9YkYhi7UPgiWAk96Y5paO6COiSBVz850w2GHFJatKiDSRrZ4xWwEYSxYW6F//zaSO+YNz/tYmjJM9AkNOUGMwoR1Dn7C2ErtxRgGS9QUESOmFAgYf+wmcvhSeZ3ctkSGGYubrLUSvAUe09f8HgulvhE8G6gUJHkbNhKx2BxAms= Received: from CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) by CH0PR10MB5066.namprd10.prod.outlook.com (2603:10b6:610:c4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.18; Fri, 9 Dec 2022 06:13:50 +0000 Received: from CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99]) by CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99%6]) with mapi id 15.20.5880.016; Fri, 9 Dec 2022 06:13:50 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 11/15] scsi: sr: Convert to scsi_execute_args/cmd Date: Fri, 9 Dec 2022 00:13:21 -0600 Message-Id: <20221209061325.705999-12-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209061325.705999-1-michael.christie@oracle.com> References: <20221209061325.705999-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR04CA0051.namprd04.prod.outlook.com (2603:10b6:610:77::26) To CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR10MB1463:EE_|CH0PR10MB5066:EE_ X-MS-Office365-Filtering-Correlation-Id: 852b83d0-a1c9-4628-43aa-08dad9ac8a60 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sfDEIDWgfYTi40sNM3zM6da9TZYIdNOhLpaCLR4pOJfXBkgCLdmNLELhIMIAPNaHE/0OvCu9jTdAkIY8l4+Jd4CnmF3iOiEQn4HT9hGP+XKuZBs+uAJIFDmxolr245dCtPypHn1Au5NjeObp2lqLub3mNNIJQOpQ+HBVWCxwNtja4mJ8CkUbP8YE66NWhKOPsI9A9a2r8YDmNKfVEzQ+dWxxlqc3RkOoMUTMM9Iw1qTDJYiqHt9QQVbBPtuRuCNX9qZWD1rUUncBIr8bJbtQMmuPXRWO7Xhynk8eNi21KSpsACfKPBgJc1yjS40E2dVKIeFGaBhAGbLbjdIoSS+SZ+1dVUjTglQKhJ8pH10m3zckQS96uNHs8Qn5P3siE51+mZQo5Lbj53e6hEVr8526M/MrdNNIvEqwwFhcY1vrFQfHbJq3h3Ya9ltj1Ih/2D7IXm/RlERP6ooOTyouf3L9OCz8WBBDpug7DeHuGdhLQOo5iboh8IM7PrW5U07HLHwLxwqA/jmDWs1uEUSOdE2mek5Vo+bgUQwmEkYftXsMFG+YKmPrkYMQOEaVDTEAofTEI0vfHvlsrJShT16BnvFOIg8sQWPPxtd3FVLy8CLOXv0VMaNfsmNqcHhm7RrW/51IVsYtnMCLJ8i5wdGQSwixmw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR10MB1463.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(396003)(39860400002)(136003)(366004)(346002)(451199015)(478600001)(6512007)(26005)(2906002)(36756003)(6506007)(6666004)(107886003)(41300700001)(86362001)(8676002)(66556008)(66946007)(66476007)(4326008)(316002)(5660300002)(38100700002)(8936002)(6486002)(2616005)(83380400001)(1076003)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DqshLlaxwQK0SdCVtD75ckp5C5OxX2b3sLReU+g9kTAmtNr7MgN8SPlFcfzpdqavjF28M/TRhhtT9h0CFxDxyhX9eKNzv3UvbxHVox2rXa3RrgRiQv1J1bW1NegIzWMw3zrllZKilDmeHgiwyjigfoBysC9ohyvWSXaPP/L24y106o4vaDVzuifMk0Z0DmhpoC/+VgUagpkOAQ3Y6uKWVrNmplkvE4adaBj9wjHhmQUZmzn+7BqXPPTItY746RJ+yvAp3lWY0mI2lXlZR7AzkJlhc683K9LKXSBN4aSzukxT7whxr8rPC8QZuzwu9DhrQ2jHQN0FXiK+PmE+cilUKqxoPYoOkcJKPT3Jj6DSWJVbRi7SMyRFkVB0gORYfv7l2pKEFmoQ7DbLFAfQC1MdGoYZjKjVBI+DZqu44gkjQIKwA/d2GsLDG34GNOd0DrYjNy0KmPEz7Yzj6p76IG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NW5QFaAEyHI7pVUYDMbbZdoAKxP0Od6dr7arbqmP33dhLbm5q/qNQv32dL5qJr/ufeeoX80BQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 852b83d0-a1c9-4628-43aa-08dad9ac8a60 X-MS-Exchange-CrossTenant-AuthSource: CY4PR10MB1463.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2022 06:13:50.7232 (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: Y/4XUfXl2Y2l92ixCNS6mqCwkVAyBOU2YS+/gbmbAp2PSWFvFfRMmtRQMfMWDGLJb3I71Brm9iCqqWZZWPJzv/QnX04wGFMPrqJn3CR7HLw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5066 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-09_02,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 phishscore=0 spamscore=0 bulkscore=0 mlxscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090053 X-Proofpoint-ORIG-GUID: AbY0zVpo5XukGfBe1KpN_jxDahdMHFya X-Proofpoint-GUID: AbY0zVpo5XukGfBe1KpN_jxDahdMHFya Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is going to be removed. Convert sr to scsi_execute_args/cmd. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche --- drivers/scsi/sr.c | 13 ++++++++----- drivers/scsi/sr_ioctl.c | 11 +++++++---- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index a278b739d0c5..bcaf0701c120 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -170,10 +170,13 @@ static unsigned int sr_get_events(struct scsi_device *sdev) struct event_header *eh = (void *)buf; struct media_event_desc *med = (void *)(buf + 4); struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; int result; - result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf, sizeof(buf), - &sshdr, SR_TIMEOUT, MAX_RETRIES, NULL); + result = scsi_execute_args(sdev, cmd, REQ_OP_DRV_IN, buf, sizeof(buf), + SR_TIMEOUT, MAX_RETRIES, exec_args); if (scsi_sense_valid(&sshdr) && sshdr.sense_key == UNIT_ATTENTION) return DISK_EVENT_MEDIA_CHANGE; @@ -730,9 +733,9 @@ 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_execute_cmd(cd->device, cmd, REQ_OP_DRV_IN, + buffer, sizeof(buffer), + SR_TIMEOUT, MAX_RETRIES); retries--; diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c index fbdb5124d7f7..3d65c4eb70a4 100644 --- a/drivers/scsi/sr_ioctl.c +++ b/drivers/scsi/sr_ioctl.c @@ -190,11 +190,13 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc) struct scsi_device *SDev; struct scsi_sense_hdr local_sshdr, *sshdr = &local_sshdr; int result, err = 0, retries = 0; + struct scsi_exec_args exec_args = {}; SDev = cd->device; if (cgc->sshdr) sshdr = cgc->sshdr; + exec_args.sshdr = sshdr; retry: if (!scsi_block_when_processing_errors(SDev)) { @@ -202,10 +204,11 @@ 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_execute_args(SDev, cgc->cmd, + cgc->data_direction == DMA_TO_DEVICE ? + REQ_OP_DRV_OUT : REQ_OP_DRV_IN, cgc->buffer, + cgc->buflen, cgc->timeout, IOCTL_RETRIES, + exec_args); /* Minimal error checking. Ignore cases we know about, and report the rest. */ if (result < 0) { err = result; From patchwork Fri Dec 9 06:13:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 632845 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 6286EC4332F for ; Fri, 9 Dec 2022 06:16:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229853AbiLIGQ2 (ORCPT ); Fri, 9 Dec 2022 01:16:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229875AbiLIGQF (ORCPT ); Fri, 9 Dec 2022 01:16:05 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20F72A0F81 for ; Thu, 8 Dec 2022 22:16:04 -0800 (PST) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B94VB3s010444; Fri, 9 Dec 2022 06:13: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=Lb01574jtmHeVeOjj3W5NsK3bd2px03I5bVsWBgP/hU=; b=UaelrfNjNBSRqpTfHwcIWSQAu4bTV7pyMX98eACGqw3kWNpat6rQT6zXc4L5JAZlkUOU n2qNbMK8F83CBuZVOL63NXb5RHM0owGy+hYZ3z0YAHEdkytmaFnkHywVXbW12U6lsZ8d tocFE+bpAPCR8j9cuHaUzRE3V1avE+sHCBRMyEtWMjYP1/FZMI1fw6nFhErJOjVNULNY StywHDWNe1etoyxZ2eOw6PFQ4vYrCvvvykxb7L8YJo4v/O6uNFe0qMyBv8VQtr5PPaIk j8kGlQnb6K1hy/ZRHvqS3iyId1jSKQwfq7ucTiOi5dYVvy3UUfX28v5YR2ZbOjpnu8n8 nA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mauduvcpr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:56 +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 2B93pomV019651; Fri, 9 Dec 2022 06:13:55 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2169.outbound.protection.outlook.com [104.47.55.169]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3maa8jwbnm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JUvIlWz2DLjU9fgjn7K1Esfw6YpVsEp38wmOoZ8s4xerqaU/9utNicxkIYsTtnC4GPxjdL63RMYHDaMGMK4o88Uug+Ryh68wdeyTIB0mkhY1SsNALG0PCQR5VOcCJHGjnN7LljLv+4zZBDJLE0YzcmmO/ma8L9HUf6ES0o7JO8T4yTviWU820liEsn/tcC6NL75g3vFjxRQ5BXFBT25SxYx7U51UB2zB0440g3qeF1/fS311pr4MX9undgIqjX64OikZ2UrBViDvW0nNzCBBV5lvs5QjNSjqcz7pgtLZtHmUJtIF76HFGX4WkxZEDgUyxectUJlP49+SilXhco2vfg== 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=Lb01574jtmHeVeOjj3W5NsK3bd2px03I5bVsWBgP/hU=; b=E3axdOC2xOaPMEGWxRrL4VM4iv8VAfwpw47npa+aCVTwfRMK5vS1EpKxXARx4LerONVUrx1vGeI1Oy0Hmai41Enj0UfLINMLWNq7gFkvVQW6M/7zNyqHraJQsN5X04Hmk17P02mIQNd1qCvYayoTS7gphW0cXfHwA/TlH4YuywQRw19kC78fnp7mZsXDcFhroV3FMSZ4/UYomKWM2RIWQWrEwmYM4wvg2y0CbIbDQlDIWLpkNCbHIGTCACKTbq5ZseQFLs7LIWQaBEdlzYjK09YKxhYYfe+/NQPm6rFiFIwDslvuzGw5SS5DJdhwWOomWdb5YEa2SRq4+C1EisM5QQ== 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=Lb01574jtmHeVeOjj3W5NsK3bd2px03I5bVsWBgP/hU=; b=yvTTuxhT0fOVfDU9fljwSXuszqSmDd9b/JJZg1sPdvCV9JVwAKwemgJLjsCgAASbCI37J1NkSCJEpU020VMenziIw6ehndW3Lso5KDBri8Nvv5q1t+uGS7kSqLp3NO1193L6vkaN9r8ybzgHn3JtQFnqoHVcm11ud3635DyxFPE= Received: from CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) by CH0PR10MB5066.namprd10.prod.outlook.com (2603:10b6:610:c4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.18; Fri, 9 Dec 2022 06:13:53 +0000 Received: from CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99]) by CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99%6]) with mapi id 15.20.5880.016; Fri, 9 Dec 2022 06:13:53 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 12/15] scsi: virtio_scsi: Convert to scsi_execute_cmd Date: Fri, 9 Dec 2022 00:13:22 -0600 Message-Id: <20221209061325.705999-13-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209061325.705999-1-michael.christie@oracle.com> References: <20221209061325.705999-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR18CA0010.namprd18.prod.outlook.com (2603:10b6:610:4f::20) To CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR10MB1463:EE_|CH0PR10MB5066:EE_ X-MS-Office365-Filtering-Correlation-Id: a0b8c25b-8b8e-4891-f5a6-08dad9ac8b7b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a4ZUY/1P8TM/2hx8x89AKDi8lLZ3ul2JE5xjsBgvEpg9MCh8k3BinVnpQchYIo2cTfz0ayRvnjyW29uQopSdyqrnY5AF9TmfSbNUM4qT0S++N2tjHuh4+ZBh7V1pEpecGuqV13Ok1v+hDawWRyElLLs6RCw+nDmvBN9JY6Xijs/RuavvVv8Pk8x2qvCpiVNMl8uste8HfH0xvNjhYojVM76pgNjx6bdH80wCTkiyYlSbPsxrluEXd9jkbKArStXlA8UdV2H4xZdz/5l4KWavkfGW9aHf1gbt/q83/iBU5uQo7PptPqjxR7dOyBSlf6t+58ztOHgpHePyZguRC6mkXd4Aj8cmrGdLds0qDkxTCo8qDTLz04+Rkr4RQ1P8MgoccNfGiu4iCEi6v1JQTruzogrSi3twowmDur5/TQoI8dy0fasf3JZBlofMMvCvtryjm59I7OaLHGTJ0oVN63FINi/U6aQcPrj8FTTeJ4EbUliQZzAlxZ3nQb319/IWTRKqA8ruBI8PkiFyKZ3RIsQ0KHGJtHMaQU10CSiMD4uw0e5bHYU2DpBxRHCd6nI+dEOCGuo+5KjmOG4DqTFSCun/f1CDnEeQNj3oQDU8i9qKT6h6s0/mh9UDsLRki9tCXYlZ8mCPktzZNaAWiqM+bc3KNA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR10MB1463.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(396003)(39860400002)(136003)(366004)(346002)(451199015)(4744005)(478600001)(6512007)(26005)(2906002)(36756003)(6506007)(6666004)(107886003)(41300700001)(86362001)(8676002)(66556008)(66946007)(66476007)(4326008)(316002)(5660300002)(38100700002)(8936002)(6486002)(2616005)(83380400001)(1076003)(186003); DIR:OU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RnZ62T1VCDxJM2IIfA8U69W1876A6xYlfyYPWrvSPzNjPD1RTjlCblnSJMygLr+TDWWirJsRfM4SQMz0qWEN1r9tsqtc2NIFg4hkV04HaJwj7IhfBhfUPV4mWZ1q2bddnlP8Vqhp7KXOTSh5hmOhGH6/yGo8VdvLcBFvnt42tLGkSHCUM5jGS5JkabUqYKSOHCY0rYseSZtFfaPR3Da3k5EbUla14gCiDO+kmgOJG7hO3ijeBB8svGkJPzTFqBPg18vm0a0juWJTP9KcEqp2xN8cAl8wWvLYF/QEMQuSrsi3TzOmeOO6MZ4Q+0MtTirwgOJgOxsvTfEssfsYpwQc/bxso0DUneUq61wbjoYDFshxFgxPqggK2bgQ7TxHu3rQ1sydRycTXWCVdsoQxxHjUwx231J6J9XrxGVJRkPE+dBHxjJUPyN7YnZPLH+SsvAdNuIb1ROeBHbOwoq11dDsMwn6XYxMfEZvy/d1VLTyt6NSMFT9Q5JE4hcqKt3q5v0tINE++gB2RpqeuiiF6vyM1SMzzEsIFz1YBO9Uqd/JPWgsj8V3JJ6qq4UzQq2Pw/bCRD5uYK3P2iQus29vaSmVXRzJCLHx/82A1u4twR/vISdqKG73KQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a0b8c25b-8b8e-4891-f5a6-08dad9ac8b7b X-MS-Exchange-CrossTenant-AuthSource: CY4PR10MB1463.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2022 06:13:52.6292 (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: Vm1sC+CjG+hL4wzGkUo5II4hYxaPpX/A0IerN+XR93so+9nSBqiDxX7rLakCPm7+nQmHHcM0+MJqo2hLlkjFtAX3cj5+H5zVKFy97MJ5/7g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5066 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-09_02,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 suspectscore=0 phishscore=0 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090053 X-Proofpoint-ORIG-GUID: BRWUH4Xh2Yq03gdIBZXrdyMvJnpu98ek X-Proofpoint-GUID: BRWUH4Xh2Yq03gdIBZXrdyMvJnpu98ek Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute_req is going to be removed. Convert virtio_scsi to scsi_execute_cmd. Signed-off-by: Mike Christie Reviewed-by: John Garry Reviewed-by: Bart Van Assche --- drivers/scsi/virtio_scsi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index d07d24c06b54..cb5f465950a2 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c @@ -347,9 +347,9 @@ 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_execute_cmd(sdev, scsi_cmd, REQ_OP_DRV_IN, + inq_result, inquiry_len, + SD_TIMEOUT, SD_MAX_RETRIES); if (result == 0 && inq_result[0] >> 5) { /* PQ indicates the LUN is not attached */ From patchwork Fri Dec 9 06:13:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 633174 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 DD224C4332F for ; Fri, 9 Dec 2022 06:16:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229864AbiLIGQg (ORCPT ); Fri, 9 Dec 2022 01:16:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229883AbiLIGQG (ORCPT ); Fri, 9 Dec 2022 01:16:06 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6311A19B7 for ; Thu, 8 Dec 2022 22:16:05 -0800 (PST) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B94VD9g020087; Fri, 9 Dec 2022 06:13:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=BuGVhowifuGV6RuPEoeUKppwXcicwWbbWqztmVohcoU=; b=ca7yWpe3ng0/I0g2BKu8z3IR9xnZV+umIypyCUHMWOjg9U6P9icjR55MU/QuMZYUTQlN 8xAS0P7iuhk44bnsND9f15C9Ky8Gws6r16htw8ffCPDtT4w5MFxKrBBlXL624u3Noh95 2ZCvytQjnsRnP83uAivG2dyC1QiEELcBTNDxgtaiR/KfNdFtOcLLGqhmhyNvmX+V8AzA 6ijc1Uvt9xWAhSYJEVDjztctuB1qlyWMoQOP/h29ZLqeiCZf7TX+GljYKx4W4VPbP4Mh AmUfNTD4cN/ByCco0NZvG9RiortaRhGJ3BXnky+RUhEZH3HX5xUQtrIfTR/+yy1berJh NA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mauf8mcq2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:59 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2B9413CT008380; Fri, 9 Dec 2022 06:13:58 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2177.outbound.protection.outlook.com [104.47.55.177]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3maa61ymwg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:13:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N/qX3J54c56U31GKBaMFSJOpAAlhFxZED0/xZK06YDPzonCsOdXrtIFOY7gP/ZsNdfj/FJtd2Pfnr+p9at+DIGKQJgQllmmQaM0TLgZwpxresb6OJHkqSnOTevqZI5vl0E4i7OLqA6/KlFI6xiV1mK/X1pAYaX3BaXfqfDKlULm/QEfyRABJZk7wlxyBhwFz3+o5Ps9gZdKQv/ZQIRJ4BGRr3WNOZac3ZVQRxi5t/CGP7P5BSgeFpM00F2adUIyYHTR39aMa5IN4FfBp8Ed24YqO8aSrGqFfPfb8AhU0j/o3QIatI3XF/8ndRHI8L9hqMmkOx2trFX3qt6iiI7roXg== 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=BuGVhowifuGV6RuPEoeUKppwXcicwWbbWqztmVohcoU=; b=jOWkX6/IkYUqIHTK80i7Pzc7fRsZkY8iMAN8M0XcMZ06bsiVD+0OcNFl+1jSmHaquJWrvAOfNXVUAruZJRnhNmBhf0bSFJGG/bPxKG3hrgUgt2ZtVrOqtOGJ97VwP8LTulDp5BFNKUDwbbXapwkHai6zVECkIz7MtYhC83/7Mc4Imkk8AuVmdV+6p0tePm2GgMuGmh1lzvPFoBiwzhjvcg4usNV2vhHMKkMWJN2LlauNcccIOSm7KFMQ9N0JMGlHJwh2lhevAi5F0cjEpVfCx4S8Uij/tPyTiHPEyNd6iMZQb8oz6fTj8r0g7PkLYoyc5yzjrL5Qy6+tTK3UZuuIBg== 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=BuGVhowifuGV6RuPEoeUKppwXcicwWbbWqztmVohcoU=; b=m+7Jcz+d/ZWI7BpOcwtG/lb65oQHE3WD8nlTcPUO+PNtA/IK19SQEB7LYB9i/JxU6fG5D3oy1XCXpt0IcyOy/EJgG8tfcPFwynuF71/zUAzuY54sJw9XxQKe1oBoEhzvKsX4SuxB+plzk6KduJm8S5PPkMESinGwGcWQIHU8XdY= Received: from CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) by CH0PR10MB5066.namprd10.prod.outlook.com (2603:10b6:610:c4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.18; Fri, 9 Dec 2022 06:13:56 +0000 Received: from CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99]) by CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99%6]) with mapi id 15.20.5880.016; Fri, 9 Dec 2022 06:13:56 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 13/15] scsi: target_core_pscsi: Convert to scsi_execute_cmd Date: Fri, 9 Dec 2022 00:13:23 -0600 Message-Id: <20221209061325.705999-14-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209061325.705999-1-michael.christie@oracle.com> References: <20221209061325.705999-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR18CA0030.namprd18.prod.outlook.com (2603:10b6:610:4f::40) To CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR10MB1463:EE_|CH0PR10MB5066:EE_ X-MS-Office365-Filtering-Correlation-Id: 27d3481e-5507-4164-a79f-08dad9ac8c97 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IgFO5h/5Wi4+5UOC+JS8IugOiUxPTkPxTBulvqEtsSKyNwVrl8pWCDyy4+YI1l8b9GDo8vIfTubsreH0KNkY8XRzpX9ZEn7zDhTCMH/k+kgxrK8lKk7fhaa4OYcbVGq6QsP9UTbDVCN4NxU2kp3P6TTKICiMPpW4/pW5dWxsfaIukN1m6bdEljpES2xBq/IO/AS2ZmX/qIT18MpE8U9EjyOFmz1wZevm32qLA9T8jGU2JkLQ5Xbe7QwPiS7M9R/a4lm3xYy70JzNcOtrJhshQOWlElgPN4ozBlMWA1DCKxB5iT0iJ2uDSjWW2l2WbpoxUErMHGPTm1lVCaS4JLOrpp+XbLhmEzxRHD6FlNeXHMhw4HxVacdhi3O17hSG2QhqOnkuZ+DryC6eSbPaKASQel5hmP5SgYX0iI5US6rP1iDAeXoUO46sLWQWjS0FoiTivKZFZGZRtagwzXgSHu/Rd2NFESlEsbp0CqUTlei34P6ZpPRdvdm6LH87TD50oPd1k36VQRNhd/gkI3eyBbMW+7+ci5rW4+ncOoheaR51eXmOUWVy4eW51LGh0iSv68ySNt8YXrLB8TAGOZh+JeXkVvtPryuKOT4uX17perSwvnY3uh/ci3lbicKsvEiCUnepd8fVg5CCADQZaFKynl7SOA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR10MB1463.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(396003)(39860400002)(136003)(366004)(346002)(451199015)(478600001)(6512007)(26005)(2906002)(36756003)(6506007)(6666004)(107886003)(41300700001)(86362001)(8676002)(66556008)(66946007)(66476007)(4326008)(316002)(5660300002)(38100700002)(8936002)(6486002)(2616005)(83380400001)(1076003)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pjeKyysMhJU9bdBjlVaK/AUDi+UYnJydqr+RrFHlr9aoNkxFIIVkK8RUJNh2wmxoyYADCNBmz1dL9tHXrbHDgAYjIvTHvb3N/CjYLmmokpJX0HBdOkCg/mCkdLkqBTYgLGS6DNY6Zx7bkhuRe6RZU8CFhLYDQDn2mFXGi52wDq702u0MBjsxSD1RgKvV1tUhOb908HbwUAjRJlY88IB97deRq4vlNYm7b438EVAJvnEzdUZ2X/XQvwavf5BT3Bze56H0T80xnWiqVBDSbkvep/7kFp/UKhzj0OO4qNU1JhY5YdCF5ODDBuc//5dpufeDE6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YWopj/wK7iHrlTVCnI47H7vRsAR8GCfxpHnD/iaI7IHOLM5ZRmHA2y5e99L+ooZGZc9x0u7QK/78BXuSgsGWOZy48QrRgSL6hxQTv2AnZcD+SB5T4J/kNiyCHkKiZqAnbwL5w7PwIP0ZzvTFsUxEWxuf6L2TO7MtXEPP2P4ELV49kfPtESvdDTK2ixo/ZKsE2imEECIAn5rSDw+fOgteeBt8oS2r+9Ig== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27d3481e-5507-4164-a79f-08dad9ac8c97 X-MS-Exchange-CrossTenant-AuthSource: CY4PR10MB1463.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2022 06:13:54.4572 (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: OxaENQhfP+X2xk2FeTSKeq+Eif/AQA/m9Tnc77W/hVSrqFMter1/Z1KfbogbVnwQ1AUotZvaiZ8C9CrafJfKQAyiRT793O7BfLEiD4Vt/uA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5066 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-09_02,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 phishscore=0 spamscore=0 bulkscore=0 mlxscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090053 X-Proofpoint-ORIG-GUID: jOtz7wsUZii1jsWdPqT9VzcHRnp5zp3L X-Proofpoint-GUID: jOtz7wsUZii1jsWdPqT9VzcHRnp5zp3L Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute_req is going to be removed. Convert pscsi to scsi_execute_cmd. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche --- drivers/target/target_core_pscsi.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index 69a4c9581e80..c9dd5a98800f 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -144,8 +144,7 @@ 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_execute_cmd(sdev, cdb, REQ_OP_DRV_IN, buf, 12, HZ, 1); if (ret) goto out_free; @@ -195,8 +194,8 @@ 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_execute_cmd(sdev, cdb, REQ_OP_DRV_IN, buf, + INQUIRY_VPD_SERIAL_LEN, HZ, 1); if (ret) goto out_free; @@ -230,9 +229,8 @@ 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_execute_cmd(sdev, cdb, REQ_OP_DRV_IN, buf, + INQUIRY_VPD_DEVICE_IDENTIFIER_LEN, HZ, 1); if (ret) goto out; From patchwork Fri Dec 9 06:13:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 632844 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 0CF60C4332F for ; Fri, 9 Dec 2022 06:16:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229876AbiLIGQt (ORCPT ); Fri, 9 Dec 2022 01:16:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbiLIGQM (ORCPT ); Fri, 9 Dec 2022 01:16:12 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C636894193 for ; Thu, 8 Dec 2022 22:16:09 -0800 (PST) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B94VB3u010444; Fri, 9 Dec 2022 06:14: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=Pp0kGeJk3emqQjvYVp6iORYkHfkjAVgRNPjBXR4dByo=; b=kd1MIcCGAHWkZt1FWk2l22/k65dDOch0ShtQc31YPjpWVdas54Cz6fO/s5vhIy0hv6K2 iZylYpDcvTIPdUJ4eABCPOzTYqka58Zj88PYGwdOCH13hhQP+zOLMXRBeRmkSu6Q7tCO cPKdBk0EfeHbVzqc4/4tBfatc9faPVdhDf1LjswfGv9Mc57cHYS/ebVigUCkRB+SiIU6 PVFaiWlHcG1VIRQqaWU/bVeLRFPeS59F7R/gly0wdwcvclh0tjQvGgZs2A0u6SgEo8s9 FNeYRkr1uNGK2tleG9/fW5F0lbxfFLJK1uwOI+3wgXDbefjOTypDcuV1cjGDkX3ZyD+3 YA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mauduvcq5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:14:02 +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 2B95fZbC019656; Fri, 9 Dec 2022 06:14:01 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2177.outbound.protection.outlook.com [104.47.55.177]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3maa8jwbry-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:14:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c+VgapQmkvLW/dIpUhDl92yng2euyDaUo3zSle33rCcuK5UAv0terp98yrGOEHCXEmEoYoXiLHDuop6lng4mVQ2bYo8v2f5pos4i70LnsHxKl0JaMbKSgHKYaPqycrkiHIjTbVQTBNa82x8pXPz7iff8gw0sXmvBmA7m2vZJEE2vy8EAsEpo9mz4m2DH1u8wJnKa/6S/MHczdUKwmNNWccu4hK5yMP08W61kW+vBV+wzSSMpHOrpz1oY2Gy3qWG3c/IKHAZ3pbewjf6YWfkbuTD2O+jc201OZvH9Vt4h8bZ8lBZx9Fds/J1jnyrcZkUxUMeIU6HA5xHE+fTu03aMLA== 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=Pp0kGeJk3emqQjvYVp6iORYkHfkjAVgRNPjBXR4dByo=; b=jVp2OLtlQz584J+TFcbNP1yR7kGVt7QSW95rYY86UAuQZz10qvijTPbHUAqdHx1wEG7iD6Y1S4650/1Qmc/ZwJ+oBf0GNNopqghiOPFrSGjzPj2XSjLToONoqv5RGLD+F91+M+kKCYiWii5YmPmsMmEdLuGVsHTLDLi6BvmnM4x+ebdnrY179BXgVzoZx9Z40zoZN4KA9+v9FERaq41i/MKXlPBY8kz8bcmWiuaET7CdSisX/E5YdQ7WEpMIsGZHYFCeRJaPrMaEgSAIMylFic+7JG+ynFizPyZ+9qW3ZehPMM3iRBzsdrVH5812caqCP+aYShJZbEVL0XuZiTG/Ug== 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=Pp0kGeJk3emqQjvYVp6iORYkHfkjAVgRNPjBXR4dByo=; b=wF4FM5Pms/kC4XmqhI4CpwGfBFO9+GUqCdHt7swEFLQznjy9jUwM+GXf46csey1oGwx/ea61/zSWCOTxw/FfjTaBDt8G7REKo0a9T/oFDgeNabCPLcfMuxFttmg7Smr9knbCWSMHm3JrOsYd2c+fhBjFy7ZPNOOHUwodVatVw/U= Received: from CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) by CH0PR10MB5066.namprd10.prod.outlook.com (2603:10b6:610:c4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.18; Fri, 9 Dec 2022 06:13:59 +0000 Received: from CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99]) by CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99%6]) with mapi id 15.20.5880.016; Fri, 9 Dec 2022 06:13:59 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 14/15] scsi: cxlflash: Convert to scsi_execute_args/cmd Date: Fri, 9 Dec 2022 00:13:24 -0600 Message-Id: <20221209061325.705999-15-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209061325.705999-1-michael.christie@oracle.com> References: <20221209061325.705999-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR18CA0024.namprd18.prod.outlook.com (2603:10b6:610:4f::34) To CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR10MB1463:EE_|CH0PR10MB5066:EE_ X-MS-Office365-Filtering-Correlation-Id: 9785d0dc-13a9-4f76-32a5-08dad9ac8dac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4JzNiuwdfMWHqKwuc38Dv+kX2RRdssiNgKTBc6EPGOsLmSi/1wyuQ/J/MMGVAo9OdPW5Y5RkxKarMXWCrd9y+ATdi1RXR1iK5uxWH5a8zDxe/SJDIqhn7rm10kFmJw+Y6tby2PgX3QDgCR9OLBaqVryEbFe5u+i42e0NCPOxKcJrglnmcLBMIWlFOlcpqHvY+GAQpoUXh5yez+mLVZiPLIzTgBaJ/BTgjEdq3y7DBBJMmbqB2P6Byfix1aqA2rAXm9nATtlveXFZ6+rgliFQwZW00LnSY+m7awWm95lUyizmhm1DjjfFQzS88bDaUjLdBdo/a9EjsVZ12NiobA5WZUsIkTsdlqe6SZtFafg70Bd9eX2KPJLQO1Z6srmnYDBsi+zLyS8fbrPKa3nybrIq+W/93DxmngIPqbkYCGVCAsggKMRrXrWLOUz1XZBzS0IDZ8TmPeTKuV+dbgjyvgAG+z7UZ2qKS92b9O1lXBuAJTq7nW/xhNcsRDxvRNTsqla6rq1zvWDXlO/vrsfvD9gakOYMllzgfrpT/sSz5SGo5yVwHH4d1wjGUe5RnilelCXlOkViP2S5nnoxQkJ3oYK0fhFY+Bbt3d3ZPAUvS8Irm/rlsENcNsuecQfT/qCpaiiB5iVXBLUVNf9RPEqrMXPr9A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR10MB1463.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(396003)(39860400002)(136003)(366004)(346002)(451199015)(478600001)(6512007)(26005)(2906002)(36756003)(6506007)(6666004)(107886003)(41300700001)(86362001)(8676002)(66556008)(66946007)(66476007)(4326008)(316002)(5660300002)(38100700002)(8936002)(6486002)(2616005)(83380400001)(1076003)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lIL/GX+KNOn44YF0sBfTYS9B+izUYh0OXx0s2mPvxcBQ/Jk10JsyqH6oB8Vzft8MAyr/+Zrmhyi8CMMXgmophyhRybWIUr5zl4m80iWMiFObD0eX5DfAyKWdTkWTOkPIDddRPDeQUkEIggfht+82lU7neStiSBQW1ufEJv1Hb/DhNryTFhhXa2DHHkKXoGjNqSL9d8lIqdY3oEe7Fa/LS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+sKeevqgQSqXq8seQvmQBgYHIiq1ao+KtL59EHFRaKhvcB9yTqjVKQCGBXBOqxGjtSibBY0wxvG76W2eCzII1vawh4ftZsgdzrEYnR2mQx3Oj8U9YjrgvowCTnBbpAuILaHg3TnEPOez5mkHdpFJ/fLFyfkrJP2YISKi4EA/YK8JJmIIJeAX3riiHw+ZZNRHdv2qkHDDVMU2FlQLYrxxH92Ph3qiSwweQh10Ci6Qpc2XBDx50bJUWzzfh/HLM17n1vgV/tV1j1F2v2uEFNfQxLxaXBbw/nx+lZL6KZVaEMASCYSDmd0wGIzmvQ1nz/TCM9Bg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9785d0dc-13a9-4f76-32a5-08dad9ac8dac X-MS-Exchange-CrossTenant-AuthSource: CY4PR10MB1463.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2022 06:13:56.8477 (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: Rhmr1OjBaF0mXqeBadslQqmHo4h/XeWD75PbWVjfdRaSJAitZSFiGyswoqm8mnHtgLBCE5fobUfRn7lhUFN5pcrnAu6hHZUw6JY/OLtwhuw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5066 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-09_02,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 suspectscore=0 phishscore=0 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090053 X-Proofpoint-ORIG-GUID: Lqy0_HhXZJpGInfKu6t7X78LTggTNMJ9 X-Proofpoint-GUID: Lqy0_HhXZJpGInfKu6t7X78LTggTNMJ9 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute is going to be removed. Convert cxlflash to use scsi_execute_args/cmd. Signed-off-by: Mike Christie Reviewed-by: John Garry Reviewed-by: Bart Van Assche --- drivers/scsi/cxlflash/superpipe.c | 34 ++++++++++++++++--------------- drivers/scsi/cxlflash/vlun.c | 32 ++++++++++++++--------------- 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c index df0ebabbf387..e34a129b4f87 100644 --- a/drivers/scsi/cxlflash/superpipe.c +++ b/drivers/scsi/cxlflash/superpipe.c @@ -308,19 +308,19 @@ 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 - * 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 - * 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 - * 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. + * in scsi_execute_args(), 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_args() returns, + * reacquire the ioctl read semaphore and check the adapter state in case it + * changed while inside of scsi_execute_args(). 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. * * Note that the above puts a requirement on this routine to only be called on * an ioctl thread. @@ -333,6 +333,9 @@ static int read_cap16(struct scsi_device *sdev, struct llun_info *lli) struct device *dev = &cfg->dev->dev; struct glun_info *gli = lli->parent; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; u8 *cmd_buf = NULL; u8 *scsi_cmd = NULL; int rc = 0; @@ -357,9 +360,8 @@ 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_execute_args(sdev, scsi_cmd, REQ_OP_DRV_IN, cmd_buf, + CMD_BUFSIZE, to, CMD_RETRIES, exec_args); 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..c6c72e470985 100644 --- a/drivers/scsi/cxlflash/vlun.c +++ b/drivers/scsi/cxlflash/vlun.c @@ -397,19 +397,19 @@ static int init_vlun(struct llun_info *lli) * @nblks: Number of logical blocks to write same. * * The SCSI WRITE_SAME16 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 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 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 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. + * while in scsi_execute_cmd(), 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_cmd() returns, reacquire the ioctl read semaphore and check the + * adapter state in case it changed while inside of scsi_execute_cmd(). 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. * * Note that the above puts a requirement on this routine to only be called on * an ioctl thread. @@ -450,9 +450,9 @@ 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_execute_cmd(sdev, scsi_cmd, REQ_OP_DRV_OUT, + cmd_buf, CMD_BUFSIZE, to, + CMD_RETRIES); down_read(&cfg->ioctl_rwsem); rc = check_state(cfg); if (rc) { From patchwork Fri Dec 9 06:13:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 633173 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 2478BC4332F for ; Fri, 9 Dec 2022 06:16:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229877AbiLIGQx (ORCPT ); Fri, 9 Dec 2022 01:16:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229738AbiLIGQO (ORCPT ); Fri, 9 Dec 2022 01:16:14 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2629A944DA for ; Thu, 8 Dec 2022 22:16:14 -0800 (PST) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B8MJ6nk003050; Fri, 9 Dec 2022 06:14: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=PAhvQBMUfGw98GaLDuLKCxRM6MaM2bmhGACl/P8/DfQ=; b=FxQeP6DWT3+WWs6GCL42acYZZIfwmreH6WNrY3RLMyRzytjePCjIcq8HP+LLyHJeRFVH +VagQ7Nh4zVD6g8OW0QObE7E91G2a35RO3VlmJBrEduGLkQpehvZn7Bth765qqJOsQ0B bRh6fj+05/YqgLebm+D5SLRBNF40BFKdL5jg58J7czoQMzWMVbbOvvBz5UWvutIGyU6R 689V8xufN8DHLX3IkTTHD5hb1NkXWUvUOFG+hxSYABmwZaz2V85JvwfYEELCTXAQ7/yD 7QoFCBo4HmunQSHerCXvlLREV7JrRoYU2ugI9i20piCmzZDVx+sNJHFfRP5+5pCSWwno OA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3maudkcjeg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:14:05 +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 2B95ZnmR033876; Fri, 9 Dec 2022 06:14:04 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2168.outbound.protection.outlook.com [104.47.55.168]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3maa6c660h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Dec 2022 06:14:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QWxkbeBkNmQJavYmtd1yQnwBULi6UnMP+oa0sCOS5kgKsGBM/RhOQMhg3d0+Z5Fy6AGQ6vTMMs4iPHCTF+baDnzJS9T3fv1X+AgdR9ABB8XB3OYVDWSWu2qTE9pRVXvZWUmWOvHb6nnkPzOA8Leq1bnNjmlZFb46bglfQ3MepXNIsL1rKC32ctHHGkChXgHnkWEzBPBQJY2W3wHKmg5Moyce9cIz6TRydwv2F2+HOae3TAb+kO1EvLrYQao1EwR7a+8s+RZugUbQQFeDp/CjVIOXS9u22vYJOs6m5+AGhjfWo5aRXrOsryLi8oCUVFRuxAjukB2J2ZrlFIgzwNGCew== 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=PAhvQBMUfGw98GaLDuLKCxRM6MaM2bmhGACl/P8/DfQ=; b=GQs6Ta/Q6sTkXWTil4vP24G6idmjvnoWoZ8rZ6c2LnPl1Dk4Bt8B7LEG8TeFYJFdxnRM0oOYkX8AVOfwxRhux5g4fjtao6u78Q6CNbeVN3koKYp+QF60Pc8LXOvoA/8tt2CwMrPCeEEETFH3+8Zh55HP3LGB9ZEATP2uFWpEDNzTqXVygFxRizeaxTbup1eDJeB7hSS1HKmn6wQTUM1MuCtIPv1/ZvSHsQcm5vvb+3L3L9LiWZcqaj37tFC3N0R8eMLSIChwwCU6s1liRQDeapAO+Xf5w6v9+LcYHqiOnchoHe3lpNMZ/UcgSngutyBZoHsUzdX9Vwwu5/dH7r9jOg== 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=PAhvQBMUfGw98GaLDuLKCxRM6MaM2bmhGACl/P8/DfQ=; b=iylgsxF73zTHdFbXiM6ZmGFUBbZ/mLE0JVMjYBoWkrDBt5KS+4Js9uFHtfeD4MSyvpHFYhJp/Jz0sP+HNEJUHew632wlTWTaU837fm+AvQ/aXfc2QLuJuLKRlYLj6FTzx7t8GV/87ToUDQKjwJgdWkAdfU/ZPtjd7EgeKt5PwTI= Received: from CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) by CH0PR10MB5066.namprd10.prod.outlook.com (2603:10b6:610:c4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.18; Fri, 9 Dec 2022 06:14:02 +0000 Received: from CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99]) by CY4PR10MB1463.namprd10.prod.outlook.com ([fe80::a99a:a833:4f4c:9e99%6]) with mapi id 15.20.5880.016; Fri, 9 Dec 2022 06:14:02 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v2 15/15] scsi: Remove scsi_execute_req/scsi_execute functions Date: Fri, 9 Dec 2022 00:13:25 -0600 Message-Id: <20221209061325.705999-16-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209061325.705999-1-michael.christie@oracle.com> References: <20221209061325.705999-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR18CA0021.namprd18.prod.outlook.com (2603:10b6:610:4f::31) To CY4PR10MB1463.namprd10.prod.outlook.com (2603:10b6:903:2b::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR10MB1463:EE_|CH0PR10MB5066:EE_ X-MS-Office365-Filtering-Correlation-Id: 105af836-a5e6-4156-9ee2-08dad9ac8f67 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TRu4DKa/1IkKIh4CG7vP0bWmuJst+EKUaFb/5he7kqZhrdMzq6OR2Q27E4HQGMa0YDkWMH1Bk8cmlzpUiZiBHZQe4sc8OJ9lXijavIPjAPEv2CWnJzHxwFE0G52USt5DXKMqal9O20VMYFaXdfHB4cnRCuFb1um99nc45CIYf6E8ycPfnxsJMSaoioegavnNNyK3rvXGWXe/trfw7fi8tuX+r1cAMR7PUVF9822KipiN/N/paLvkdYb8zSx5TIec4x1pIjuTZYHohGYXG0M78ke1PWPvIa98aRxlK3EHnoUNtYEJj5jLhi0IdOpaArLuV5QguZXIFlsh4LzBdKN/VTifcYOJQXalhoOjl3hHWIr7q5o97AKEMJYte4KyFuXhjghc9uoV/WEaQZ4IxVm7romcgbkvb8kEfc3p9JpfJjEhuMXE8fiD4WxEGZOvFGYTz8rmq+ZPmqFrl0xRhGuQufk2jHTnjI08VcNJzZTQ9WMHdGcZxI2/KXP/sbG50bSQ0j6SCFx7dMqDt1spY4Ig14OtcMHKycq0DVKewm0acwuw11tjVODzarWC+Xt0aIGUvIpa0Bvk5e+72uPvDD1DNdGsUcUQ83a/hoEs/nZaT/3SgPqLtKchCMytUPXOgnq60gt4Lo57kp9qm2vVyB57cQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CY4PR10MB1463.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(396003)(39860400002)(136003)(366004)(346002)(451199015)(478600001)(6512007)(26005)(2906002)(36756003)(6506007)(6666004)(107886003)(41300700001)(86362001)(8676002)(66556008)(66946007)(66476007)(4326008)(316002)(5660300002)(38100700002)(8936002)(6486002)(2616005)(83380400001)(1076003)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KJ2uC4Meu3spneJHmVd/u7jiZiGpLpZmKRzA2i+f8E6/FfPG1FudTp9X2+hYr9in0UADATbaRpEYmXBLcu0aQQQObBcyEjM71Ep5xbCfh59JbNtMT167taqjDPgJtjDAGccrTZgitRqLlLuB/jWfqqnv+pUXCljdfvOkwv7dc9MBWXvNg8XiMKEACplITvWk1DNAxxxdi2+Qe5rtLGPuo8fZmNLdsfnHouAUXxIazVwi8hExGFUwsJPa0eEgl0NEWrAsrSgC8wPsUf0j9tzI6DvOpcNFEQf7uKV+2JbyDNhWfOdnnhbOfBztDnFOsm1rEvAdVSEYw+jbO3wM4H2XhS/SF0WIHEtoXCAAt9eRUsGLjd/LWRyLHJKfpR7U1h5xaB3ggW7BbIka80S2EqF9KD0K89EY05S+WTZ0D8ZFrJ9IaaEAHbK4ZqFxuExUJAvb83PTOnJlBc53gq0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qP1+yXjB25FNp63mQEmGYI7xh/IdN6SjRAx7vjGavX/SM1K6ZNzrbfTx0oQTouyAHSjqymqwKA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 105af836-a5e6-4156-9ee2-08dad9ac8f67 X-MS-Exchange-CrossTenant-AuthSource: CY4PR10MB1463.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2022 06:13:59.2068 (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: X6HuqrAnqt8qrBtjulaBhYT8legHoFz4qfI6m3/W+xMB04HhWY0sYcE8HCYLYg2AwQdSxc7JYXLMcA6HOl2paiCS82ETSxJHLYkbzh+de40= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5066 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-09_02,2022-12-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212090053 X-Proofpoint-GUID: rgapHJkZaF-MZyEMZRxQDV-jFxifoxVd X-Proofpoint-ORIG-GUID: rgapHJkZaF-MZyEMZRxQDV-jFxifoxVd Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute and scsi_execute_req are no longer used so remove them. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche --- include/scsi/scsi_device.h | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index eb960aa73b3b..9ed264ad3fa8 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -487,39 +487,6 @@ int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, retries, exec_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_execute(_sdev, _cmd, (_data_dir == DMA_TO_DEVICE ? \ - REQ_OP_DRV_OUT : REQ_OP_DRV_IN) | _flags, \ - _buffer, _bufflen, _timeout, _retries, \ - (struct scsi_exec_args) { \ - .sense = _sense, \ - .sshdr = _sshdr, \ - .req_flags = _rq_flags & RQF_PM ? \ - BLK_MQ_REQ_PM : 0, \ - .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 == DMA_TO_DEVICE ? - REQ_OP_DRV_OUT : REQ_OP_DRV_IN, buffer, - bufflen, timeout, retries, - (struct scsi_exec_args) { - .sshdr = sshdr, - .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);